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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.Infrastructure.Common;
using CY.BLL.Inquiry;
using CY.Model.Inquiry;
using CY.BLL.Sys;
using CY.Model;
using CY.BLL.EC;
using CY.WebForm.Pages.front;
using CY.BLL;
 
namespace CY.WebForm.Pages.Templet.Default
{
    public partial class CompanyInquiryOnLine : TempletBasePage
    {
 
        #region 变量
        PaperInfoBLL _paperInfoBLL = new PaperInfoBLL();
        RangeofBusinessBLL _rangeofBusinessBLL = new RangeofBusinessBLL();
        SysInquiry_PrintingTypeBLL _sysInquiry_PrintingTypeBLL = new SysInquiry_PrintingTypeBLL();
        public Guid BussinessID = Guid.Empty;
        #endregion
 
        #region 属性
        public string PrintName { get; set; }
       
        public int PrintTypeId { get; set; }
 
        #endregion
 
        #region 方法
        public void SetPrintName()
        {
            if (Request["PrintTypeId"] != null)
            {
                int printTypeId = Request["PrintTypeId"].ToString().ToInt32().Value;
                Session["PrintTypeId"]= Request["PrintTypeId"].ToString().ToInt32().Value;
                PrintTypeId = printTypeId;
                SysInquiry_PrintingType model = _sysInquiry_PrintingTypeBLL.GetModelById(printTypeId);
                PrintName = model.PrintName;
                this.PrintTypeList.PrintTypeId = printTypeId.ToString();
            }
        }
 
