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

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

       <div>
        <form id="f1" action="" method="post" enctype="multipart/form-data">
        <table width="100%" cellspacing="0" cellpadding="0" class="table">
            <thead>
                <tr>
                    <th colspan="2" style="font-family: Arial,微软雅黑,Helvetica,sans-serif">
                        <br />
                        <h3>
                            <span><b>导入邀请名单</b></span></h3>
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td width="50%">
                        <span>查找文件</span>
                        <input type="file" name="FileExhibitorBadges" id="FileExhibitorBadges" />
                    </td>
                    <td>
                        <input type="button" name="btnUpload" value="导入" id="btnUpload" style="  background-color:#4EB0AE;" class="btn btn-success"
                            onclick="UpLoadBadges();" />
                        <span id="lblMessage"></span>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <div class="step_UploadNotice">
                            <ul>
                                <li><span>1.只能上传Excel文件。</span></li>
                                <li><span>2.文件大小最大为4MB。</span></li>
                            </ul>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
       <script type="text/javascript">
            $(function () {
                var message = $("#Message").val();
                if (message != "") {
                    $("#lblMessage").html(message);
                }
            });
        </script>
        <input type="hidden" id="Message" name="Message" value="<%=ViewData["Message"] %>" />
        </form>
    </div>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
<link href="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Scripts/bootstrap.min.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript">
      $(function () {
         
          var message = $("#Message").val();
          if (message != "") {
           
              $("#lblMessage").html(message);
          }
   
          $("#CurrentPosition").html("导入邀请名单");
          MenuActive(7);


      });

      function checkFileType(fileName) {
          var fileType = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length).toLocaleLowerCase();
          if (fileType != 'xls') {
              alert("请查找后缀为xls的excel文件！");
              return false;
          }
          return true;
      }

      function UpLoadBadges() {
          var fileName = $("#FileExhibitorBadges").val();
          //alert(fileName);
          if (checkFileType(fileName)) {
              $("#f1").submit();
          }
      }
    </script>
    <style type="text/css">
        span
        {
            font-family: Arial,微软雅黑,Helvetica,sans-serif;
        }
    </style>
</asp:Content>
