<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Module.aspx.cs" Inherits="TotCms.Web.Admin.Module" %>
<%@ Register src="UI/main_top.ascx" tagname="main_top" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>内容模型管理</title>
  <link href="style/global.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
      <uc1:main_top ID="main_top1" runat="server" />
    
    </div>
    <asp:ListView ID="lvList" runat="server" ItemPlaceholderID="items" InsertItemPosition="FirstItem" 
        onselectedindexchanged="lvList_SelectedIndexChanged" 
        onitemdeleting="lvList_ItemDeleting" onitemediting="lvList_ItemEditing" 
        oniteminserting="lvList_ItemInserting" 
        onitemupdating="lvList_ItemUpdating" onitemcommand="lvList_ItemCommand" 
        onitemcanceling="lvList_ItemCanceling" 
      onitemdatabound="lvList_ItemDataBound" DataKeyNames="id">
        <LayoutTemplate>
          <table cellpadding="0" cellspacing="1" border="0" width="100%" class="border">            
          <tr class="suphead">
              <td>id</td>
              <td>名称</td>
              <td>表名</td>
              <td>字段管理</td>
              <td>操作</td>
          </tr>
          <asp:PlaceHolder runat="server" ID="items"></asp:PlaceHolder>
          </table>
        </LayoutTemplate>
        <AlternatingItemTemplate>
          <tr class="alterlines">
          <td><%# Eval("id") %></td>
          <td><%# Eval("Title") %></td>
          <td><%# Eval("TableName") %></td>
          <td><a href='Fields.aspx?datamodule=<%# Eval("id") %>'>字段管理</a></td>
          <td>
          <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="编辑" />
              <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                  Text="删除" OnClientClick="return confirm('确定删除吗?')" />
          </td>
          </tr>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <tr class="lines">
            <td>id</td>
            <td>
              名称：<asp:TextBox ID="tbTitle" runat="server" Text='<%# Eval("Title") %>'></asp:TextBox></td>
            <td>
                <%# Eval("TableName") %></td>
            <td>字段管理</td>
            <td>
              <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="更新" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="取消" />
            </td>
            </tr>
        </EditItemTemplate>
        <EmptyDataTemplate>
            暂时没有数据.
        </EmptyDataTemplate>
        <InsertItemTemplate>
            <tr class="alterlines">
            <td>插入行</td>
            <td>
                名称：<asp:TextBox ID="tbTitle" runat="server"></asp:TextBox></td>
            <td>
                表名：<asp:TextBox ID="tbTableName" runat="server"></asp:TextBox></td>
            <td>字段管理</td>
            <td>
            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="添加" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="取消" />
            </td>
            </tr>
        </InsertItemTemplate>

        <ItemTemplate>
            <tr class="lines">
            <td><%# Eval("id") %></td>
            <td><%# Eval("Title") %></td>
            <td><%# Eval("TableName") %></td>
            <td><a href='Fields.aspx?datamodule=<%# Eval("id") %>'>字段管理</a></td>
            <td>
            <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="编辑" />
                    <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                        Text="删除" OnClientClick="return confirm('确定删除吗?')" />
            </td>
            </tr>
        </ItemTemplate>
        
    </asp:ListView>
    </form>
</body>
</html>

