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



<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Scripts/CheckInfo.js" type="text/javascript"></script>
    <script src="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Scripts/DynaForm.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#CurrentPosition").html("展商胸卡");
            $("#mainmenu3").css("visibility", "visible");
        });
        function GoTo(str) {
            window.location = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/" + str;
        }
        function Add() {
            $("#EditTable").css("display", "");
            location.hash = "EditTarget";

            $("#Name").val("");
            $("#Rank").val("");
            $("#ComName").val('<%=Session["AtrName"] %>');
            $("#ID").val("");
            $("#Type").val("Add");
            iframeAutoFit();
        }
        function Modify(id) {            
            $("#EditTable").css("display", "");
            location.hash = "EditTarget";
            $("#Name").val($.trim($("#Name" + id).text()));
            $("#Rank").val($.trim($("#Rank" + id).text()));
            $("#ComName").val($.trim($("#ComName" + id).text()));
            $("#ID").val(id);
            $("#Type").val("Modify");
            iframeAutoFit();
        }
        function Delete(id) {
            if (confirm("确认删除？")) {
                $("#ID").val(id);
                $("#Type").val("Delete");
                $("#f1").submit();
            }
        }
        function Save() {
            if (checkName() && checkRank() && checkComName()) {
                MsgTip.show({ ico: 'loading', during: 0, msg: '正在处理请求，请稍等...' });

                $("#f1").submit();
            }
        }
        function Hide() {
            $("#EditTable").css("display", "none");
            $("#Name").val("");
            $("#Rank").val("");
            $("#ComName").val("");
            $("#ID").val("");
            $("#Type").val("");
            window.scrollTo(0);
        }
        function checkName() {
            var name = $("#Name").val();
            if (name == "") {
                showCheckTag("checkName", false, "请输入姓名！");
                return false;
            }
            showCheckTag("checkName", true, "");
            return true;
        }
        function checkRank() {
            var rank = $("#Rank").val();
            if (rank == "") {
                showCheckTag("checkRank", false, "请输入职务！");
                return false;
            }
            showCheckTag("checkRank", true, "");
            return true;
        }
        function checkComName() {
            var comName = $("#ComName").val();
            if (comName == "") {
                showCheckTag("checkComName", false, "请输入公司名称！");
                return false;
            }
            showCheckTag("checkComName", true, "");
            return true;
        }
        function showCheckTag(id, ispass, message) {
            if (ispass == true) {
                $("#" + id).html('<font color="green">√</font>');
            } else {
                if (message == null) {
                    message = "";
                }
                $("#" + id).html('<font color="red">*</font>');
                showMsg(message);
            }
        }
    </script>
    <style type="text/css">
        .EditBox
        {
            border:1px solid #4EB0AE;    
        }
    </style>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div>
    <input type=hidden id="time" value="<%=DateTime.Now.ToString() %>" />
        <center>
            <form id="f1" action="" method="post">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td align="right">
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td align="left" style="width:80px;">截止日期：</td>
                                <td align="left" style="width:80px;"><%=ViewData["EndDate"] %></td>
                                <td align="left" style="width:80px;">提交日期：</td>
                                <td align="left" style="width:80px;"><%=ViewData["SubDate"] %></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr><td>&nbsp;</td></tr>
                <tr>
                    <td align="left">
                        <p>请在下表中提供贵司所有展台工作人员的信息，并在指定的截止日期前递交主办单位, 入场胸卡将在现场展商服务台领取。如果您的申请超过了截止日期，那么可能会延误您进场的时间。</p>
                       <%-- <p><strong>各参展商每个标准展位可获得 3个免费的入场证，每增加12平方米可获得2个额外的免费入场证。参展商若需要额外的入场证或补领遗失的入场证，则须要为每个入场证支付 人民币500元 /个的押金，押金于展会结束时凭胸卡和押金条退还。</strong></p>--%>
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td class="td03" style="width:60px; text-align:center;">面积(m<sup>2</sup>)</td>
                                <td class="td03" style="width:20px; text-align:center;">12</td>
                                <td class="td03" style="width:20px; text-align:center;">15</td>
                                <td class="td03" style="width:20px; text-align:center;">18</td>
                                <td class="td03" style="width:20px; text-align:center;">21</td>
                                <td class="td03" style="width:20px; text-align:center;">24</td>
                                <td class="td03" style="width:20px; text-align:center;">27</td>
                                <td class="td03" style="width:20px; text-align:center;">30</td>
                                <td class="td03" style="width:20px; text-align:center;">36</td>
                                <td class="td03" style="width:20px; text-align:center;">42</td>
                                <td class="td03" style="width:20px; text-align:center;">45</td>
                                <td class="td03" style="width:20px; text-align:center;">48</td>
                                <td class="td03" style="width:20px; text-align:center;">54</td>
                                <td class="td03" style="width:20px; text-align:center;">60</td>
                                <td class="td03" style="width:20px; text-align:center;">72</td>
                                <td class="td03" style="width:20px; text-align:center;">75</td>
                                <td class="td03" style="width:20px; text-align:center;">90</td>
                                <td class="td03" style="width:20px; text-align:center;">138</td>
                                <td class="td03" style="width:50px; text-align:center;">150以上</td>
                            </tr>
                            <tr>
                                <td class="td03" style="width:60px; text-align:center;">入场证(张)</td>
                                <td class="td03" style="width:20px; text-align:center;">3</td>
                                <td class="td03" style="width:20px; text-align:center;">4</td>
                                <td class="td03" style="width:20px; text-align:center;">4</td>
                                <td class="td03" style="width:20px; text-align:center;">5</td>
                                <td class="td03" style="width:20px; text-align:center;">5</td>
                                <td class="td03" style="width:20px; text-align:center;">6</td>
                                <td class="td03" style="width:20px; text-align:center;">6</td>
                                <td class="td03" style="width:20px; text-align:center;">7</td>
                                <td class="td03" style="width:20px; text-align:center;">7</td>
                                <td class="td03" style="width:20px; text-align:center;">8</td>
                                <td class="td03" style="width:20px; text-align:center;">9</td>
                                <td class="td03" style="width:20px; text-align:center;">9</td>
                                <td class="td03" style="width:20px; text-align:center;">10</td>
                                <td class="td03" style="width:20px; text-align:center;">13</td>
                                <td class="td03" style="width:20px; text-align:center;">13</td>
                                <td class="td03" style="width:20px; text-align:center;">16</td>
                                <td class="td03" style="width:20px; text-align:center;">24</td>
                                <td class="td03" style="width:50px; text-align:center;">30</td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr><td>&nbsp;</td></tr>
                <tr>
                    <td align="left">
                    <% 
                        List<FamousFurnitureExpo.Models.Ticket> li = ViewData["Data"] as List<FamousFurnitureExpo.Models.Ticket>;
                        int actorCardNum = li.Count;
                        int actorCardNumTotal = Convert.ToInt32(ViewData["ActorCardNum"]);
                    %>
                        您公司参展面积为<font color="red"><%=ViewData["Area"] %></font>平方米。<br />
                        您公司最多可以领取展商胸卡数为：<font color="red"><%=actorCardNumTotal %></font>张。<br />
                        已经申请了<font color="red"><%=actorCardNum %></font>张。
                    </td>
                </tr>
                <tr>
                    <td>
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td style="padding-top:10px">
                                <% 
                                    if (actorCardNum < actorCardNumTotal)
                                    {    
                                %>
                                    <div class="button" onclick="Add()">新增展商胸卡</div>
                                <%
                                    }
                                    else
                                    { 
                                %>
                                   <%-- <div class="button" onclick="javascript:alert('您申请的展商胸卡数量已达上限。');">新增展商胸卡</div>--%>
                                    <div class="button" onclick="Add()">新增展商胸卡</div>
                                <%    
                                    }
                                %>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr><td>&nbsp;</td></tr>
                <tr>
                    <td align="left">
                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td class="td01" width="15%" align="center">姓名</td>
                                <td class="td01" width="15%" align="center">职务</td>
                                <td class="td01" width="50%" align="center">公司名称</td>
                                <%--<td class="td01" width="10%" align="center">押金</td>--%>
                                <td class="td01" width="10%" align="center">操作</td>
                            </tr>
                        <% 
                            if (li.Count > 0)
                            {
                                int i = 1;
                                foreach (FamousFurnitureExpo.Models.Ticket ec in li)
                                {

                                    //string free = "";
                                    //if (i > actorCardNumTotal)
                                    //{
                                    //    free = "<font color='red'>500 元</font>";
                                    //}
                                    //else
                                    //{
                                    //    free = "免费";
                                    //}
                                    
                        %>
                            <tr>
                                <td class="td03" align="center" id="Name<%=ec.TktID %>">
                                    <%=ec.TktName%>
                                </td>
                                <td class="td03" align="center" id="Rank<%=ec.TktID %>">
                                    <%=ec.TktRank%>
                                </td>
                                <td class="td03" align="left" id="ComName<%=ec.TktID %>">
                                    <%=ec.TktComName%>
                                </td>
                               
                              <%--  <td class="td03" align="center">
                                    <%=free %>
                                </td>--%>
                                <td class="td03" align="center">
                                    <a href="javascript:Modify(<%=ec.TktID %>);">修改</a>&nbsp;
                                    <a href="javascript:Delete(<%=ec.TktID %>);">删除</a>
                                </td>
                            </tr>
                        <%         
                            i++;   
                                }
                            }
                            else
                            { 
                        %>
                            <tr>
                                <td colspan="5" class="td03" align="center" valign="middle" height="40" width="100%">暂无信息</td>
                            </tr>
                        <%    
                            }
                        %>
                        </table>
                    </td>
                </tr>
                <tr><td><a name="EditTarget"></a></td></tr>
                <tr><td>&nbsp;</td></tr>
                <tr>
                    <td>
                        <div>
                            <table border="0" cellpadding="0" cellspacing="7" id="EditTable" class="EditBox" style="display:none;">
                                <tr>
                                    <td width="100">姓名：</td>
                                    <td><input type="text" class="text" id="Name" name="Name" />
                                        <span id="checkName"><font color="red">*</font></span></td>
                                </tr>
                                <tr>
                                    <td>职务：</td>
                                    <td><input type="text" class="text" id="Rank" name="Rank" />
                                        <span id="checkRank"><font color="red">*</font></span></td>
                                </tr>
                                <tr>
                                    <td>公司名称：</td>
                                    <td><input type="text" class="text" id="ComName" name="ComName" />
                                        <span id="checkComName"><font color="red">*</font></span></td>
                                </tr>
                                <tr><td>&nbsp;</td></tr>
                                <tr>
                                    <td>
                                        <div class="button" onclick="Save()">保存</div>
                                    </td>
                                    <td>
                                        <div class="button" onclick="Hide()">取消</div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input type="hidden" id="ID" name="ID" />
                                        <input type="hidden" id="Type" name="Type" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </td>
                </tr>
                <tr><td>&nbsp;</td></tr>
            </table>
            <script type="text/javascript">
                $(function () {
                    var message = $("#Message").val();
                    if (message != "") {
                        showMsg(message);
                    }
                });
            </script>
            <input type="hidden" id="Message" name="Message" value="<%=ViewData["Message"] %>" />
            </form>
        </center>
    </div>
</asp:Content>
