username@email.com
2021-09-02 9da546cd8de37882147f19f6f090544476bfe5ae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL;
using CY.Model;
using CY.Infrastructure.Query;
using CY.Infrastructure.Common;
using CY.BLL.OA;
using CY.BLL.EC;
 
 
namespace CY.WebForm.Pages.business
{
    //吴辉
    //商业信函
    public partial class AgSealPrint : BasePage
    {
        OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = null;
        OA_IntentionCustomerBLL bll_OA_IntentionCustomerBLL = null;
        EC_ExSingleTemBLL bll_EC_ExSingleTemBLL = null;
        public int PrintWidth = 0;
        public int PrintHeight = 0;
        public string PrintType = "";
 
        EC_OrderBasicBLL bll_EC_OrderBLL = null;
 
        //初始化
        public AgSealPrint()
        {
            bll_OA_CorporateClientsBLL = new OA_CorporateClientsBLL();
            bll_OA_IntentionCustomerBLL = new OA_IntentionCustomerBLL();
            bll_EC_ExSingleTemBLL = new EC_ExSingleTemBLL();
            bll_EC_OrderBLL = new EC_OrderBasicBLL();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string orderIdStr = Request["orderid"];
                DataBindCorporate(orderIdStr);
                
            }
        }
 
        /// <summary>
        /// 绑定打印数据
        /// </summary>
        /// <param name="Keyid"></param>
        public void DataBindCorporate(string Keyid)
        {
            //PrintWidth = 2970;
            //PrintHeight = 2100;
            PrintWidth = 2100;
            PrintHeight = 2970;
            PrintType = "A4";
            EC_OrderBasic _eC_OrderBasic = bll_EC_OrderBLL.SelectModelById(Convert.ToInt32(Keyid));
            int iBagNum = 0;
            iBagNum = Convert.ToInt32(_eC_OrderBasic.OrderExtend.BagNum);
            string sdate = _eC_OrderBasic.DeliveryTime.Value.ToString("yyyy-MM-dd");
            OA_CorporateClients oA_CorporateClients = null;
            OA_CustomerCommunications oA_CustomerCommunications = null;
            oA_CorporateClients = bll_OA_CorporateClientsBLL.SelectModelByFirmIdandMemberId(CurrentUser.MemberId, _eC_OrderBasic.BuyerId);
            oA_CustomerCommunications = bll_OA_CorporateClientsBLL.GetModel_CustomerCommunications(oA_CorporateClients.Keyid);
            string Printhtml = "";
            for (int i = 0; i < iBagNum; i++)
            {
                
                    if (i % 2 == 0)
                    {
                        Printhtml = Printhtml + "<div style='float:left;width: 850px;border:0px solid #ccc; float: left; display:block;  height: 156;'>";
                    }
                    Printhtml = Printhtml + "<div style='float:left;width: 400px; float: " + (i % 2 == 0 ? "left" : "right") + "; display:block; height: 380px;'> "
                                            +"<table>"
                                                +"<tr>"
                                                    + "<td align='center' style='padding-left:50px; width:400px;'>"
                                                            + "<font style='font-size:20px;font-weight:bold'>" + _eC_OrderBasic.SellerName+ "封签</font>"
                                                     +"</td>"
                                                +"</tr>"
                                                + "</table>"
                                            + "<table>"
                                                + "<tr>"
                                                    +"<td width='100px'>"
                                                        +"订单编号:"
                                                    +"</td>"
                                                    + "<td align='left'>"
                                                        + ""+_eC_OrderBasic.SellerOrderId+""
                                                    +"</td>"
                                                +"</tr>"
                                            +"</table>"
                                            + "<table border='1' cellpadding='0' cellspacing='0'  bordercolorlight='#000000' bordercolordark='#FFFFFF' width='100%'> "
                                            + "<tr style=' height:45px; width:350px'>"
                                                + "<td align='center'>"
                                                    + "印件名称"
                                                + "</td>"
                                                + "<td align='center' colspan='5'>"
                                                    + "" + _eC_OrderBasic.DocumentName + "</td>"
                                            + "</tr>"
                                            + "<tr style=' height:45px; width:350px'>"
                                                + "<td align='center'>"
                                                    + "委印单位"
                                                + "</td>"
                                                + "<td align='center' height='23px' colspan='3'>" + _eC_OrderBasic .SellerName+ ""
                                                + "</td>"
                                                + "<td align='center'>"
                                                    + "印刷数量"
                                                + "</td>"
                                                + "<td align='center' height='23px'>" + _eC_OrderBasic.OrderExtend.PrintNum+ ""
                                                + "</td>"
                                            + "</tr>"
                                            + "<tr style=' height:45px; width:350px;display:" + (_eC_OrderBasic.PrintTypeId == 6 ? "block" : "none") + ";'>"
                                                + "<td align='center'>"
                                                    + "书号"
                                                + "</td> "
                                                + "<td align='center' height='23px' colspan='3'>" + _eC_OrderBasic .OrderExtend.BookNum+ ""
                                                + "</td>"
                                                + "<td align='center'>"
                                                    + "定价"
                                                + "</td>"
                                                + "<td align='center' height='23px'>" + _eC_OrderBasic .OrderExtend.BookPrice+ ""
                                                + "</td>"
                                            + "</tr>"
                                            + "<tr style=' height:45px; width:350px'>"
                                                 + "<td align='center'>"
                                                    + "每包数量"
                                                + "</td>"
                                                + "<td align='center' height='23px' width='60px'>"+_eC_OrderBasic.OrderExtend.NumPerBag+""
                                                + "</td>"
                                                + "<td align='center'>"
                                                    + "总包数"
                                                + "</td>"
                                                + "<td align='center' width='60px'>" + _eC_OrderBasic.OrderExtend.BagNum + ""
                                                + "</td>"
                                                + "<td align='center' >"
                                                    + "本包号"
                                                + "</td>"
                                                + "<td align='center' height='23px'>"+ (i+1) +""
                                                + "</td>"
                                            + "</tr>"
                                            + "<tr style=' height:45px; width:350px'>"
                                                 + "<td align='center' >"
                                                    + "包装"
                                                + "</td>"
                                                + "<td align='center' height='23px'>"
                                                + "</td>"
                                                + "<td align='center' >"
                                                   + "质检"
                                                + "</td>"
                                                + "<td align='center' height='23px'>"
                                                + "</td>"
                                                + "<td align='center' >"
                                                    + "出厂日期"
                                                + "</td>"
                                                + "<td align='center' height='23px'>" + sdate + ""
                                                + "</td>"
                                            + "</tr>"
    
                                            + "</table>"
                                            + "<table>"
                                               + "<tr>"
                                                + "<td>地址:</td>"
                                                + "<td>"
                                                   + "" + oA_CustomerCommunications.DetailedAddress + ""
                                                + "</td>"
       
                                                + "<td>"
                                                 + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;电话:"
                                                + "</td>"
                                                + "<td>"
                                                 + "" + oA_CustomerCommunications.CompanyPhone + ""
                                                + "</td>"
                                               + "</tr>"
                                               //+ "<tr style='height:80px'>"
                                               //+ "</tr>"
       
                                            + "</table>"
                                            + "</div>";
                    if (i % 2 != 0)
                    {
                        Printhtml = Printhtml + "</div>";
                    }
               
            }
            this.divPrintHtml.InnerHtml = Printhtml;
        }
 
       
    }
}