<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="True" Inherits="Kesion.NET.WebSite.Admin.Shop.Admin_YunDataTable" Title="查看所有数据表记录" Codebehind="KS.YunData.Table.aspx.cs" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.BLL" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">

<asp:Panel ID="listPanel" runat="server" Width="100%">
  
   <div class="listedit">
       <ul>
      		<asp:LinkButton ID="DoMatchings" runat="server" OnClick="DoMatching" CssClass="button">一键同步云数据结构</asp:LinkButton>
      		<asp:LinkButton ID="CreateXMLs" runat="server" OnClick="CreateXML" CssClass="button">生成本地XML文档</asp:LinkButton>
       </ul>
   </div>
       
   <div class="content-area mt20">
 
      <script>
          function view(tablename) {
              parent.openWin('查看表['+tablename+']的字段', 'Yun/KS.YunData.Table.aspx?tablename=' + tablename, false,960,680);
          } 
      </script>
     <div class="myTitle">
           <span> 云端表：<asp:Label runat="server" CssClass="greenFont" ID="YunTableNum" Text="0"></asp:Label>张</sp>
        <span style="margin-left:50px"> 本地表：<asp:Label  runat="server" CssClass="greenFont" ID="LocalTableNum" Text="0"></asp:Label>张</span>
       </div>
        <KS:KSGV ID="TableListView" cssclass="CTable" runat="server" AutoGenerateColumns="False"  GridLines="None" OnRowCommand="List_RowCommand"
            OnRowDataBound="FieldListView_RowDataBound" PagerType="CustomNumeric" Width="99%" EnableTheming="True" HorizontalAlign="Center" EmptyDataText="没有数据表!">
            <Columns>
              <asp:TemplateField HeaderText="序号">
                <itemstyle horizontalalign="Center" width="60px" />
                <itemtemplate>
                    <%#Container.DataItemIndex+1%>        
                </itemtemplate>
              </asp:TemplateField>

             <asp:TemplateField HeaderText="云端数据表">
                <itemstyle/>
                <ItemTemplate>
                <%# Eval("TableName")%>
                </ItemTemplate>  
                </asp:TemplateField>

                 <asp:TemplateField HeaderText="是否匹配表">
                  <itemstyle HorizontalAlign="Center"/>
                <ItemTemplate>
                    <a class=" <%# Eval("ExistTable").ToString()=="1"?"ok":"no"%>"> </a>
                </ItemTemplate>  
                </asp:TemplateField>

                 <asp:TemplateField HeaderText="是否匹配字段">
                  <itemstyle HorizontalAlign="Center"/>
                <ItemTemplate>
                <a class=" <%# Eval("ExistField").ToString()=="1"?"ok":"no"%>"> </a>
                </ItemTemplate>  
                </asp:TemplateField>
               
               <asp:TemplateField HeaderText="云端字段数量">
                  <itemstyle horizontalalign="Center" />
                <ItemTemplate>
                <span><%# Eval("FieldNum") %></span> 条
                </ItemTemplate>  
                </asp:TemplateField>
               <asp:TemplateField HeaderText="字段">
                  <itemstyle horizontalalign="Center" />
                <ItemTemplate>
                 <a href="javascript:;" onclick="view('<%# Eval("TableName")%>')" class="greenFont">查看</a>
                </ItemTemplate>  
                </asp:TemplateField>
                  <asp:TemplateField HeaderText="操作">
                  <itemstyle horizontalalign="Center" />
                <ItemTemplate>
                   
                 <asp:LinkButton ID="DoMatchings" ToolTip="同步" CssClass="greenFont" runat="server" commandname="match" commandargument=<%#Eval("TableName") %>><b></b>同步</asp:LinkButton>
                </ItemTemplate>  
                </asp:TemplateField>
        
            </Columns>
            <HeaderStyle CssClass="CTitle" />
            <EmptyDataRowStyle CssClass="emptycss" />
        </KS:KSGV>
        <script type="text/javascript">
		showtips('<span class="state"><strong>说明：</strong><br /></span>这里列出云端数据库的所有数据，并检查是否匹配!');
		</script>
		<div class="footer_page"></div>

     </asp:Panel>
     
     <asp:Panel ID="PanShow" runat="server" Visible="false">
     <asp:Label runat="server" Visible="false" ID="thistablename" Text=""></asp:Label>
     <KS:KSGV ID="FieldListView"  cssclass="CTable" runat="server" AutoGenerateColumns="False"  GridLines="None" OnRowCommand="List_RowCommand"
            OnRowDataBound="FieldListView_RowDataBound" PagerType="CustomNumeric" Width="99%" EnableTheming="True" HorizontalAlign="Center" EmptyDataText="没有数据表!">
            <Columns>
              <asp:TemplateField HeaderText="序号">
                <itemstyle horizontalalign="Center" width="50px" />
                <itemtemplate>
                    <%#Container.DataItemIndex+1%>        
                </itemtemplate>
              </asp:TemplateField>
            
                 <asp:TemplateField HeaderText="字段名称">
                  <itemstyle HorizontalAlign="Center"/>
                <ItemTemplate>
                <%# Eval("FieldName")%>
                
                </ItemTemplate>  
                </asp:TemplateField>

                  <asp:TemplateField HeaderText="是否存在">
                  <itemstyle HorizontalAlign="Center"/>
                <ItemTemplate>
              <a class=" <%# Eval("ExistField").ToString()=="1"?"ok":"no"%>"> </a>
                
                </ItemTemplate>  
                
                  </asp:TemplateField>
                 <asp:TemplateField HeaderText="操作">
                  <itemstyle horizontalalign="Center" />
                <ItemTemplate>

                 <asp:LinkButton ID="DoMatching" ToolTip="同步" runat="server" commandname="matchf" commandargument=<%#Eval("FieldName") %> ><b></b>同步</asp:LinkButton>
                </ItemTemplate>  
                </asp:TemplateField>

             
            </Columns>
            <HeaderStyle CssClass="CTitle" />
            <EmptyDataRowStyle CssClass="emptycss" />
        </KS:KSGV>
        
     </asp:Panel>
  </div>
</asp:Content>