<%@ Page Language="c#" CodeBehind="Course.aspx.cs" AutoEventWireup="True" Inherits="MTCUN.Mobile.Admin.Course"
    Title="课程设置-系统" %>

<%@ Import Namespace="MTCUN" %>
<%@ Register Src="../User_Col/col_Header.ascx" TagName="col_Header" TagPrefix="uc3" %>
<%@ Register Src="../../UserCol/Ann.ascx" TagName="Ann" 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 runat="server">
    <link id="mobileCss" runat="server" href="../themes/mobile.css" rel="stylesheet"
        type="text/css" />

    <script type="text/javascript">
        function OpenSearch() {
            if (setContent.style.display == 'none') {
                setContent.style.display = 'block';
                setControl.innerHTML = '▲增加课程';
                __mt__setSearchCookie(1);
            }
            else {
                setContent.style.display = 'none';
                setControl.innerHTML = '▼增加课程';
                __mt__setSearchCookie(0);
            }
        }

        function defaultSearchState() {
            var num = __mt__getSearchCookie();
            if (num == 1) {
                setContent.style.display = 'block';
                setControl.innerHTML = '▲增加课程';
            }
            else {
                setContent.style.display = 'none';
                setControl.innerHTML = '▼增加课程';
            }
        }
    </script>
