<%@ Page Language="c#" CodeBehind="Course.aspx.cs" AutoEventWireup="True" Inherits="SWTraining.Admin.Course"
    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/Orange/css.css" rel="stylesheet"
        type="text/css" />
</head>
<body>
    <form id="Form1" method="post" runat="server">
    <div id="sw_content">
        <div class="divpanel">
            <asp:Literal Text="课程名称：" runat="server" />
            <asp:TextBox ID="tbxCourseName" runat="server"></asp:TextBox>
            价格：<asp:TextBox ID="tbxUnitPrice" runat="server" Width="65px"></asp:TextBox>
            单位：
            <asp:DropDownList ID="ddlUnit" runat="server" DataSource='<%# swq.Cache.Fill(swq.Cache.GetSysUnit(),"UnitType=1",Rs.Strings.请选择) %>'
                DataValueField="UnitID" DataTextField="UnitName">
            </asp:DropDownList>
            分类：
            <asp:DropDownList ID="ddlCourseType" runat="server" DataSource="<%# swq.Cache.Fill(swq.Cache.GetCourseType(),Rs.Strings.请选择) %>"
                DataValueField="CourseTypeID" DataTextField="CourseTypeName">
            </asp:DropDownList>
            <asp:Button ID="btnAdd" runat="server" Text="增加" OnClick="btnAdd_Click"></asp:Button></div>
        <div class="divpanel">
            <asp:GridView ID="GridView1" runat="server" CssClass="gridview" AutoGenerateColumns="False"
                DataKeyNames="CourseID" 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="CourseID" ReadOnly="True" HeaderText="编号" />
                    <asp:BoundField DataField="CourseName" HeaderText="课程名称" />
                    <asp:BoundField DataField="UnitPrice" HeaderText="价格" DataFormatString="{0:c2}" />
                    <asp:TemplateField HeaderText="单位">
                        <ItemTemplate>
                            <%# Eval("UnitName")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList ID="ddlUnit" runat="server" DataSource='<%# swq.Cache.Fill(swq.Cache.GetSysUnit(),"UnitType=1",null) %>'
                                SelectedValue='<%# Eval("UnitID") %>' DataValueField="UnitID" DataTextField="UnitName">
                            </asp:DropDownList>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="分类">
                        <ItemTemplate>
                            <%# Eval("CourseTypeName")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList ID="ddlCourseType" runat="server" DataSource="<%# swq.Cache.GetCourseType() %>"
                                SelectedValue='<%# Eval("CourseTypeID") %>' DataValueField="CourseTypeID" DataTextField="CourseTypeName">
                            </asp:DropDownList>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="状态">
                        <ItemTemplate>
                            <%# Rs.Items.GetLockState((int)Eval("LockState"))%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList runat="server" ID="ddlLockState" SelectedIndex='<%# Eval("LockState") %>'>
                                <asp:ListItem Value="0" Selected="True" Text="禁用"></asp:ListItem>
                                <asp:ListItem Value="1" Text="启用"></asp:ListItem>
                            </asp:DropDownList>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="排序">
                        <ItemTemplate>
                            <asp:LinkButton ID="btnUp" runat="server" CommandName="Up" Text="↑"></asp:LinkButton>
                            <asp:LinkButton ID="btnDo" runat="server" CommandName="Do" 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 class="divpanel">
            <asp:Literal ID="litPagerButton" runat="server"></asp:Literal>
        </div>
        <div class="divpanel" style="padding-bottom:40px">
            <b>注意事项：</b><br />
            1、以“<b>课时</b>”为单位，一般用于课外辅导、乐器类培训、及一对一教学模式。<br />
            2、职业培训学校、少年宫等各种大班培训建议使用“<b>学期</b>”为单位。<br />
        </div>
    </div>
    </form>
</body>
</html>
