<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/ExhibitorMaster.Master" Inherits="System.Web.Mvc.ViewPage<List<FamousFurnitureExpo.Models.Activity>>" %>


<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        $(function () {
            $("#CurrentPosition").html("我的活动");
            $("#menu41").css("visibility", "visible");
        });
        function GoTo(str) {
            window.location = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/" + str;
        }
        function Add() {
            window.location = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ActivityEdit?Type=Add";
        }
        function Apply(id) {
            if (confirm("确认重新申请？")) {
                window.location = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ApplyActivity/" + id;
            }
        }
        function Modify(id) {
            window.location = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ActivityEdit?Type=Modify&ID=" + id;
        }
        function Delete(id) {
            if (confirm("确认删除？")) {
                window.location = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/DelActivity/" + id;
            }
        }
        function ShowApply(id) {
            window.location = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ActivityApplyExam?atyID=" + id + "&status=0&page=1";
        }
    </script>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <center>
            <form id="f1" action="" method="post">
            <table width="100%" border="0" style="text-align: left" cellpadding="0" cellspacing="0" id="main">
                <tr>
                    <td align="left">
                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td class="td01" width="20%" align="center">活动名称</td>
                                <td class="td01" width="25%" align="center">时间</td>
                                <td class="td01" width="10%" align="center">地点</td>
                                <td class="td01" width="10%" align="center">状态</td>
                                <td class="td01" width="15%" align="center">已报名/名额</td>
                                <td class="td01" width="20%" align="center">操作</td>
                            </tr>
                        <%
                            if (Model.Count > 0)
                            {
                                foreach (FamousFurnitureExpo.Models.Activity aty in Model)
                                {
                        %>
                            <tr title="<%=Server.HtmlEncode(aty.AtyContent)%>">
                                <td class="td03" align="left" style="padding-left:5px; padding-right:5px;">
                        <% 
                                    if (aty.AtyUrl.Trim() != "")
                                    {
                        %>
                                    <a href="<%=Server.HtmlEncode(aty.AtyUrl) %>" target="_blank"><%=Server.HtmlEncode(aty.AtyTheme)%></a>
                        <%
                                    }
                                    else
                                    {
                        %>            
                                    <%=Server.HtmlEncode(aty.AtyTheme)%>
                        <% 
                                    }    
                        %>
                                </td>
                                <td class="td03" align="left" style="padding-left:5px; padding-right:5px;">
                                    <%=aty.AtyDate.ToShortDateString() %>&nbsp;
                                    <%=Server.HtmlEncode(aty.AtyBTime) %>-<%=Server.HtmlEncode(aty.AtyETime) %>
                                </td>
                                <td class="td03" align="left" style="padding-left:5px; padding-right:5px;">
                                    <%=aty.AtyPlace %>
                                </td>
                                <td class="td03" align="center">
                                    <%=aty.AtyStatus %>
                                </td>
                                <td class="td03" align="center">
                                    <% if (aty.AtyStatus == "已审核")
                                       { %>
                                    <a href="javascript:ShowApply('<%=aty.AtyID %>')"><%=aty.AtyApplyCount%></a>
                                    <% }
                                       else
                                       { %>
                                    <%=aty.AtyApplyCount %>
                                    <%} %>
                                    /
                                    <%=(aty.AtyQuoTa == 0 ? "不限" : aty.AtyQuoTa.ToString())%>
                                </td>
                                <td class="td03" align="center">
                                    <a href="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ActivityShow/<%=aty.AtyID %>">查看</a>
                                    <%
                                    if (aty.AtyStatus == "已拒绝")
                                    { 
                                    %>
                                    <a href="javascript:Apply(<%=aty.AtyID %>);">重新申请</a><br />
                                    <%
                                    }
                                    if (aty.AtyStatus != "已审核")
                                    { 
                                    %>
                                    <a href="javascript:Modify(<%=aty.AtyID %>);">修改</a>&nbsp;
                                    <a href="javascript:Delete(<%=aty.AtyID %>);">删除</a>
                                    <% 
                                    } 
                                    %>
                                </td>
                            </tr>
                        <%
                                }
                            }
                            else
                            {
                        %>
                            <tr>
                                <td colspan="8" class="td03" align="center" valign="middle" height="40" width="100%">暂无信息</td>
                            </tr>
                        <%    
                            }
                        %>
                        </table>
                    </td>
                </tr>
                <tr><td>&nbsp;</td></tr>
                <tr>
                    <td>
                        <div class="button" onclick="Add()">新增活动会议</div>
                    </td>
                </tr>
            </table>
            </form>
        </center>
    </div>
</asp:Content>