</head>
<body onload="defaultSearchState()">
    <form id="Form1" method="post" runat="server">
        <uc3:col_Header ID="col_Header1" runat="server" />


        <div id="web_page_contents">
            <div class="search biao_zhun_suo_jin">
                <uc1:Ann ID="Ann1" runat="server" />

                <div class="setandsearch">
                    <ul class="searchtool">
                        <li>
                            <div id="setControl" onclick="OpenSearch()">
                                ▼增加课程
                            </div>
                        </li>
                    </ul>

                    <div id="setContent" style="display: none">
                        <h1>增加课程</h1>
                        <table class="table" cellspacing="0" width="100%" border="0">
                            <tr>
                                <td style="width: 85px">课程名称：
                                </td>
                                <td>
                                    <asp:TextBox ID="tbxCourseName" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>单位：</td>
                                <td>
                                    <asp:DropDownList ID="ddlUnit" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlUnit_SelectedIndexChanged">
                                        <asp:ListItem Value="0" Text=""></asp:ListItem>
                                        <asp:ListItem Value="2$0">课时</asp:ListItem>
                                        <asp:ListItem Value="1$0">学期</asp:ListItem>
                                        <asp:ListItem Value="1$3">月</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labUnitPrice" runat="server" Text="价格："></asp:Label>
                                </td>
                                <td><%=swq.CurrentCurrencySymbol %>
                                    <asp:TextBox ID="tbxUnitPrice" runat="server" Width="65px"></asp:TextBox>
                                </td>
                            </tr>


                            <tr>
                                <td>每课时：</td>
                                <td>
                                    <asp:TextBox ID="tbxLessonMinute" runat="server" Width="55px"></asp:TextBox>
                                    分钟</td>
                            </tr>
                            <tr>
                                <td>分类：</td>
                                <td>
                                    <asp:DropDownList ID="ddlCourseType" runat="server" DataSource="<%# swq.Cache.Fill(swq.Cache.GetCourseType(),Rs.Strings.请选择) %>"
                                        DataValueField="CourseTypeID" DataTextField="CourseTypeName">
                                    </asp:DropDownList></td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <div class="lab_button"><asp:Button ID="btnAdd" runat="server" Text="增加" OnClick="btnAdd_Click"></asp:Button>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>


                <asp:Repeater ID="repBlock" runat="server" OnItemCommand="repBlock_ItemCommand"
                    OnItemDataBound="repBlock_ItemDataBound">
                    <ItemTemplate>
                        <asp:Panel ID="plItem" runat="server" CssClass="kuai">

                            <h1 class="auto_length_title"><%#Eval("CourseName")%></h1>

                            <table class="table_simple_kuan">

                                <tr>
                                    <td style="width: 100px">单位：</td>
                                    <td style="width: auto"><%# CourseUnit.getUnitName(Eval("UnitName").ToString(),Eval("TermUnit").ToString())%></td>
                                </tr>
                                <tr>
                                    <td style="width: auto">价格：</td>
                                    <td style="width: auto"><%# Eval("UnitPrice","{0:c2}")%></td>
                                </tr>
                                <tr>
                                    <td style="width: auto">分钟/课时：</td>
                                    <td style="width: auto">
                                        <%# Eval("LessonMinute")%></td>
                                </tr>
                                <tr>
                                    <td style="width: auto">分类：</td>
                                    <td style="width: auto"><%# Eval("CourseTypeName")%></td>
                                </tr>
                                <tr>
                                    <td style="width: auto">状态：</td>
                                    <td style="width: auto"><%# Rs.Items.GetLockState((int)Eval("LockState"))%></td>
                                </tr>
                            </table>

                            <table style="width: 100%;" cellpadding="0" cellspacing="2">
                                <tr>
                                    <td>
                                        <div class="lab_button">
                                            <asp:LinkButton ID="lbnDelete" runat="server" Text="删除" CommandName="Delete" CommandArgument='<%#Eval("CourseID")%>'
                                                OnClientClick="<%# Rs.Messages.确定删除%>"></asp:LinkButton>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="lab_button">
                                            <asp:LinkButton runat="server" ID="lbnEdit" CommandArgument='<%# Eval("CourseID")%>'
                                                CommandName="Edit" Text="编辑"></asp:LinkButton>
                                        </div>
                                    </td>
                                </tr>
                            </table>


                        </asp:Panel>
                        <asp:Panel ID="plEdit" runat="server" CssClass="kuai edit_kuai">
                            <table class="table_simple_kuan">
                                <tr>
                                    <td style="width: auto">课程：</td>
                                    <td style="width: auto">
                                        <asp:TextBox ID="tbxCourseName" runat="server" Text='<%# Eval("CourseName")%>'></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td style="width: auto">单位：</td>
                                    <td style="width: auto">
                                        <asp:DropDownList ID="ddlUnit" runat="server" AutoPostBack="true" OnSelectedIndexChanged="gvddlUnit_SelectedIndexChanged" SelectedValue='<%# Eval("UnitID") +"$"+CourseUnit.getMinorUnitID(Eval("TermUnit").ToString()) %>'>
                                            <asp:ListItem Value="2$0">课时</asp:ListItem>
                                            <asp:ListItem Value="1$0">学期</asp:ListItem>
                                            <asp:ListItem Value="1$1">天</asp:ListItem>
                                            <asp:ListItem Value="1$2">周</asp:ListItem>
                                            <asp:ListItem Value="1$3">月</asp:ListItem>
                                            <asp:ListItem Value="1$4">季</asp:ListItem>
                                            <asp:ListItem Value="1$5">年</asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: auto">价格：</td>
                                    <td style="width: auto">
                                        <asp:TextBox ID="tbxUnitPrice" runat="server" Text='<%# Eval("UnitPrice","{0:f2}")%>'></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td style="width: auto">分钟/课时：</td>
                                    <td style="width: auto">
                                        <asp:TextBox ID="tbxLessonMinute" runat="server" Width="40px" Text='<%# Eval("LessonMinute")%>'></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td style="width: auto">分类：</td>
                                    <td style="width: auto">
                                        <asp:DropDownList ID="ddlCourseType" runat="server" DataSource="<%# swq.Cache.GetCourseType() %>"
                                            DataValueField="CourseTypeID" DataTextField="CourseTypeName">
                                        </asp:DropDownList></td>
                                </tr>
                                <tr>
                                    <td style="width: auto">状态：</td>
                                    <td style="width: auto">
                                        <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></td>
                                </tr>
                            </table>


                            <table style="width: 100%;" cellpadding="0" cellspacing="2">
                                <tr>
                                    <td>
                                        <div class="lab_button">
                                            <asp:LinkButton runat="server" ID="lbnUpdate" CommandArgument='<%# Eval("CourseID")%>'
                                                CommandName="Update" Text="更新"></asp:LinkButton>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="lab_button">
                                            <asp:LinkButton runat="server" ID="lbnCancel" CommandArgument='<%# Eval("CourseID")%>'
                                                CommandName="Cancel" Text="取消"></asp:LinkButton>
                                        </div>
                                    </td>
                                </tr>
                            </table>

                        </asp:Panel>
                    </ItemTemplate>
                </asp:Repeater>

                <div class="pager_button">
                    <asp:Literal ID="litPagerButton" runat="server"></asp:Literal>
                </div>

                <div class="divpanel">
                    <b>注意事项：</b><br />
                    1、<span class="style1">点击具体课程的金额可设定课程在各校区的不同价格，还可以根据购买数量设置不同价格。</span><br />
                    2、以“<b>课时</b>”为单位，一般用于课外辅导、乐器类培训、一对一教学模式等，是一种高精度、高度量化的管理模式。<br />
                    3、当设置以“<strong>课时</strong>”为单位时，课程价格应设置为1课时的价格，另外每个班级的1课时=?分钟是可以不同的，所以先确定您每课时分钟数是多少，再确定课时单价。<br />
                    4、以“<strong>学期</strong>”为单位的模式又分为：按课时量化，按时间量化。按课时量化时与课时制类似但略逊于课时制，可以做到较高的精度。按时间量化适合班级总课时不确定，学员购买课程课时数也不确定的情况，灵活易用，但量化精度不高，无法动态准确分析学员课时学费消耗情况等，通常我们称为按月收费、按年收费等等。<br />
                </div>
            </div>
        </div>
    </form>
</body>
</html>