        /// <summary>
        /// 获取询价参数
        /// </summary>
        public static InquiryCommonModel GetInquiryCommonModel()
        {
            var request = HttpContext.Current.Request;
            int printTypeId = -1;
            int sizeId = -1;
            int paperId = -1;
            string works = string.Empty;
            int printMode = 1;
            int gramWeight = -1;
            int brandId = -1;
            int printCount = -1;
            string singleOrdouble = string.Empty;
            decimal tjWith = 0;
            decimal tjHigth = 0;
            decimal tyWith = 0;
            decimal tyHigth = 0;
            decimal uvWith = 0;
            decimal uvHigth = 0;
            decimal atWith = 0;
            decimal atHigth = 0;
            int deliveryMode = -1;
            int billMode = -1;
            string remarks = string.Empty;
            string paperMP = string.Empty;
            int printBoxNumber = 0;
            int printCountByBox = 0;
            int cupType = 0;
            string printColor = string.Empty;
            int sjType = 0;
            string designerDemand = string.Empty;
            string printSizeName = string.Empty;
            int coveredTypeId = -1;
            decimal brushWidth = 0;
            decimal brushHight = 0;
            int pageNum = 0;
            string ropeTypeName = string.Empty;
            string ropeColor = string.Empty;
            string envelopType = string.Empty;
            string pvcType = string.Empty;
            string pvcThick = string.Empty;
            if (request["hidPrintTypeId"] != null)
                printTypeId = request["hidPrintTypeId"].ToString().ToInt32().Value;
            if (request["printMode"] != null)
                printMode = request["printMode"].ToString().ToInt32().Value;
            if (request["paperSize"] != null)
                sizeId = request["paperSize"].ToString().ToInt32().Value;
            if (request["paper0"] != null)
            {
                paperId = request["paper0"].ToString().ToInt32().Value;
            }
            else
            {
                paperId = 3;
            }
            if (request["gramWeight0"] != null)
                gramWeight = request["gramWeight0"].ToString().ToInt32().Value;
            if (request["brand0"] != null)
            {
                brandId = request["brand0"].ToString().ToInt32().Value;
            }
            if (request["printCount"] != null)
                printCount = request["printCount"].ToString().ToInt32().Value;
            if (request["singleOrdouble"] != null)
                singleOrdouble = request["singleOrdouble"].ToString();
            if (request["works"] != null)
                works = request["works"].ToString();
            if (request["tjWith0"] != null)
                tjWith = request["tjWith0"].ToString().ToDecimal2().Value;
            if (request["tjHight0"] != null)
                tjHigth = request["tjHight0"].ToString().ToDecimal2().Value;
            if (request["tyWith0"] != null)
                tyWith = request["tyWith0"].ToString().ToDecimal2().Value;
            if (request["tyHight0"] != null)
                tyHigth = request["tyHight0"].ToString().ToDecimal2().Value;
            if (request["uvWith0"] != null)
                uvWith = request["uvWith0"].ToString().ToDecimal2().Value;
            if (request["uvHight0"] != null)
                uvHigth = request["uvHight0"].ToString().ToDecimal2().Value;
            if (request["aoTUWith0"] != null)
                atWith = request["aoTUWith0"].ToString().ToDecimal2().Value;
            if (request["aoTUHight0"] != null)
                atHigth = request["aoTUHight0"].ToString().ToDecimal2().Value;
            if (request["deliveryMode"] != null)
                deliveryMode = request["deliveryMode"].ToString().ToInt32().Value;
            if (request["billMode"] != null)
                billMode = request["billMode"].ToString().ToInt32().Value;
            if (request["remarks"] != null)
                remarks = request["remarks"].ToString();
            if (request["pNameMP"] != null)
                paperMP = request["pNameMP"].ToString();
            if (request["printBoxNumber"] != null)
                printBoxNumber = request["printBoxNumber"].ToString().ToInt32().Value;
            if (request["printCountByBox"] != null)
                printCountByBox = request["printCountByBox"].ToString().ToInt32().Value;
            if (request["cupType"] != null)
                cupType = request["cupType"].ToString().ToInt32().Value;
            if (request["printColor"] != null)
                printColor = request["printColor"].ToString();
            if (request["sjType"] != null)
                sjType = request["sjType"].ToString().ToInt32().Value;
            if (request["designerDemand"] != null)
                designerDemand = request["designerDemand"].ToString();
            if (request["printSizeName"] != null)
                printSizeName = request["printSizeName"].ToString();
            if (request["CoveredType"] != null)
                coveredTypeId = int.Parse(request["CoveredType"].ToString());
            if (request["brushWidth"] != null)
                brushWidth = request["brushWidth"].ToString().ToDecimal2().Value;
            if (request["brushHight"] != null)
                brushHight = request["brushHight"].ToString().ToDecimal2().Value;
            if (request["pageNum"] != null)
                pageNum = request["pageNum"].ToString().ToInt32().Value;
            if (request["RopeTypeName"] != null)
                ropeTypeName = request["RopeTypeName"].ToString();
            if (request["RopeColor"] != null)
                ropeColor = request["RopeColor"].ToString();
            if (request["EnvelopType"] != null)
                envelopType = request["EnvelopType"].ToString();
            if (request["pvcType"] != null)
                pvcType = request["pvcType"].ToString();
            if (request["pvcThick"] != null)
                pvcThick = request["pvcThick"].ToString();
            InquiryCommonModel model = new InquiryCommonModel();
            model.PrintTypeId = printTypeId;
            model.PrintMode = printMode;
            model.PrintSizeId = sizeId;
            model.PaperId = paperId;
            model.GramWeight = gramWeight;
            model.BrandId = brandId;
            model.PrintCount = printCount;
            model.SingleOrdouble = singleOrdouble;
            if (!string.IsNullOrEmpty(works))
            {
                model.AfterWorkList = new List<int>();
                string[] workArry = works.Split(',');
                foreach (string workStr in workArry)
                {
                    model.AfterWorkList.Add(workStr.ToInt32().Value);
                }
            }
            model.TJWith = tjWith;
            model.TJHight = tjHigth;
            model.TYHight = tyHigth;
            model.TYWith = tyWith;
            model.UVWith = uvWith;
            model.UVHight = uvHigth;
            model.ATWith = atWith;
            model.ATHight = atHigth;
            model.DeliveryMode = deliveryMode;
            model.BillMode = billMode;
            model.Remarks = remarks;
            model.PaperMP = paperMP;
            model.PrintBoxNumber = printBoxNumber;
            model.CupType = cupType;
            model.PrintColor = printColor;
            model.SJType = sjType;
            model.DesignerDemand = designerDemand;
            model.PrintSizeName = printSizeName;
            model.CoveredTypeId = coveredTypeId;
            model.BrushWidth = brushWidth;
            model.BrushHight = brushHight;
            model.PageNum = pageNum;
            model.RopeColor = ropeColor;
            model.EnvelopType = envelopType;
            model.PVCType = pvcType;
            model.PVCThick = pvcThick;
            if (model.PrintMode == 1)
            {
                model.PrintModeName = "合版";
            }
            else
            {
                model.PrintModeName = "专版";
            }
            PaperSizeDetailBLL _paperSizeDetailBLL = new PaperSizeDetailBLL();
 
 
            model.PrintTypeName = new SysInquiry_PrintingTypeBLL().GetModelById(model.PrintTypeId).PrintName;
            string printDemand = string.Empty;
            //名片
            if (model.PrintTypeId == 13)
            {
                SysInquiry_PaperSizeDetail paperSize = _paperSizeDetailBLL.GetPaperSizeDetail(model.PrintTypeId, model.PrintSizeId);
                model.PrintCount = printCountByBox;
                model.PrintSizeName = paperSize.Name;
                model.PrintCountName = model.PrintBoxNumber.ToString() + "款,每款" + model.PrintCount.ToString() + "盒数";
                printDemand += paperSize.Name + "," + model.PaperMP + "," + model.SingleOrdouble;
 
            }
            else if (model.PrintTypeId == 14) //DM单
            {
                SysInquiry_PaperSizeDetail paperSize = _paperSizeDetailBLL.GetPaperSizeDetail(model.PrintTypeId, model.PrintSizeId);
                PaperInfoBLL _paperInfoBLL = new PaperInfoBLL();
                BrandInfoBLL _brandInfoBLL = new BrandInfoBLL();
                model.PrintCountName = model.PrintCount.ToString();
                SysInquiry_PaperInfo paperInfo = _paperInfoBLL.GetPaperModel(model.PaperId);
                printDemand = paperSize.Name + ",";
                printDemand += paperInfo.PaperName;
                if (model.PaperId != 0)
                {
                    if (model.PrintMode == 0)
                    {
                        SysInquiry_BrandInfo brandInfo = _brandInfoBLL.SelectModelByKey(model.BrandId);
                        printDemand += "(" + brandInfo.BrandName + ")";
                    }
                    printDemand += "," + model.GramWeight + "克";
                }
                printDemand += "," + model.SingleOrdouble;
                model.PrintSizeName = paperSize.Name;
            }
            else if (model.PrintTypeId == 31) //广告纸杯
            {
                MultipleTypeInfoBLL _multipleTypeInfoBLL = new MultipleTypeInfoBLL();
                SysInquiry_MultipleTypeInfo typeModel = _multipleTypeInfoBLL.GetModel(model.CupType);
                model.PrintCountName = model.PrintCount.ToString();
                printDemand += typeModel.TypeNmae + "," + model.PaperMP + "," + model.PrintColor;
            }
            else if (model.PrintTypeId == 32) //广告扑克
            {
                MultipleTypeInfoBLL _multipleTypeInfoBLL = new MultipleTypeInfoBLL();
                SysInquiry_MultipleTypeInfo typeModel = _multipleTypeInfoBLL.GetModel(model.CupType);
                model.PrintCountName = model.PrintCount.ToString();
                printDemand += typeModel.TypeNmae;
            }
            else if (model.PrintTypeId == 34) //平面设计
            {
                model.PrintCountName = model.PrintCount.ToString();
                MultipleTypeInfoBLL _multipleTypeInfoBLL = new MultipleTypeInfoBLL();
                SysInquiry_MultipleTypeInfo typeModel = _multipleTypeInfoBLL.GetModel(model.CupType);
                printDemand += typeModel.TypeNmae + ",";
                typeModel = _multipleTypeInfoBLL.GetModel(model.SJType);
                printDemand += typeModel.TypeNmae + "," + model.DesignerDemand;
            }
            else if (model.PrintTypeId == 35) //房卡套
            {
                model.PrintCountName = model.PrintCount.ToString();
                PaperInfoBLL _paperInfoBLL = new PaperInfoBLL();
                SysInquiry_PaperInfo paperInfo = _paperInfoBLL.GetPaperModel(model.PaperId);
                printDemand += model.PrintSizeName + "," + paperInfo.PaperName;
                MultipleTypeInfoBLL _multipleTypeInfoBLL = new MultipleTypeInfoBLL();
                SysInquiry_MultipleTypeInfo typeModel = _multipleTypeInfoBLL.GetModel(model.CoveredTypeId);
                printDemand += "," + typeModel.TypeNmae;
            }
            else if (model.PrintTypeId == 17) //喷绘
            {
                model.PrintCount = 1;
                model.PrintCountName = "1";
                MultipleTypeInfoBLL _multipleTypeInfoBLL = new MultipleTypeInfoBLL();
                SysInquiry_MultipleTypeInfo typeModel = _multipleTypeInfoBLL.GetModel(model.CupType);
                printDemand += model.BrushWidth.ToString() + "×" + model.BrushHight.ToString() + ",";
                printDemand += typeModel.TypeNmae;
            }
            else if (model.PrintTypeId == 29) //黑白印件
            {
                SysInquiry_PaperSizeDetail paperSize = _paperSizeDetailBLL.GetPaperSizeDetail(model.PrintTypeId, model.PrintSizeId);
                PaperInfoBLL _paperInfoBLL = new PaperInfoBLL();
                BrandInfoBLL _brandInfoBLL = new BrandInfoBLL();
                model.PrintCountName = model.PrintCount.ToString();
                SysInquiry_PaperInfo paperInfo = _paperInfoBLL.GetPaperModel(model.PaperId);
                printDemand = paperSize.Name + ",";
                printDemand += paperInfo.PaperName + ",";
                if (model.PaperId != 0)
                {
                    if (model.PrintMode == 0)
                    {
                        SysInquiry_BrandInfo brandInfo = _brandInfoBLL.SelectModelByKey(model.BrandId);
                        printDemand += "(" + brandInfo.BrandName + ")";
                    }
                    printDemand += "," + model.GramWeight + "克";
                }
                printDemand += "," + model.SingleOrdouble;
                model.PrintSizeName = paperSize.Name;
            }
            else if (model.PrintTypeId == 22) //便签
            {
                model.PrintCountName = model.PrintCount.ToString();
                printDemand += "每本" + model.PageNum.ToString() + "页,";
                SysInquiry_PaperSizeDetail paperSize = _paperSizeDetailBLL.GetPaperSizeDetail(model.PrintTypeId, model.PrintSizeId);
                if (model.PrintMode == 1)
                {
                    printDemand += paperSize.Name + ",";
                    printDemand += model.PaperMP;
                }
                else
                {
                    PaperInfoBLL _paperInfoBLL = new PaperInfoBLL();
                    printDemand += paperSize.Name + ",";
                    SysInquiry_PaperInfo paperInfo = _paperInfoBLL.GetPaperModel(model.PaperMP.ToInt32().Value);
                    printDemand += paperInfo.PaperName;
                }
                model.PrintSizeName = paperSize.Name;
                int pId = -1;
                if (model.PrintMode == 0)
                {
                    pId = model.PaperMP.ToInt32().Value;
                    if (paperId != 0)
                    {
                        BrandInfoBLL _brandInfoBLL = new BrandInfoBLL();
                        SysInquiry_BrandInfo brandInfo = _brandInfoBLL.SelectModelByKey(model.BrandId);
                        printDemand += "(" + brandInfo.BrandName + ")";
                    }
                }
                if (pId != 0)
                {
                    printDemand += "," + model.GramWeight + "克";
                }
                printDemand += "," + model.PrintColor;
            }
            else if (model.PrintTypeId == 26) //封套
            {
                model.PrintCountName = model.PrintCount.ToString();
                SysInquiry_PaperSizeDetail paperSize = _paperSizeDetailBLL.GetPaperSizeDetail(model.PrintTypeId, model.PrintSizeId);
                printDemand += paperSize.Name + ",";
                model.PrintSizeName = paperSize.Name;
                if (model.PrintMode == 1)
                {
                    printDemand += model.PaperMP;
                }
                else
                {
                    PaperInfoBLL _paperInfoBLL = new PaperInfoBLL();
                    SysInquiry_PaperInfo paperInfo = _paperInfoBLL.GetPaperModel(model.PaperMP.ToInt32().Value);
                    printDemand += paperInfo.PaperName;
                }
                int pId = -1;
                if (model.PrintMode == 0)
                {
                    pId = model.PaperMP.ToInt32().Value;
                    if (paperId != 0)
                    {
                        BrandInfoBLL _brandInfoBLL = new BrandInfoBLL();
                        SysInquiry_BrandInfo brandInfo = _brandInfoBLL.SelectModelByKey(model.BrandId);
                        printDemand += "(" + brandInfo.BrandName + ")";
                    }
                }
                if (pId != 0)
                {
                    printDemand += "," + model.GramWeight + "克";
                }
            }
            else if (model.PrintTypeId == 16) //手提袋
            {
                if (model.AfterWorkList == null)
                {
                    model.AfterWorkList = new List<int>();
                }
                model.AfterWorkList.Add(19);//粘手提袋必选
                model.PrintCountName = model.PrintCount.ToString();
                SysInquiry_PaperSizeDetail paperSize = _paperSizeDetailBLL.GetPaperSizeDetail(model.PrintTypeId, model.PrintSizeId);
                printDemand += paperSize.Name + ",";
                model.PrintSizeName = paperSize.Name;
                if (model.PrintMode == 1)
                {
                    MultipleTypeInfoBLL _multipleTypeInfoBLL = new MultipleTypeInfoBLL();
                    SysInquiry_MultipleTypeInfo mTypeInfo = _multipleTypeInfoBLL.GetModel(model.PaperId);
                    printDemand += mTypeInfo.TypeNmae;
                }
                else
                {
                    PaperInfoBLL _paperInfoBLL = new PaperInfoBLL();
                    SysInquiry_PaperInfo paperInfo = _paperInfoBLL.GetPaperModel(model.PaperId);
                    printDemand += paperInfo.PaperName;
                }
                if (model.PaperId != 0)
                {
                    if (model.PrintMode == 0)
                    {
                        BrandInfoBLL _brandInfoBLL = new BrandInfoBLL();
                        SysInquiry_BrandInfo brandInfo = _brandInfoBLL.SelectModelByKey(model.BrandId);
                        printDemand += "(" + brandInfo.BrandName + ")";
                    }
                    printDemand += "," + model.GramWeight + "克";
                }
            }
            else if (model.PrintTypeId == 21)//信封
            {
                model.PrintCountName = model.PrintCount.ToString();
                SysInquiry_PaperSizeDetail paperSize = _paperSizeDetailBLL.GetPaperSizeDetail(model.PrintTypeId, model.PrintSizeId);
                printDemand += paperSize.Name + ",";
                model.PrintSizeName = paperSize.Name;
                if (model.PrintMode == 1)
                {
                    printDemand += model.PaperMP;
 
                }
                else
                {
                    PaperInfoBLL _paperInfoBLL = new PaperInfoBLL();
                    SysInquiry_PaperInfo paperInfo = _paperInfoBLL.GetPaperModel(model.PaperMP.ToInt32().Value);
                    printDemand += paperInfo.PaperName;
                }
                int pId = -1;
                if (model.PrintMode == 0)
                {
                    pId = model.PaperMP.ToInt32().Value;
                    if (pId != 0)
                    {
                        BrandInfoBLL _brandInfoBLL = new BrandInfoBLL();
                        SysInquiry_BrandInfo brandInfo = _brandInfoBLL.SelectModelByKey(model.BrandId);
                        printDemand += "(" + brandInfo.BrandName + ")";
                    }
                }
                if (pId != 0)
                {
                    printDemand += "," + model.GramWeight + "克";
                }
                if (model.PrintMode == 1)
                {
                    printDemand += ",彩色";
                }
                else
                {
                    printDemand += "," + model.PrintColor;
                }
                printDemand += "," + model.EnvelopType;
            }
            else if (model.PrintTypeId == 33) //PVC卡
            {
                model.PrintCountName = model.PrintCount.ToString();
                printDemand += model.PVCType + ",";
                printDemand += model.PrintSizeName;
                if (model.PVCType == "PVC卡")
                {
                    printDemand += "," + model.PVCThick;
                    MultipleTypeInfoBLL _multipleTypeInfoBLL = new MultipleTypeInfoBLL();
                    SysInquiry_MultipleTypeInfo mTypeInfo = _multipleTypeInfoBLL.GetModel(model.CupType);
                    printDemand += "," + mTypeInfo.TypeNmae;
                }
            }
            else if (model.PrintTypeId == 7) //报纸
            {
                SysInquiry_PaperSizeDetail paperSize = _paperSizeDetailBLL.GetPaperSizeDetail(model.PrintTypeId, model.PrintSizeId);
                PaperInfoBLL _paperInfoBLL = new PaperInfoBLL();
                model.PrintCountName = model.PrintCount.ToString();
                SysInquiry_PaperInfo paperInfo = _paperInfoBLL.GetPaperModel(model.PaperId);
                printDemand = paperSize.Name + ",";
                model.PrintSizeName = paperSize.Name;
                printDemand += paperInfo.PaperName;
                if (model.PaperId != 0)
                {
                    if (model.PrintMode == 0)
                    {
                        BrandInfoBLL _brandInfoBLL = new BrandInfoBLL();
                        SysInquiry_BrandInfo brandInfo = _brandInfoBLL.SelectModelByKey(model.BrandId);
                        printDemand += "(" + brandInfo.BrandName + ")";
                    }
                    printDemand += "," + model.GramWeight + "克";
                }
 
            }
            model.PrintDemand = printDemand;
            if (model.PrintTypeId == 21 && model.PrintMode == 1)
            {
                model.AfterWorksDemand = string.Empty;
            }
            else
            {
                model.AfterWorksDemand = GetAfterWorksStr(model, model.PrintTypeId);
            }
            string deliveryModeName = string.Empty;
            if (model.DeliveryMode == 104)
            {
                deliveryModeName = "自提";
            }
            else if (model.DeliveryMode == 105)
            {
                deliveryModeName = "代发货运";
            }
            else if (model.DeliveryMode == 106)
            {
                deliveryModeName = "送货上门";
            }
            else if (model.DeliveryMode == 107)
            {
                deliveryModeName = "指定货运公司";
            }
            model.DeliveryModeName = deliveryModeName;
            string billModeName = string.Empty;
            if (model.BillMode == 108)
            {
                billModeName = "不含税价";
            }
            else if (model.BillMode == 109)
            {
                billModeName = "普通发票";
            }
            else
            {
                billModeName = "增值税票";
            }
            model.BillModeName = billModeName;
            return model;
        }
 
