<%@ Page Language="C#" AutoEventWireup="true" Codebehind="album_categorymanage.aspx.cs"
    Inherits="Discuz.ForumPage.Admin.album_categorymanage" %>

<%@ Register TagPrefix="cc1" Namespace="Discuz.Control" Assembly="Discuz.Control" %>
<!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 runat="server">
    <title>无标题页</title>
    <link href="../styles/datagrid.css" type="text/css" rel="stylesheet">
    <link href="../styles/calendar.css" type="text/css" rel="stylesheet">
    <link rev="stylesheet" media="all" href="../styles/default.css" type="text/css" rel="stylesheet">
    <link href="../styles/dntmanager.css" type="text/css" rel="stylesheet">

    <script type="text/javascript">
		function validate()
		{
			if(document.getElementById("albumcateTitle").value == "")
			{
				Message("相册分类名称不能为空！");
				document.getElementById("albumcateTitle").focus();
				return false;
			}
			
			if(document.getElementById("displayorder").value == "")
			{
				Message("显示顺序不能为空！");
				document.getElementById("displayorder").focus();
				return false;
			}
			
			return true;
		}
		
		function Message(m)
		{
			document.getElementById("success").style.display = 'none';
			document.getElementById("SubmitButton").disabled = false;
			alert(m);
		}
		
		function isNaNEx(str)
		{
			return !(/^\d+$/.test(str));
		}		
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <cc1:DataGrid ID="DataGrid1" runat="server" PageSize="20" DataKeyField="Albumcateid"
            TableHeaderName="相册分类管理" OnEditCommand="DataGrid1_EditCommand" OnDeleteCommand="DataGrid1_DeleteCommand"
            OnItemDataBound="DataGrid1_ItemDataBound">
            <Columns>
                <asp:TemplateColumn HeaderText="选择" Visible="False">
                    <itemtemplate>
				        <input id="cateid<%#DataBinder.Eval(Container, "DataItem.Albumcateid").ToString()%>" type="checkbox" value="<%#DataBinder.Eval(Container, "DataItem.albumcateid").ToString()%>"	name="albumcateid" />
                    </itemtemplate>
                </asp:TemplateColumn>
                <asp:BoundColumn DataField="Title" HeaderText="相册分类名称"></asp:BoundColumn>
                <asp:TemplateColumn HeaderText="操作">
                    <itemtemplate>
                    <asp:LinkButton id="lkbtn_Edit" runat="server"  CommandName="Edit" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.Albumcateid") %>'>编辑</asp:LinkButton>&nbsp; 
                    <asp:LinkButton id="lkbtn_Delete" runat="server"  CommandName="Delete" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.Albumcateid") %>'>删除</asp:LinkButton> 
                    </itemtemplate>
                </asp:TemplateColumn>
            </Columns>
        </cc1:DataGrid>
        <div class="ManagerForm">
            <fieldset>
                <legend style="background: url(../images/icons/icon54.jpg) no-repeat 6px 50%;">
                    <asp:Label ID="prompt" runat="server" Text="新增相册分类" /></legend>
                <table class="datagridStyles" cellspacing="0" cellpadding="3" rules="rows" border="0"
                    id="smilesgrid">
                    <tr>
                        <td class="td2" width="20%">
                            相册分类名称:</td>
                        <td class="td2" width="30%">
                            <cc1:TextBox ID="albumcateTitle" runat="server" Size="50" RequiredFieldType="暂无校验"
                                CanBeNull="可为空"></cc1:TextBox></td>
                        <td class="td2">
                            显示顺序:</td>
                        <td class="td2">
                            <cc1:TextBox ID="displayorder" runat="server" Size="10" RequiredFieldType="数据校验" />
                            <asp:RegularExpressionValidator 
       id="RegularExpressionValidator1" runat="SERVER" 
       ControlToValidate="displayorder" 
       ErrorMessage="请输入整数"
       ValidationExpression="^[-]?\d+\d*$">
     </asp:RegularExpressionValidator>
                            </td>
                    </tr>
                    <tr>
                        <td class="td1">
                            相册分类描述:</td>
                        <td class="td1" colspan="3">
                            <cc1:TextBox ID="description" runat="server" Rows="6" Cols="50" TextMode="MultiLine"
                                RequiredFieldType="暂无校验" CanBeNull="可为空" /></td>
                    </tr>
                </table>
            </fieldset>
            <div align="center">
                <input id="albumCateId" value="0" runat="server" type="hidden" /><cc1:Button ID="SubmitButton"
                    runat="server" Text=" 提 交 " ValidateForm="true" OnClick="SubmitButton_Click"></cc1:Button></div>
        </div>
    </form>
    <%=footer%>
</body>
</html>
