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 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 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 InquiryInsideList = _inquiryCommonModel.InquiryInsideList; if (InquiryInsideList != null && InquiryInsideList.Count > 0) { int i = 1; foreach (InquiryInsideModel inquiryInsideModel in InquiryInsideList) { List 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); } } } }