        /// <summary>
        /// 获取后道参数
        /// </summary>
        /// <param name="model"></param>
        /// <param name="PrintTypeId"></param>
        public static string GetAfterWorksStr(InquiryCommonModel model, int printTypeId)
        {
            AfterParameterInfoBLL _afterParameterInfoBLL = new AfterParameterInfoBLL();
            string afterWorkStr = string.Empty;
            foreach (int workId in model.AfterWorkList)
            {
                SysInquiry_AfterParameterInfo afterInfo = _afterParameterInfoBLL.GetModel(workId);
                if (printTypeId != 13 && printTypeId != 33)
                {
                    if (afterInfo.ParameterName == "烫金")
                    {
                        afterInfo.ParameterName = "烫金(" + model.TJWith + "×" + model.TJHight + ")";
                    }
                    else if (afterInfo.ParameterName == "烫银")
                    {
                        afterInfo.ParameterName = "烫银(" + model.TYWith + "×" + model.TYHight + ")";
                    }
                    else if (afterInfo.ParameterName == "UV")
                    {
                        afterInfo.ParameterName = "UV(" + model.UVWith + "×" + model.UVHight + ")";
                    }
                    else if (afterInfo.ParameterName == "凹凸")
                    {
                        afterInfo.ParameterName = "击凹凸(" + model.ATWith + "×" + model.ATHight + ")";
                    }
                }
                if (afterInfo.ParameterName == "胶头")
                {
                    afterInfo.ParameterName = "胶头(每本" + model.PageNum.ToString() + "页)";
                }
                afterWorkStr += afterInfo.ParameterName + ",";
            }
            if (!string.IsNullOrEmpty(afterWorkStr))
            {
                afterWorkStr = afterWorkStr.Substring(0, afterWorkStr.Length - 1);
            }
            //if (model.PrintTypeId == 16)
            //{
            //    afterWorkStr += "," + model.RopeTypeName + "(" + model.RopeColor + ")";
            //}
            return afterWorkStr;
        }
 
