<%@ Page Title="" Language="C#" MasterPageFile="~/SignBox/Site1.Master" AutoEventWireup="true" CodeBehind="PrintTranBox.aspx.cs" Inherits="GxHub.Wms.Abroad.Web.SignBox.PrintTranBox" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
     <title><%=GetText("箱子打印") %> </title>
  
 
 <script language="javascript" src="../lodop/LodopFuncs.js"></script>
 <object id="LODOP" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0"
     height="0">
     <embed id="LODOP_EM" type="application/x-print-lodop" width="0" height="0" pluginspage="../lodop/install_lodop.exe"></embed>
 </object>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 <yee:MessageBox ID="msg" runat="server">
 </yee:MessageBox>
 <yee:PageTitle ID="title" runat="server">
 </yee:PageTitle>
 
 <table id="tb" cellpadding="0" cellspacing="0" border="0" class="table">
     <tr>
         <td class="tbpostheader" style="width: 30%">
             <%=GetText("箱子号") %>：
         </td>
         <td class="tbpost">
             <asp:TextBox ID="txtBoxSerialNo" runat="server"></asp:TextBox>
         </td>
     </tr>
     <tr class="tbpostheader">
         <td class="tbpostheader">
             <%=GetText("当前所在仓库") %>：
         </td>
         <td class="tbpost">

             <yee:UserWarehousesDropDownList ID="ddlWarehouse" runat="server" WarehouseType="海外仓储" >
             </yee:UserWarehousesDropDownList>
         </td>
     </tr>
      
     <tr>
         <td class="tbfooter"></td>
         <td class="tbfooter">
             <yee:Button ID="btnCheck" CssClass="button" runat="server" OnClick="btnCheck_Click" />
         </td>
     </tr>
 </table>
 
 
 <script language="javascript" type="text/javascript">

     var LODOP; //声明为全局变量
     function prn1_print(code, box) {
             if (needCLodop()) {
                 window.On_CLodop_Opened = function () {

                     CreateOneFormPage(code, box);
                     window.On_CLodop_Opened = null;

                 }
             }
             else {
                    CreateOneFormPage(code, box);
                  }
        
      
         //window.location.reload();
     };

     function CreateOneFormPage(code, box) {

         LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM'));
         var fontSize = 58;
 
         if (code.length == 6) { 
             fontSize = 45;
         }
         else if(code.length==7)
         { 
             fontSize=40;
          }
        else if(code.length>7)
        { 
             fontSize=36;
        }
         LODOP.PRINT_INITA(0, 0, 265, 189, "");
         LODOP.SET_PRINT_PAGESIZE(0, 700, 500, "A4");

         LODOP.ADD_PRINT_TEXT(72, -1, 270, 111, code);
         LODOP.SET_PRINT_STYLEA(0, "FontName", "tahoma");
         LODOP.SET_PRINT_STYLEA(0, "FontSize", fontSize);
         LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
         LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
         LODOP.ADD_PRINT_TEXT(18, 7, 250, 51, box);
         LODOP.SET_PRINT_STYLEA(0, "FontName", "Tahoma");
         LODOP.SET_PRINT_STYLEA(0, "FontSize", 18);
         LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
         LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
         LODOP.SET_PRINTER_INDEXA("outPrinterGK888t");
     LODOP.PRINT();
     //LODOP.PRINT_DESIGN();
     //LODOP.PREVIEW();
     };
 </script>
</asp:Content>
