<%@ 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/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() {
            window.location = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ExhiTrafficCardEdit?Type=Add";
        }
        function Modify(id) {
            window.location = "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ExhiTrafficCardEdit?Type=Modify&ID=" + id;
        }
        function Delete(id) {
            if (confirm("确认删除？")) {
                $("#ID").val(id);
                $("#Type").val("Delete");
                $("#f1").submit();
            }
        }

////        var dynaform;
////        function ShowCardStyle() {
////            dynaform = new DynaForm({
////                id: "dynaform",
////                title: "展商胸卡样式",
////                src: "<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Exhibitor/ExhiVisitCardDemo",
////                width: "300px",
////                height: "200px"
////            });
////            dynaform.showModalDialog();
////        }
    </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 border='0' cellpadding="0" cellspacing="0" width="100%" align="left">
                            <tr>
                                <td class="tdMenu" onclick="GoTo('ExhiActorCard')">
                                    展商胸卡
                                </td>
                                <td class="tdMenuWidth">&nbsp;</td>
                                <td class="tdMenu" onclick="GoTo('ExhiVisitCard')">
                                    客户胸卡
                                </td>
                                <td class="tdMenuWidth">&nbsp;</td>
                                <td class="tdMenuSelect" onclick="GoTo('ExhiTrafficCard')">
                                    货车证
                                </td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="tdMenuLine" colspan="6"></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td><div class="button" onclick="Add()">新增车证</div></td>
                                <%--<td><div class="button" onclick="ShowCardStyle()">查看胸卡样式</div></td>--%>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                    <% 
                        System.Data.DataTable dt = ViewData["Data"] as System.Data.DataTable;
                    %>
                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td class="td01" width="20%" align="center">车证类别</td>
                                <td class="td01" width="20%" align="center">公司名称</td>
                                <td class="td01" width="30%" align="center">地址</td>
                                <td class="td01" width="20%" align="center">邮编</td>
                                <td class="td01" width="10%" align="center">操作</td>
                            </tr>
                        <% 
                            if (dt.Rows.Count > 0)
                            {
                                foreach (System.Data.DataRow dr in dt.Rows)
                                {
                        %>
                            <tr>
                                <td class="td03" align="center">
                                    <%=Server.HtmlEncode(dr["TktType"].ToString()) %>
                                </td>
                                <td class="td03" align="left"">
                                    <%=Server.HtmlEncode(dr["TktComName"].ToString()) %>
                                </td>
                                <td class="td03" align="center"">
                                    <%=Server.HtmlEncode(dr["TktAddress"].ToString())%>
                                </td>
                                <td class="td03" align="center"">
                                    <%=Server.HtmlEncode(dr["TktZipCode"].ToString())%>
                                </td>
                                <td class="td03" align="center">
                                    <a href="javascript:Modify(<%=dr["TktID"] %>);">修改</a>&nbsp;
                                    <a href="javascript:Delete(<%=dr["TktID"] %>);">删除</a>
                                </td>
                            </tr>
                        <%            
                                }
                            }
                            else
                            { 
                        %>
                            <tr>
                                <td colspan="5" class="td03" align="center" valign="middle" height="40" width="100%">暂无信息</td>
                            </tr>
                        <%    
                            }    
                        %>
                        </table>
                    </td>
                </tr>
                <tr><td>&nbsp;</td></tr>
                <tr>
                    <td>
                        <script type="text/javascript">
                            var message = "<%=ViewData["Message"] %>";
                            if (message != "") {
                                MsgTip.show({ msg: message, ico: "warning", top: 340 });
                            }
                        </script>
                        <input type="hidden" id="ID" name="ID" />
                        <input type="hidden" id="Type" name="Type" />
                    </td>
                </tr>
            </table>
            </form>
        </center>
    </div>
</asp:Content>