        #endregion
 
        #region 事件
        protected void Page_Load(object sender, EventArgs e)
        {
            BussinessID = CurrentWeb().MemberId;
            this.Title += "-" + CurrentWeb().Name;
            if (!IsPostBack)
            {
                SetPrintName();
         
            }
 
            string result = string.Empty;
 
            if (Request["PaperInit"] != null)
            {
                int printTypeId = Session["PrintTypeId"].ToInt32().Value;
                CY.BLL.Inquiry.RangeofBusinessBLL _rangeofBusinessBLL = new CY.BLL.Inquiry.RangeofBusinessBLL();
                IList<CY.Model.SysInquiry_PaperInfo> paperInfoList = _rangeofBusinessBLL.GetPaperInfo(printTypeId);
                string str = string.Empty;
                foreach (CY.Model.SysInquiry_PaperInfo peper in paperInfoList)
                {
                    str += "{paperId:" + peper.PapeId + ",paperName:\"" + peper.PaperName + "\"},";
                }
                if (!string.IsNullOrEmpty(str))
                {
                    str = str.Substring(0, str.Length - 1);
                }
                result = "{paperInfo:[" + str + "]";
 
                CY.BLL.Inquiry.PaperSizeDetailBLL _paperSizeDetailBLL = new CY.BLL.Inquiry.PaperSizeDetailBLL();
                List<CY.Model.SysInquiry_PaperSizeDetail> paperSizeList = _paperSizeDetailBLL.GetPaperSizeList(PrintTypeId);
                str = string.Empty;
                foreach (CY.Model.SysInquiry_PaperSizeDetail size in paperSizeList)
                {
                    str += "{sizeId:" + size.KeyId + ",sizeName:\"" + size.Name + "\"},";
                }
                if (!string.IsNullOrEmpty(str))
                {
                    str = str.Substring(0, str.Length - 1);
                }
                result += ",sizeInfo:[" + str + "]}";
                Response.Write(result);
                Response.End();
            }
 
            if (Request["PaperSelect"] != null)
            {
                int printTypeId = Session["PrintTypeId"].ToInt32().Value;
                int paperId = Request["PaperId"].ToString().ToInt32().Value;
                IList<SysInquiry_BrandInfo> brandList = _paperInfoBLL.GetBrandInfoByPaper(paperId);
                string str = string.Empty;
                string brandListStr = string.Empty;
                int defaultBrandId = -1;
                if (brandList != null && brandList.Count > 0)
                {
                    defaultBrandId = brandList[0].KeyId;
                    foreach (SysInquiry_BrandInfo brand in brandList)
                    {
                        str += "{brandKey:" + brand.KeyId + ",brandName:'" + brand.BrandName + "'},";
                    }
                    if (!string.IsNullOrEmpty(str))
                    {
                        str = str.Substring(0, str.Length - 1);
                    }
                }
                brandListStr = "[" + str + "]";
 
                IList<int> gramWeightList = _rangeofBusinessBLL.GramWeightByPrintTypeId(printTypeId, paperId, defaultBrandId);
                str = string.Empty;
                foreach (int gramWeight in gramWeightList)
                {
                    str += gramWeight.ToString() + "|";
                }
                if (!string.IsNullOrEmpty(str))
                {
                    str = str.Substring(0, str.Length - 1);
                }
                result = "{brandListStr:" + brandListStr + ",gramWeights:\"" + str + "\"}";
                Response.Write(result);
                Response.End();
            }
 
            if (Request["RopeTypeNameInit"] != null)
            {
                int printTypeId = Session["PrintTypeId"].ToInt32().Value;
                RopeCostBLL _ropeCostBLL = new RopeCostBLL();
                IList<string> ropeTypeList = _ropeCostBLL.GetRopeTypeList(printTypeId);
                foreach (string typeName in ropeTypeList)
                {
                    result += typeName + "|";
                }
                if (!string.IsNullOrEmpty(result))
                {
                    result = result.Substring(0, result.Length - 1);
                }
                Response.Write(result);
                Response.End();
            }
 
            if (Request["BrandSelect"] != null)
            {
                int printTypeId = Session["PrintTypeId"].ToInt32().Value;
;
                int paperId = Request["PaperId"].ToString().ToInt32().Value;
                int brandId = Request["BrandId"].ToString().ToInt32().Value;
                IList<int> gramWeightList = _rangeofBusinessBLL.GramWeightByPrintTypeId(printTypeId, paperId, brandId);
                string str = string.Empty;
                foreach (int gramWeight in gramWeightList)
                {
                    str += gramWeight.ToString() + "|";
                }
                if (!string.IsNullOrEmpty(str))
                {
                    str = str.Substring(0, str.Length - 1);
                }
                result = str;
                Response.Write(result);
                Response.End();
            }
 
            if (Request["BindControl"] != null)
            {
                int orderId = Request["OrderId"].ToString().ToInt32().Value;
                EC_OrderPrintParameterBLL _eC_OrderPrintParameterBLL = new EC_OrderPrintParameterBLL();
                EC_OrderPrintParameter _eC_OrderPrintParameter = _eC_OrderPrintParameterBLL.GetModel(orderId);
                InquiryCommonModel _inquiryCommonModel = null;
                if (null != _eC_OrderPrintParameter)
                {
                    _inquiryCommonModel = SerializationHelper.DeSerialize(typeof(InquiryCommonModel), _eC_OrderPrintParameter.PrintParameter) as InquiryCommonModel;
                }
                result = JsonHelper.GetJsonStringByObject(_inquiryCommonModel);
                Response.Write(result);
                Response.End();
            }
 
            if (Request["sumit"] != null)
            {
                int pageIndex = 1;
                int pageSize = 5;
                if (Request["hidPageIndex"] != null)
                    pageIndex = Request["hidPageIndex"].ToString().ToInt32().Value;
                InquiryCommonModel model = GetInquiryCommonModel();
                string xmlStr = InquiryBLL.GetInquiryCommonModelXMLStr(model);
                xmlStr = SerializationHelper.EncryptDES(xmlStr, "ssssssss");
                Utils.WriteCookie("InquiryRecord", xmlStr);
                InquiryBLL _inquiryBLL = new InquiryBLL();
                int pageCount = 0;
                Guid memberId;
                if (Request["memberId"] != null)
                {
                    memberId = Request["memberId"].ToGuid2();
                }
                else
                {
                    memberId = Guid.Empty;
                }
 
 
                IList<InquiryResultModel> inquiryResultList = _inquiryBLL.GetInquiryResultByCommonList(model, memberId,-1,string.Empty,"","","",pageIndex, pageSize, ref pageCount);
                string jsonStr = JsonHelper.GetJsonStringByObject(inquiryResultList);
                result = "{ pageCount:" + pageCount + ",inquiryList:" + jsonStr + "}";
                Response.Write(result);
                Response.End();
            }
        }
        #endregion
    }
}