username@email.com
2025-04-02 d4ac809aa5620aa79fc6b5a396a64fc27d5fcdee
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL.EC;
using CY.Model;
using CY.BLL.Sys;
using CY.Infrastructure.Common;
using CY.BLL;
using CY.Model.Inquiry;
using CY.BLL.OA;
 
namespace CY.WebForm.Pages.business
{
    //吴辉
    //合版施工单
    public partial class AgSpecialOrderDetail : BasePage
    {
        EC_SpecialOrdersBLL bll_EC_SpecialOrdersBLL = null;
        string orderIdStr = string.Empty;
        //初始化
        public AgSpecialOrderDetail()
        {
            bll_EC_SpecialOrdersBLL = new EC_SpecialOrdersBLL();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
            //    InitData();
            //}
            switch (Request["Target"])
            {
 
                case "print":
                    int orderId = Request["orderIdStr"].ToString().ToInt32().Value;
                    EC_SpecialOrders m_EC_SpecialOrders = bll_EC_SpecialOrdersBLL.GetModelByOrderId(orderId);
                     m_EC_SpecialOrders.IsPrint = 1;
                     bll_EC_SpecialOrdersBLL.UpdateModel(m_EC_SpecialOrders);
                     break;
                default:
                    InitData();
                    return;
            }
        }
 
