<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Admin.User.KS_UserImportMade" Codebehind="KS.UserImportMade.aspx.cs" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" runat="server">
     <div id="manage_top" class="toptitle menu_top_fixed">
      	 <ul class="titleTab">
      		<li>操作导航：</li>
          </ul>  
      </div>
      <div class="menu_top_fixed_height"></div>   
      <div class="content-area">

    <style type="text/css"> 
body{ 
text-align:center; 
}
.graph{ 
width:450px; 
border:1px solid #9bdf70; 
height:25px; 
}
#bar{ 
display:block; 
background:#FFE7F4; 
float:left; 
height:100%; 
text-align:center; 
}
#barNum{ 
position:absolute; 
}
</style> 

<script type="text/javascript">
    function loadTable() {
        jQuery("#showtable").show();
        jQuery.get('KS.ContentImport.aspx', { action: 'loadTable', lst: jQuery('#<%=this.LabelDataSource.ClientID %>>option:selected').val(), cstr: jQuery('#<%=this.ConnStr.ClientID %>').val() }, function (s) {
            jQuery("#tablename").empty().append(s);
        });
    }
    function checkdatasource() {
        if (jQuery('#<%=this.ConnStr.ClientID %>').val() == "") {
            KesionJS.AlertByTime(1, '请先上传需要导入的文件！', 2);
        } else {
            jQuery.get('KS.ContentImport.aspx', { action: 'CheckDataSource', lst: jQuery('#<%=this.LabelDataSource.ClientID %>>option:selected').val(), cstr: jQuery('#<%=this.ConnStr.ClientID %>').val() }, function (s) {
                if (s == 'true') {
                    KesionJS.AlertByTime(1, '恭喜，数据源连接测试通过!', 2);
                    loadTable();
                }
                else {
                    KesionJS.AlertByTime(2, '连接出错，请检查连接字符串!', 2);
                }
                return false;
            });
        }
    }
    </script>

<asp:Panel ID="top" runat="server" Width="100%">

      <table width="96%" align="center" border="0" cellpadding="1" cellspacing="1" class="CTable">  
          <tr><td class="lefttd" style="text-align:left;padding-left:4px;"><strong>第一步 请选择数据源</strong></td></tr>
          </table>
    <br />
      <table width="96%" align="center" border="0" cellpadding="1" cellspacing="1" class="CTable">  
           <tr style="display:none;">
               <td class="lefttd" style="height: 30px; text-align: right">
                    <strong>数 据 源：</strong></td>
                <td class="righttd" style="height: 30px; text-align: left">
                        <asp:DropDownList ID="LabelDataSource" runat="server">
                         <asp:ListItem Value="1">外部Access数据源</asp:ListItem>
                         <asp:ListItem Value="2">外部MS SQL数据源</asp:ListItem>
                         <asp:ListItem Value="3">外部ODBC数据源</asp:ListItem>
                         <asp:ListItem Value="4">外部Oracle数据源</asp:ListItem>
                         <asp:ListItem Value="5" Selected="true">外部Excel数据源</asp:ListItem>
                         <asp:ListItem Value="6">外部OLE数据源</asp:ListItem> 
                        </asp:DropDownList>
                </td>
            </tr>
          <asp:Panel ID="Panel1" runat="server">
        <tr >
                <td class="lefttd" style="height: 30px; text-align: right">
                    <strong>连接字符串：</strong></td>
                <td class="righttd" style="height: 30px; text-align: left">
                    <span style="display:none">
                 <asp:TextBox ID="ConnStr" runat="server" Height="50px" TextMode="MultiLine" Width="450px"></asp:TextBox>
                    </span>
                    <br />
                    <asp:FileUpload ID="FileUpload1" runat="server" /> <br />
                    <asp:Button ID="Button3" runat="server" CssClass="button" Text="确认导入" OnClick="Button3_Click"   />
                    温馨提示：每次限制导入<font style="color:red;">100行</font>数据信息，单次导入文件大小不超过<font style="color:red;">1M</font>
                    <span style="display:none">
                    <asp:Button ID="TextButton" runat="server" Text="选择导入的表"  CssClass="button" CausesValidation="False" UseSubmitBehavior="False" />
                        </span>
                </td>
            </tr>
          </asp:Panel>
           <asp:Panel ID="showtable" runat="server" Visible="false">
          <tbody>
        <tr>
        <td class="lefttd" style="height: 30px; text-align: right;"><strong>请选择要导入数据表：</strong></td>
          <td class="righttd" style="height: 30px; text-align: left;" > 
              <asp:DropDownList ID="tablename" runat="server">
              </asp:DropDownList>
         </td>
     </tr> 
          <tr>
                <td class="lefttd" style="height: 30px; text-align: right">
                    </td>
           <td class="righttd"  style="height: 30px; text-align: left">  
               <asp:Button ID="Button1" runat="server" CssClass="button" OnClick="Button1_Click" Text="下一步" />
            </td>
          </tr>
              </tbody> </asp:Panel>
  </table>
  </asp:Panel>   
      
     <asp:Panel ID="list" runat="server" Width="100%">
          
           <asp:Label ID="Label1" runat="server" Text="Label"/>
         <br />
           <asp:Button ID="Button2" CssClass="button" runat="server" Text="确定导入" OnClick="Button2_Click"/>   


 </asp:Panel> 
 
 </div>
       
</asp:Content>
