<%@ Page language="c#" Codebehind="PeriodTime.aspx.cs" AutoEventWireup="True" Inherits="SWTraining.Class.PeriodTime" Title = "教务管理-时段设置" %>
<%@ Import Namespace="SWTraining"%>

<!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">
<link id="linkStyle" runat="server" href="../Themes/Blue/css.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
		<form id="Form1" method="post" runat="server">
		
<div id="sw_content">
		
        <div class="divpanel">	
        <asp:Label ID="labPeriodTimeName" runat="server" Text = "时间段："></asp:Label><asp:textbox id="tbxPeriodTimeName" runat="server"></asp:textbox>
								组：<asp:DropDownList id="ddlGroupType" runat="server">
									        <asp:ListItem Value="1" Text = "春"></asp:ListItem>
									        <asp:ListItem Value="2" Text = "夏"></asp:ListItem>
									        <asp:ListItem Value="3" Text = "秋"></asp:ListItem>
									        <asp:ListItem Value="4" Text = "冬"></asp:ListItem>
									        <asp:ListItem Value="7" Text = "其它"></asp:ListItem>
								</asp:DropDownList>
	        <asp:Button id="btnGo" runat="server" Text = "转到" onclick="btnGo_Click"></asp:Button>
	        <asp:Button id="btnAdd" runat="server" Text = "增加" onclick="btnAdd_Click"></asp:Button>
            格式：14:30-17:30<asp:regularexpressionvalidator id="_tbxPeriodTimeName" runat="server" ControlToValidate="tbxPeriodTimeName"
									ValidationExpression="(((0?[1-9])|((1[0-9])|(2[0-4])))[\:]((0?[0-9])|((1|2|3|4|5)[0-9])))[\-](((0?[0-9])|((1[0-9])|(2[0-4])))[\:]((0?[0-9])|((1|2|3|4|5)[0-9])))$"></asp:regularexpressionvalidator>
        </div>

        <div class="divpanel">
	
	        <asp:GridView ID="GridView1" runat="server" CssClass="gridview" 
                AutoGenerateColumns="False" DataKeyNames="PeriodTimeID" 
                OnRowCancelingEdit="GridView1_RowCancelingEdit" 
                OnRowCommand="GridView1_RowCommand" OnRowEditing="GridView1_RowEditing" 
                OnRowUpdating="GridView1_RowUpdating" OnRowCreated="GridView1_RowCreated" 
                OnRowDeleting="GridView1_RowDeleting" onrowdatabound="GridView1_RowDataBound">
            <Columns>
            <asp:BoundField DataField="PeriodTimeID" ReadOnly="True" HeaderText = "编号" />
			<asp:TemplateField HeaderText = "时间段">
							<ItemTemplate>
                                            <asp:Label ID="labPeriodTimeName" runat="server" Text='<%# Eval("StartTime").ToString() +"-"+Eval("EndTime").ToString() %>'></asp:Label>
					        </ItemTemplate>
					        <EditItemTemplate>
                                            <asp:TextBox ID="tbxStartTime" runat="server" Text='<%# Eval("StartTime") %>' Width="40"></asp:TextBox>-<asp:TextBox ID="tbxEndTime" runat="server" Text='<%# Eval("EndTime") %>' Width="40"></asp:TextBox>
					        </EditItemTemplate>
			 </asp:TemplateField>
          
			
			<asp:TemplateField HeaderText = "组">
										<ItemTemplate>
											<%# Rs.Items.GetGroupType(Eval("GroupType"))%>
										</ItemTemplate>
										<EditItemTemplate>
											<asp:DropDownList Runat="server" ID="ddlGroupType"  SelectedValue = '<%#Eval("GroupType") %>'>
									        <asp:ListItem Value="1" Text = "春"></asp:ListItem>
									        <asp:ListItem Value="2" Text = "夏"></asp:ListItem>
									        <asp:ListItem Value="3" Text = "秋"></asp:ListItem>
									        <asp:ListItem Value="4" Text = "冬"></asp:ListItem>
									        <asp:ListItem Value="7" Text = "其它"></asp:ListItem>
											</asp:DropDownList>
										</EditItemTemplate>
			 </asp:TemplateField>
			 
			 <asp:TemplateField HeaderText = "排序">
							<ItemTemplate>
						        <asp:LinkButton id="btnUp" runat="server" CommandName="Up" meta:resourcekey="btnUp" Text = "↑"></asp:LinkButton>
						        <asp:LinkButton id="btnDo" runat="server" CommandName="Do" meta:resourcekey="btnDo" Text = "↓"></asp:LinkButton>
					        </ItemTemplate> 
			 </asp:TemplateField>
			
			<asp:CommandField HeaderText = "编辑" EditText = "编辑" CancelText = "取消" UpdateText = "更新" ShowEditButton="true" /> 
			  			
			 <asp:TemplateField HeaderText = "删除">
							<ItemTemplate>
						        <asp:LinkButton id="lbnDelete" runat="server" Text = "删除"  CommandName="Delete" OnClientClick="<%# Rs.Messages.确定删除%>" ></asp:LinkButton>
					        </ItemTemplate> 
			 </asp:TemplateField>
			 
            </Columns>
            </asp:GridView>
        </div>
        	
        <div id="sw_pagercontrol">
            <asp:Literal ID="litPagerButton" runat="server"></asp:Literal>
        </div>
 
</div>

		</form>
	</body>
</html>
