LR-20210131IOQH\Administrator
2021-09-13 1435b5b13b3857a20292d5c869f95e0c2ae5ffea
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
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.Sys;
using System.Text;
using CY.BLL.OA;
using CY.BLL.EC;
using CY.BLL.Inquiry;
using CY.Model.Inquiry;
using System.Text.RegularExpressions;
 
namespace CY.WebForm.Pages.business
{
    public partial class OrderProductionprogress : BasePage
    {
        EC_OrderBasicBLL eC_OrderBasicBLL = null;
        EC_OrderBLL eC_OrderBLL = null;
        AfterParameterInfoBLL _afterParameterInfoBLL = null;
        public OrderProductionprogress()
        {
 
            eC_OrderBasicBLL = new EC_OrderBasicBLL();
            eC_OrderBLL = new EC_OrderBLL();
            _afterParameterInfoBLL = new AfterParameterInfoBLL();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    this.HideKeyid.Value = Request["Keyid"].ToString2();
                    this.HideProductionprogress.Value = Request["works"].ToString2();
                    this.txtSellerOrderId.InnerText = Request["SellerOrderId"].ToString2();
                }
 
 
            }
            catch (Exception ex)
            {
                PAGEHandleException(ex);
                Response.Clear();
                Response.Write("-1");
            }
            //Response.End();
        }
 
 
        //提交事件
        protected void btn_Submit_Config(object sender, EventArgs e)
        {
 
 
            try
            {
                //string sss = Request["txtDelayTime"];
                // this.txtDelayTime.Value;
                if (this.HideKeyid.Value.ToInt32() == null)
                {
                    JavaScript.MessageBox("没有订单id", this);
                }
                if (this.HideProductionprogress.Value.ToDateTime2() == null)
                {
                    JavaScript.MessageBox("没有操作", this);
                }
                int Keyid = this.HideKeyid.Value.ToInt32().Value;
                string Productionprogress = this.HideProductionprogress.Value.ToString2();
 
              
 
                EC_OrderBasic eC_OrderBasic = eC_OrderBLL.GetOrderById(Keyid);
 
                EC_OrderExtend eC_OrderExtend = new EC_OrderExtend();
 
                eC_OrderExtend.Keyid = Keyid;
                if (string.IsNullOrEmpty(eC_OrderBasic.Productionprogress))
                {
                    IList<SysInquiry_AfterParameterInfo> afterInfos = _afterParameterInfoBLL.GetModelList();
                    string Productionprogress1 = "";
                    //Productionprogress1 += "施工单,";
                    Productionprogress1 += "制版,";
                    Productionprogress1 += "印刷,";
                    InquiryCommonModel _inquiryCommonModel = null;
                    if (null != eC_OrderBasic.PrintParameter)
                    {
                        _inquiryCommonModel = SerializationHelper.DeSerialize(typeof(InquiryCommonModel), eC_OrderBasic.PrintParameter) as InquiryCommonModel;
                        List<int> works = _inquiryCommonModel.AfterWorkList;
                        if (works != null && works.Count > 0)
                        {
                            foreach (int work in works)
                            {
                                SysInquiry_AfterParameterInfo sysInquiry_AfterParameterInfo = afterInfos.Where(x => x.KeyId == work).FirstOrDefault();
                                if (sysInquiry_AfterParameterInfo != null)
                                {
                                    Productionprogress1 += sysInquiry_AfterParameterInfo.ParameterName + ",";
                                }
 
 
                            }
                        }
 
                        List<InquiryInsideModel> InquiryInsideList = _inquiryCommonModel.InquiryInsideList;
 
                        if (InquiryInsideList != null && InquiryInsideList.Count > 0)
                        {
                            int i = 1;
                            foreach (InquiryInsideModel inquiryInsideModel in InquiryInsideList)
                            {
                                List<int> worksins = inquiryInsideModel.AfterWorkList;
                                if (worksins != null && worksins.Count > 0)
                                {
                                    foreach (int worksin in worksins)
                                    {
                                        SysInquiry_AfterParameterInfo sysInquiry_AfterParameterInfo = afterInfos.Where(x => x.KeyId == worksin).FirstOrDefault();
                                        if (sysInquiry_AfterParameterInfo != null)
                                        {
                                            Productionprogress1 += "内页" + i + ":"+ sysInquiry_AfterParameterInfo.ParameterName + ",";
                                        }
                                    }
                                }
                                i += 1;
                            }
                        }
 
                    }
                    Productionprogress1 += "装订,";
                    Productionprogress1 += "包装,";
                    eC_OrderBasic.Productionprogress = Productionprogress1;
 
 
                }
 
 
                if (Productionprogress == "施工单")
                {
                    eC_OrderExtend.Productionprogress = eC_OrderBasic.Productionprogress.Replace(Productionprogress + ",", "");
                }
                else if (Productionprogress == "制版")
                {
                    eC_OrderExtend.Productionprogress = eC_OrderBasic.Productionprogress.Replace("施工单,", "").Replace(Productionprogress + ",", "");
                }
                else if (Productionprogress == "印刷")
                {
                    eC_OrderExtend.Productionprogress = eC_OrderBasic.Productionprogress.Replace("施工单,", "").Replace("制版,", "").Replace(Productionprogress + ",", "");
                }
                else if (Productionprogress == "装订")
                {
                    eC_OrderExtend.Productionprogress = eC_OrderExtend.Productionprogress = "包装,";
                }
                else if (Productionprogress == "包装")
                {
                    eC_OrderExtend.Productionprogress = ",";
                }
                else
                {
                    Regex r = new Regex(Productionprogress + ",");
                    eC_OrderExtend.Productionprogress = eC_OrderBasic.Productionprogress.Replace("施工单,", "").Replace("制版,", "").Replace("印刷,", "");
                    eC_OrderExtend.Productionprogress = r.Replace(eC_OrderExtend.Productionprogress, "", 1);
                }
 
                bool result = eC_OrderBLL.OldUpdateProductionprogress(eC_OrderExtend);
 
                if (result)
                    JavaScript.MessageBox("操作成功", this, true, true);
                else
                    JavaScript.MessageBox("操作失败", this);
 
 
 
 
 
 
 
 
            }
            catch (Exception ex)
            {
                PAGEHandleException(ex);
                JavaScript.MessageBox("操作失败", this);
            }
        }
    }
}