        /// <summary>
        /// 加载合版施工单信息
        /// </summary>
        private bool InitData()
        {
            #region 获取订单及其相关
 
            EC_OrderBasicBLL _eC_OrderBasicBLL = new EC_OrderBasicBLL();
            orderIdStr = Request["orderid"];
            this.hideOrderId.Value = Request["orderid"];
            if (string.IsNullOrEmpty(orderIdStr))
            {
                CY.WebForm.BasePage.JavaScript.MessageBox("未传递参数!", this);
                return false;
            }
            int? orderId = MyConvert.ConvertToInt32(orderIdStr);
            if (!orderId.HasValue)
            {
                CY.WebForm.BasePage.JavaScript.MessageBox("未传递参数!", this);
                return false;
            }
 
            EC_OrderBasic _eC_OrderBasic = _eC_OrderBasicBLL.SelectModelById(orderId.Value);
            if (null == _eC_OrderBasic)
            {
                CY.WebForm.BasePage.JavaScript.MessageBox("数据不存在!", this);
                return false;
            }
            EC_AcceptWayByOrderBLL _eC_AcceptWayByOrderBLL = new EC_AcceptWayByOrderBLL();
            EC_AcceptWayByOrder _eC_AcceptWayByOrder = _eC_AcceptWayByOrderBLL.GetModelByTargetId(orderId.Value);
            if (null == _eC_AcceptWayByOrder)
            {
                CY.WebForm.BasePage.JavaScript.MessageBox("数据不存在!", this);
                return false;
            }
 
            EC_OrderPrintParameterBLL _eC_OrderPrintParameterBLL = new EC_OrderPrintParameterBLL();
            EC_OrderPrintParameter _eC_OrderPrintParameter = _eC_OrderPrintParameterBLL.GetModel(orderId.Value);
            InquiryCommonModel _inquiryCommonModel = null;
            if (null == _eC_OrderPrintParameter)
            {
                _inquiryCommonModel = new InquiryCommonModel();
            }
            else
            {
                _inquiryCommonModel = SerializationHelper.DeSerialize(typeof(InquiryCommonModel), _eC_OrderPrintParameter.PrintParameter) as InquiryCommonModel;
            }
 
            #endregion
 
            EC_SpecialOrders m_EC_SpecialOrders = bll_EC_SpecialOrdersBLL.GetModelByOrderId(orderId);
            if (m_EC_SpecialOrders == null)
                m_EC_SpecialOrders = new EC_SpecialOrders();
 
            OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = new OA_CorporateClientsBLL();
            Sys_DictionaryBLL sys_DictionaryBLL = new Sys_DictionaryBLL();
            _inquiryCommonModel.DeliveryModeName = sys_DictionaryBLL.GetModelByKeyid(_eC_AcceptWayByOrder.AcceptTypeId);
            _inquiryCommonModel.BillModeName = _eC_AcceptWayByOrder.InvoiceDemand;
 
            this.spanSpecialNum.InnerText = string.IsNullOrEmpty(m_EC_SpecialOrders.PSO_OrderNum) ? bll_EC_SpecialOrdersBLL.GetPSO_OrderNum(CurrentUser.MemberId) : m_EC_SpecialOrders.PSO_OrderNum;
            this.spanSpecialExigency.InnerText = _eC_OrderBasic.OrderExtend.ExigencyCase.Name;
            this.spanSpecialTime.InnerText = m_EC_SpecialOrders.PSO_OrderTime == null ? DateTime.Now.ToString("yyyy-MM-dd HH:mm") : m_EC_SpecialOrders.PSO_OrderTime.Value.ToString("yyyy-MM-dd HH:mm");
            this.spanSpecialOprator.InnerText = string.IsNullOrEmpty(m_EC_SpecialOrders.Operator) ? CurrentUser.ShortName : m_EC_SpecialOrders.Operator;
 
            if (string.IsNullOrEmpty(m_EC_SpecialOrders.PSO_Work))
            {
                this.txtPSO_Work_o_TR.Visible = false;
            }
            else
            {
                this.txtPSO_Work_o.InnerText = m_EC_SpecialOrders.PSO_Work;
            }
 
            if (string.IsNullOrEmpty(m_EC_SpecialOrders.PSO_Remarks))
            {
                this.txtPSO_Remarks_o_TR.Visible = false;
            }
            else
            {
                this.txtPSO_Remarks_o.InnerText = m_EC_SpecialOrders.PSO_Remarks;
            }
 
            this.spanOrderNum.InnerText = _eC_OrderBasic.SellerOrderId;
            //this.spanOrderType.InnerText = _eC_OrderBasic.OrderType.Name;
            this.spanOrderTitle.InnerText = _eC_OrderBasic.DocumentName;
            this.spanOrderDeliveryTime.InnerText = _eC_OrderBasic.DeliveryTime == null ? "" : _eC_OrderBasic.DeliveryTime.Value.ToString("yyyy-MM-dd HH:mm");
 
            this.spanOrderCustormName.InnerText = _eC_OrderBasic.BuyerName;
            this.spanOrderCustormLevel.InnerText = _eC_OrderBasic.OrderExtend.CustomerLevel.Name;
            this.spanOrderCustormPeople.InnerText = _eC_OrderBasic.OrderExtend.Contacts;
            this.spanOrderCustormPhone.InnerText = _eC_OrderBasic.OrderExtend.ContactPhone;
            this.spanOrderBusinessManage.InnerText = _eC_OrderBasic.OrderExtend.BusinessManager.Name;
            this.spanOrderCustormManage.InnerText = _eC_OrderBasic.OrderExtend.CustomerManager.Name;
 
            this.spanOrderName.InnerText = _eC_OrderBasic.DocumentName;
            //this.spanOrderAllMoney.InnerText = "¥" + _eC_OrderBasic.SumPrice.ToDecimal2Yen();
            //this.spanOrderSize.InnerText = _inquiryCommonModel.PrintSizeName;
            this.spanOrderPrintNum.InnerText = _eC_OrderBasic.OrderExtend.PrintNum.ToString2();
 
            if (_eC_OrderBasic.PrintTypeId == 13)
            {
                this.spanOrderPrintDemand.InnerHtml = "印刷数量:(" + _inquiryCommonModel.PrintBoxNumber + "款,每款" + _eC_OrderBasic.OrderExtend.PrintNum + "盒)," + _inquiryCommonModel.PrintDemand;
            }
            else
            {
                this.spanOrderPrintDemand.InnerHtml = "印刷数量:(" + _eC_OrderBasic.OrderExtend.PrintNum + ")," + _inquiryCommonModel.PrintDemand;
            }
 
            this.spanOrderAfterWorksDemand.InnerText = _inquiryCommonModel.AfterWorksDemand;
            this.spanOrderDeliveryModeName.InnerText = _inquiryCommonModel.DeliveryModeName;
            this.spanOrderBillModeName.InnerText = _inquiryCommonModel.BillModeName;
            this.spanOrderRemarks.InnerText = _eC_OrderBasic.Remark;        
 
            List<EC_SpecialForums> m_EC_SpecialForumsList = bll_EC_SpecialOrdersBLL.GetEC_SpecialForumsListByKeyid(m_EC_SpecialOrders.Keyid) as List<EC_SpecialForums>;
            
            if (m_EC_SpecialForumsList == null || m_EC_SpecialForumsList.Count == 0)
            {
                m_EC_SpecialForumsList = new List<EC_SpecialForums>();
                EC_SpecialForums m_EC_SpecialForums = new EC_SpecialForums();
                m_EC_SpecialForums.PSF_Forumsid = 1;
                m_EC_SpecialForumsList.Add(m_EC_SpecialForums);
            }
 
            foreach (var eC_SpecialForums  in m_EC_SpecialForumsList)
            {
                if (eC_SpecialForums.PSF_PressesDesk.IndexOf("数码")>=0 || eC_SpecialForums.PSF_PressesDesk.IndexOf("直接修切") >= 0)
                {
                    eC_SpecialForums.shifouxianshi = "display:none;";
                }
 
                if (eC_SpecialForums.PSF_PressesDesk.IndexOf("与其他订单合版") >= 0  )
                {
                    eC_SpecialForums.shifouxianshi = "display:none;";
                    eC_SpecialForums.shifouxianshiheban = "display:none;";
                }
 
            }
            this.RepClientList.DataSource = m_EC_SpecialForumsList;
            this.RepClientList.DataBind();
            return true;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnPress_Click(object sender, EventArgs e)
        {
            EC_SpecialOrders m_EC_SpecialOrders = bll_EC_SpecialOrdersBLL.GetModelByOrderId(Convert.ToInt32(Request["orderid"]));
            m_EC_SpecialOrders.IsPrint = 1;
            bll_EC_SpecialOrdersBLL.UpdateModel(m_EC_SpecialOrders);
        }
        public string show(string str,string strPlateSource)
        {
            string reStr = string.Empty;
 
            if (strPlateSource == "本厂CTP")
            {
                if(str == "CTPCount")
                {
                    reStr = "style="+"\""+""+"\"";
                }
                else if(str == "PSSpec")
                {
                    reStr = "style=" + "\"" + "display:none" + "\"";
                }
                else
                {
                    reStr = "style=" + "\"" + "display:none" + "\"";
                }
            }
            else if(strPlateSource == "自带CTP")
            {
                if (str == "CTPCount")
                {
                    reStr = "style=" + "\"" + "display:none" + "\"";
                }
                else if (str == "PSSpec")
                {
                    reStr = "style=" + "\"" + "display:none" + "\"";
                }
                else
                {
                    reStr = "style=" + "\"" + "display:none" + "\"";
                }
            }
            else if (strPlateSource == "自带菲林" || strPlateSource == "本厂菲林")
            {
                if (str == "CTPCount")
                {
                    reStr = "style=" + "\"" + "display:none" + "\"";
                }
                else if (str == "PSSpec")
                {
                    reStr = "style=" + "\"" + "" + "\"";
                }
                else
                {
                    reStr = "style=" + "\"" + "" + "\"";
                }
            }
            return reStr;
        }
    }
}