<%@ Page Language="c#" CodeBehind="Media.aspx.cs" AutoEventWireup="True" Inherits="MTCUN.Mobile.Consultant.Media"
    Title="媒体设置-顾问管理" %>

<%@ Import Namespace="MTCUN" %>
<%@ Register Src="../User_Col/col_Header.ascx" TagName="col_Header" TagPrefix="uc3" %>
<!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">

                <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_simple_kuan" cellpadding="2">
                            <tr>
                                <td style="width: 85px">媒体名称：
                                </td>
                                <td>
                                    <asp:TextBox ID="tbxMediaName" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <label class="lab_button">
                                        <asp:Button ID="btnAdd" runat="server" Text="增加" OnClick="btnAdd_Click"></asp:Button>
                                    </label>

                                </td>
                            </tr>
                        </table>
                    </div>
                </div>

                <div class="main">
                    <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("MediaName")%></h1>

                                <table class="table_simple_kuan">
                                    <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" runat="server" id="divDelete">
                                                <asp:LinkButton ID="lbnDelete" runat="server" Text="删除" CommandName="Delete" CommandArgument='<%#Eval("MediaID")%>'
                                                    OnClientClick="<%# Rs.Messages.确定删除%>"></asp:LinkButton>
                                            </div>
                                        </td>
                                        <td>
                                            <div class="lab_button">
                                                <asp:LinkButton runat="server" ID="lbnEdit" CommandArgument='<%# Eval("MediaID")%>'
                                                    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="tbxMediaName" runat="server" Text='<%# Eval("MediaName")%>'></asp:TextBox></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("MediaID")%>'
                                                    CommandName="Update" Text="更新"></asp:LinkButton>
                                            </div>
                                        </td>
                                        <td>
                                            <div class="lab_button">
                                                <asp:LinkButton runat="server" ID="lbnCancel" CommandArgument='<%# Eval("MediaID")%>'
                                                    CommandName="Cancel" Text="取消"></asp:LinkButton>
                                            </div>
                                        </td>
                                    </tr>
                                </table>

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

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

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