/** * OrderEdit.aspx.cs * * 功 能: 订单列表 * 类 名: OrderEdit * * Ver 变更日期 负责人 变更内容 * ─────────────────────────────────── * V0.01 2013-5-8 13:55 吴崎均 初版 * V0.02 2013-5-8 15:47 吴崎均 实现下拉数据绑定与数据级联 * V0.03 2013-5-8 18:00 吴崎均 初步完成新增线下订单(未调试) * */ using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CY.BLL.Sys; using CY.BLL; using CY.Model; using CY.Infrastructure.Common; using CY.WebForm.Pages.common; using CY.BLL.EC; using CY.Model.Inquiry; namespace CY.WebForm.Pages.business { public partial class ShejiOrderEdit : BasePage { public int Orderid = 0; public int printNum = 0; /// /// 页面加载事件 /// /// /// protected void Page_Load(object sender, EventArgs e) { try { switch (Request["Target"]) { case "getPrintAsk2": LoadPrintAsk2(); break; case "getPrintAsk": LoadPrintAsk(); break; case "GetCommunication": LoadCommunication(); break; case "ReBindClients": Response.Write(ReLoadClients()); break; case "ToUpSetData": Page_Load_Default(); LoadOrderInfo(); return; case "jisuanorderJine": UpdateorderJine2(); break; default: Page_Load_Default(); return; } } catch (Exception ex) { PAGEHandleException(ex); Response.Clear(); //Response.Write("-1"); Response.Write(ex.Message); } Response.End(); } private void LoadOrderInfo() { if (IsPostBack || IsCallback) return; else ; EC_OrderBasicBLL _eC_OrderBasicBLL = new EC_OrderBasicBLL(); Orderid = Request["orderId"].ToInt32() ?? 0; string orderIdStr = Request["orderId"]; if (string.IsNullOrEmpty(orderIdStr) || "0".Equals(orderIdStr)) return; else ; if (string.IsNullOrEmpty(orderIdStr)) { JavaScript.MessageBox("未传递参数!", this); return; } int? orderId = MyConvert.ConvertToInt32(orderIdStr); if (!orderId.HasValue) { JavaScript.MessageBox("未传递参数!", this); return; } EC_OrderBasic _eC_OrderBasic = _eC_OrderBasicBLL.SelectModelById(orderId.Value); this.txtKeyid.Value = MyConvert.ConvertToString(_eC_OrderBasic.Keyid); this.txtOrderId.Value = MyConvert.ConvertToString(_eC_OrderBasic.SellerOrderId); this.txtCustormerName.Value = MyConvert.ConvertToString(_eC_OrderBasic.BuyerName); this.txtCustormerName.Visible = true; this.selCustormer.Value = MyConvert.ConvertToString(_eC_OrderBasic.BuyerId.ToString()); this.txtCompanyName.Value = MyConvert.ConvertToString(_eC_OrderBasic.BuyerName); this.selPrintTypes.Value = _eC_OrderBasic.PrintTypeId.HasValue ? _eC_OrderBasic.PrintTypeId.Value.ToString() : ""; this.txtPrintTypes.Value = MyConvert.ConvertToString(_eC_OrderBasic.PrintType.PrintName); this.txtDeliveryTime.Value = _eC_OrderBasic.DeliveryTime.HasValue? _eC_OrderBasic.DeliveryTime.Value.ToString(FixedInfo.DATEFORMAT):""; this.txtDocumentName.Value = MyConvert.ConvertToString(_eC_OrderBasic.DocumentName); this.hidOrderTypeId.Value = _eC_OrderBasic.OrderTypeId.ToString(); this.txtRemark.Value = _eC_OrderBasic.Remark.ToString2(); this.txtPrintPackDeliveryRequir.Value = _eC_OrderBasic.PrintPackDeliveryRequir.ToString2(); this.txtDuiyinghetongbianhao.Value = _eC_OrderBasic.Duiyinghetongbianhao; if (_eC_OrderBasic.UnitPrice.HasValue) { this.txtUnitPrice.Value = _eC_OrderBasic.UnitPrice.Value.ToString("0.0000"); } if (_eC_OrderBasic.SumPrice.HasValue) { this.txtSumPrice.Value = _eC_OrderBasic.SumPrice.Value.ToString("0.00"); } this.txtPhone.Value = MyConvert.ConvertToString(_eC_OrderBasic.OrderExtend.ContactPhone); this.txtContact.Value = MyConvert.ConvertToString(_eC_OrderBasic.OrderExtend.Contacts); this.selVerifyWay.Value = MyConvert.ConvertToString(_eC_OrderBasic.OrderExtend.ProofreadWay); //spnSurplusPrintNum.InnerHtml = MyConvert.ConvertToString(_eC_OrderBasic.OrderExtend.SurplusPrintNum); this.selCustormerLevel.Value = _eC_OrderBasic.OrderExtend.CustomerLevelId.HasValue ? MyConvert.ConvertToString(_eC_OrderBasic.OrderExtend.CustomerLevelId) : ""; this.selExigencyDegree.Value = MyConvert.ConvertToString(_eC_OrderBasic.OrderExtend.ExigencyCaseId); this.selCustormerManagers.Value = MyConvert.ConvertToString(_eC_OrderBasic.OrderExtend.CustomerManagerId); this.selBusinessManagers.Value = MyConvert.ConvertToString(_eC_OrderBasic.OrderExtend.BusinessManagerId); this.txtBookNumber.Value = MyConvert.ConvertToString(_eC_OrderBasic.OrderExtend.BookNum); this.txtBookPrice.Value = MyConvert.ConvertToString(_eC_OrderBasic.OrderExtend.BookPrice); this.txtNumberPerBag.Value = MyConvert.ConvertToString(_eC_OrderBasic.OrderExtend.NumPerBag); this.txtBagNum.Value = MyConvert.ConvertToString(_eC_OrderBasic.OrderExtend.BagNum); //EC_OrderPrintParameterBLL _eC_OrderPrintParameterBLL = new EC_OrderPrintParameterBLL(); //EC_OrderPrintParameter _eC_OrderPrintParameter = _eC_OrderPrintParameterBLL.GetModel(orderId.Value); //InquiryCommonModel _inquiryCommonModel = null; //if (null != _eC_OrderPrintParameter) //{ // _inquiryCommonModel = SerializationHelper.DeSerialize(typeof(InquiryCommonModel), _eC_OrderPrintParameter.PrintParameter) as InquiryCommonModel; //} //else ; //rptInquiryCommon.DataSource = new List() { _inquiryCommonModel }; //rptInquiryCommon.DataBind(); #region 绑定设计信息 if (_eC_OrderBasic.PrintTypeId == 29) { this.SelShejirenyuan29.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.SelShejileixing29.Value = _eC_OrderBasic.Shejileixing.HasValue ? _eC_OrderBasic.Shejileixing.Value.ToString() : ""; this.SelDanshuangmian29.Value = _eC_OrderBasic.Danshuangmian; this.txtShejiyaoqiu29.Value = _eC_OrderBasic.Shejiyaoqiu; } else if (_eC_OrderBasic.PrintTypeId == 6) { this.SelShejirenyuan6.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.SelShejileixing6.Value = _eC_OrderBasic.Shejileixing.HasValue ? _eC_OrderBasic.Shejileixing.Value.ToString() : ""; this.SelDanshuangmian6.Value = _eC_OrderBasic.Danshuangmian; this.txtShejiyaoqiu6.Value = _eC_OrderBasic.Shejiyaoqiu; this.SelShejirenyuanneiye6.Value = _eC_OrderBasic.Shejirenyuanneiye.HasValue ? _eC_OrderBasic.Shejirenyuanneiye.Value.ToString() : ""; this.SelShejileixingneiye6.Value = _eC_OrderBasic.Shejileixingneiye.HasValue ? _eC_OrderBasic.Shejileixingneiye.Value.ToString() : ""; this.txtShejiyaoqiuneiye6.Value = _eC_OrderBasic.Shejiyaoqiuneiye; } else if(_eC_OrderBasic.PrintTypeId == 15) { this.SelShejirenyuan15.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.SelShejileixing15.Value = _eC_OrderBasic.Shejileixing.HasValue ? _eC_OrderBasic.Shejileixing.Value.ToString() : ""; this.SelDanshuangmian15.Value = _eC_OrderBasic.Danshuangmian; this.txtShejiyaoqiu15.Value = _eC_OrderBasic.Shejiyaoqiu; this.SelShejirenyuanneiye15.Value = _eC_OrderBasic.Shejirenyuanneiye.HasValue ? _eC_OrderBasic.Shejirenyuanneiye.Value.ToString() : ""; this.SelShejileixingneiye15.Value = _eC_OrderBasic.Shejileixingneiye.HasValue ? _eC_OrderBasic.Shejileixingneiye.Value.ToString() : ""; this.txtShejiyaoqiuneiye15.Value = _eC_OrderBasic.Shejiyaoqiuneiye; } else if (_eC_OrderBasic.PrintTypeId == 14) { this.SelShejirenyuan14.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.SelShejileixing14.Value = _eC_OrderBasic.Shejileixing.HasValue ? _eC_OrderBasic.Shejileixing.Value.ToString() : ""; this.SelDanshuangmian14.Value = _eC_OrderBasic.Danshuangmian; this.txtShejiyaoqiu14.Value = _eC_OrderBasic.Shejiyaoqiu; } else if (_eC_OrderBasic.PrintTypeId == 27) { this.SelShejirenyuan27.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.SelShejileixing27.Value = _eC_OrderBasic.Shejileixing.HasValue ? _eC_OrderBasic.Shejileixing.Value.ToString() : ""; this.txtShejiyaoqiu27.Value = _eC_OrderBasic.Shejiyaoqiu; } else if (_eC_OrderBasic.PrintTypeId == 21) { this.SelShejirenyuan21.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.SelShejileixing21.Value = _eC_OrderBasic.Shejileixing.HasValue ? _eC_OrderBasic.Shejileixing.Value.ToString() : ""; this.txtShejiyaoqiu21.Value = _eC_OrderBasic.Shejiyaoqiu; } else if (_eC_OrderBasic.PrintTypeId == 7) { this.SelShejirenyuan7.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.SelShejileixing7.Value = _eC_OrderBasic.Shejileixing.HasValue ? _eC_OrderBasic.Shejileixing.Value.ToString() : ""; this.txtShejiyaoqiu7.Value = _eC_OrderBasic.Shejiyaoqiu; } else if (_eC_OrderBasic.PrintTypeId == 38) { this.SelShejirenyuan38.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.txtShejileixingName38.Value = _eC_OrderBasic.ShejileixingName; this.txtShejiyaoqiu38.Value = _eC_OrderBasic.Shejiyaoqiu; this.ShijuanprintCount.Value = _eC_OrderBasic.Shejicount.HasValue ? _eC_OrderBasic.Shejicount.Value.ToString() : "0"; this.SelShejirenyuanneiye38.Value = _eC_OrderBasic.Shejirenyuanneiye.HasValue ? _eC_OrderBasic.Shejirenyuanneiye.Value.ToString() : ""; this.txtShejileixingNameneiye38.Value = _eC_OrderBasic.ShejileixingNameneiye; this.txtShejiyaoqiuneiye38.Value = _eC_OrderBasic.Shejiyaoqiuneiye; this.DatikaprintCount.Value = _eC_OrderBasic.Shejicountneiye.HasValue ? _eC_OrderBasic.Shejicountneiye.Value.ToString() : "0"; } else if (_eC_OrderBasic.PrintTypeId == 20) { this.SelShejirenyuan20.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.SelShejileixing20.Value = _eC_OrderBasic.Shejileixing.HasValue ? _eC_OrderBasic.Shejileixing.Value.ToString() : ""; this.txtShejiyaoqiu20.Value = _eC_OrderBasic.Shejiyaoqiu; } else if (_eC_OrderBasic.PrintTypeId == 16) { this.SelShejirenyuan16.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.SelShejileixing16.Value = _eC_OrderBasic.Shejileixing.HasValue ? _eC_OrderBasic.Shejileixing.Value.ToString() : ""; this.txtShejiyaoqiu16.Value = _eC_OrderBasic.Shejiyaoqiu; } else if (_eC_OrderBasic.PrintTypeId == 22) { this.SelShejirenyuan22.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.SelShejileixing22.Value = _eC_OrderBasic.Shejileixing.HasValue ? _eC_OrderBasic.Shejileixing.Value.ToString() : ""; this.txtShejiyaoqiu22.Value = _eC_OrderBasic.Shejiyaoqiu; } else if (_eC_OrderBasic.PrintTypeId == 39) { this.SelShejirenyuan39.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.txtShejiyaoqiu39.Value = _eC_OrderBasic.Shejiyaoqiu; } else if (_eC_OrderBasic.PrintTypeId == 23) { this.SelShejirenyuan23.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.SelShejileixing23.Value = _eC_OrderBasic.Shejileixing.HasValue ? _eC_OrderBasic.Shejileixing.Value.ToString() : ""; this.txtShejiyaoqiu23.Value = _eC_OrderBasic.Shejiyaoqiu; } else if (_eC_OrderBasic.PrintTypeId == 25) { this.SelShejirenyuan25.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.SelShejileixing25.Value = _eC_OrderBasic.Shejileixing.HasValue ? _eC_OrderBasic.Shejileixing.Value.ToString() : ""; this.txtShejiyaoqiu25.Value = _eC_OrderBasic.Shejiyaoqiu; } else if (_eC_OrderBasic.PrintTypeId == 26) { this.SelShejirenyuan26.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.SelShejileixing26.Value = _eC_OrderBasic.Shejileixing.HasValue ? _eC_OrderBasic.Shejileixing.Value.ToString() : ""; this.txtShejiyaoqiu26.Value = _eC_OrderBasic.Shejiyaoqiu; } else { this.SelShejirenyuan1111.Value = _eC_OrderBasic.Shejirenyuan.HasValue ? _eC_OrderBasic.Shejirenyuan.Value.ToString() : ""; this.txtShejiyaoqiu1111.Value = _eC_OrderBasic.Shejiyaoqiu; } #endregion } /// /// 默认执行方法 /// private void Page_Load_Default() { btnSave.ServerClick += new EventHandler(btnSave_ServerClick); btnSaveask.ServerClick += new EventHandler(btnSaveask_ServerClick); if (!IsPostBack && !IsCallback) { Sys_DictionaryBLL _sys_DictionaryBLL = new Sys_DictionaryBLL();//字典业务逻辑操作类对象 SysInquiry_PrintingTypeBLL _sysInquiry_PrintingTypeBLL = new SysInquiry_PrintingTypeBLL();//印刷业务类型业务逻辑操作类对象 OA_CorporateClientsBLL _oA_CorporateClientsBLL = new OA_CorporateClientsBLL(); EC_OrderBasicBLL _eC_OrderBasicBLL = new EC_OrderBasicBLL(); this.txtCustormerName.Visible = false;//默认不显示 //设计订单用反转的MemberId var originalGuid = CurrentUser.MemberId; Guid reversedGuid = new Guid(originalGuid.ToByteArray().Reverse().ToArray()); this.txtOrderId.Value = _eC_OrderBasicBLL.LoadOrderIdBySellerId(reversedGuid);//加载订单编号 IList corporateClients = _oA_CorporateClientsBLL.SelectListByFirmId(CurrentUser.MemberId) as IList; if (null != corporateClients) { corporateClients.Where(cc => CurrentUser.MemberId.Equals(cc.MemberId) && corporateClients.Remove(cc)); } this.selCustormer.DataSource = corporateClients; this.selCustormer.DataBind(); this.selCustormer.Items.Insert(0, new ListItem("请选择", "")); //this.rptCustormer.DataSource = corporateClients; //this.rptCustormer.DataBind(); this.selPrintTypes.DataSource = _sysInquiry_PrintingTypeBLL.SelectUsedModlesByFirm(CurrentUser.MemberId).OrderBy(x=>x.orderNumHome); this.selPrintTypes.DataBind(); this.selPrintTypes.Items.Insert(0, new ListItem("请选择", "")); this.selPrintTypes.Items.Add(new ListItem("其他", "-1")); this.selExigencyDegree.DataSource = _sys_DictionaryBLL.GetDataByType("OA_紧急程度"); this.selExigencyDegree.DataBind(); this.selExigencyDegree.Value = "0"; this.selVerifyWay.DataSource = _sys_DictionaryBLL.GetDataByType("EC_校稿方式"); this.selVerifyWay.DataBind(); this.selVerifyWay.Value = "0"; this.selCustormerLevel.DataSource = _sys_DictionaryBLL.GetDataByType("客户重要程度"); this.selCustormerLevel.DataBind(); OA_StaffBLL oA_StaffBLL = new BLL.OA_StaffBLL(); this.selBusinessManagers.DataSource = oA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, true, false); this.selBusinessManagers.DataBind(); this.selBusinessManagers.Items.Insert(0, new ListItem("无", "0")); this.selCustormerManagers.DataSource = oA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, false, true); this.selCustormerManagers.DataBind(); this.selCustormerManagers.Items.Insert(0, new ListItem("无", "0")); var oA_Staffs = oA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, null, null).Where(x => x.DepartmentId == 13); this.SelShejirenyuan29.DataSource = oA_Staffs; this.SelShejirenyuan29.DataBind(); this.SelShejirenyuan6.DataSource = oA_Staffs; this.SelShejirenyuan6.DataBind(); this.SelShejirenyuanneiye6.DataSource = oA_Staffs; this.SelShejirenyuanneiye6.DataBind(); this.SelShejirenyuan15.DataSource = oA_Staffs; this.SelShejirenyuan15.DataBind(); this.SelShejirenyuanneiye15.DataSource = oA_Staffs; this.SelShejirenyuanneiye15.DataBind(); this.SelShejirenyuan14.DataSource = oA_Staffs; this.SelShejirenyuan14.DataBind(); this.SelShejirenyuan27.DataSource = oA_Staffs; this.SelShejirenyuan27.DataBind(); this.SelShejirenyuan21.DataSource = oA_Staffs; this.SelShejirenyuan21.DataBind(); this.SelShejirenyuan7.DataSource = oA_Staffs; this.SelShejirenyuan7.DataBind(); this.SelShejirenyuan38.DataSource = oA_Staffs; this.SelShejirenyuan38.DataBind(); this.SelShejirenyuanneiye38.DataSource = oA_Staffs; this.SelShejirenyuanneiye38.DataBind(); this.SelShejirenyuan20.DataSource = oA_Staffs; this.SelShejirenyuan20.DataBind(); this.SelShejirenyuan16.DataSource = oA_Staffs; this.SelShejirenyuan16.DataBind(); this.SelShejirenyuan22.DataSource = oA_Staffs; this.SelShejirenyuan22.DataBind(); this.SelShejirenyuan39.DataSource = oA_Staffs; this.SelShejirenyuan39.DataBind(); this.SelShejirenyuan23.DataSource = oA_Staffs; this.SelShejirenyuan23.DataBind(); this.SelShejirenyuan25.DataSource = oA_Staffs; this.SelShejirenyuan25.DataBind(); this.SelShejirenyuan26.DataSource = oA_Staffs; this.SelShejirenyuan26.DataBind(); this.SelShejirenyuan1111.DataSource = oA_Staffs; this.SelShejirenyuan1111.DataBind(); } } /// /// 保存点击事件 /// /// /// void btnSave_ServerClick(object sender, EventArgs e) { if (SaveOrder()) { //操作成功 JavaScript.MessageBox("操作成功", this, 1); } else { //操作失败 JavaScript.MessageBox("操作失败", this); } } /// /// 保存要求点击事件 /// /// /// void btnSaveask_ServerClick(object sender, EventArgs e) { if (SaveOrderAsk()) { //操作成功 JavaScript.MessageBox("操作成功", this,1); } else { //操作失败 JavaScript.MessageBox("操作失败", this); } } /// /// 加载客户联系方式 /// private void LoadCommunication() { Response.Clear(); string id = Request["id"]; if (string.IsNullOrEmpty(id)) { Response.Write("-2"); return; } OA_CorporateClientsBLL _oA_CorporateClientsBLL = new OA_CorporateClientsBLL(); OA_CorporateClients m_OA_CorporateClients = _oA_CorporateClientsBLL.SelectModelByFirmIdandMemberId(CurrentUser.MemberId, id.ToGuid2()); OA_CustomerCommunications _oA_CustomerCommunications = _oA_CorporateClientsBLL.GetModel_CustomerCommunications(m_OA_CorporateClients.Keyid); _oA_CustomerCommunications.DegreeImportanId = m_OA_CorporateClients.DegreeImportanId; _oA_CustomerCommunications.AccountManagerId = m_OA_CorporateClients.AccountManagerId; _oA_CustomerCommunications.BusinessManagerId = m_OA_CorporateClients.BusinessManagerId; _oA_CustomerCommunications.CompanyName = m_OA_CorporateClients.CompanyName; _oA_CustomerCommunications.Note = m_OA_CorporateClients.Note; Response.Write(null == _oA_CustomerCommunications ? "" : JsonHelper.GetJsonStringByObject(_oA_CustomerCommunications)); } /// /// 加载印刷物 /// private void LoadPrintAsk() { Response.Clear(); string id = Request["id"]; if (string.IsNullOrEmpty(id)) { Response.Write("-2"); return; } OA_CorporateClientsBLL _oA_CorporateClientsBLL = new OA_CorporateClientsBLL(); List oA_CorporateClientsPrints = _oA_CorporateClientsBLL.SelectPrintListByCorId(id.ToGuid2()).ToList(); string sss = "[";// JsonHelper.GetJsonStringByObject(oA_CorporateClientsPrints); if (oA_CorporateClientsPrints!=null&& oA_CorporateClientsPrints.Count > 0) { for(int i=0;i< oA_CorporateClientsPrints.Count; i++) { sss += "{\"Keyid\":\""+ oA_CorporateClientsPrints [i].Keyid+ "\","; sss += "\"DocumentName\":\"" + oA_CorporateClientsPrints[i].DocumentName + "\"}"; if(i != oA_CorporateClientsPrints.Count - 1) { sss += ","; } } } sss += "]"; Response.Write(null == oA_CorporateClientsPrints ? "[]" : sss); } /// /// 加载印刷物 /// private void LoadPrintAsk2() { Response.Clear(); string result = string.Empty; int orderId = Request["OrderId"].ToString().ToInt32().Value; OA_CorporateClientsBLL oA_CorporateClientsBLL = new OA_CorporateClientsBLL(); OA_CorporateClientsPrint _CorporateClientsPrint = oA_CorporateClientsBLL.SelectPrintListByPrintId(orderId); result = "";//JsonHelper.GetJsonStringByObject(_CorporateClientsPrint); result += "{\"BusinessManagers\":\"" + _CorporateClientsPrint.BusinessManagers + "\","; result += "\"ManagersMobile\":\"" + _CorporateClientsPrint.ManagersMobile + "\","; result += "\"ManagersQQ\":\"" + _CorporateClientsPrint.ManagersQQ + "\","; result += "\"Deliveryrequirements\":\"" + _CorporateClientsPrint.Deliveryrequirements + "\","; result += "\"DocumentName\":\"" + _CorporateClientsPrint.DocumentName + "\","; result += "\"UnitPrice\":" + _CorporateClientsPrint.UnitPrice + ","; result += "\"SumPrice\":" + _CorporateClientsPrint.SumPrice + ""; result += "}"; Response.Write(result); //Response.End(); } /// /// 加载印刷物 /// private void UpdateorderJine2() { Response.Clear(); string result = string.Empty; int orderId = Request["OrderId"].ToString().ToInt32().Value; EC_OrderBasicBLL _eC_OrderBasicBLL = new EC_OrderBasicBLL(); var sss = _eC_OrderBasicBLL.UpdateorderJine(orderId); result = "";//JsonHelper.GetJsonStringByObject(_CorporateClientsPrint); result += "{\"status\":\"" + sss + "\""; result += "}"; Response.Write(result); //Response.End(); } /// /// 保存订单 /// private bool SaveOrder() { bool isWin = false; EC_OrderBasicBLL bll_EC_OrderBasicBLL = new EC_OrderBasicBLL(); EC_OrderExtend eC_OrderExtend = new EC_OrderExtend();//订单扩展信息 EC_OrderBasic eC_OrderBasic = new EC_OrderBasic();//订单主要信息 OA_StaffBLL oA_StaffBLL = new BLL.OA_StaffBLL(); OA_ShejijijianBLL bll_OA_ShejijijianBLLBLL = new OA_ShejijijianBLL(); CY.BLL.Inquiry.PaperSizeDetailBLL _paperSizeDetailBLL = new CY.BLL.Inquiry.PaperSizeDetailBLL();//查询纸张尺寸 EC_OrderPrintParameter orderPrintParameter = null; InquiryCommonModel _inquiryCommonModel = null; eC_OrderExtend.Keyid = MyConvert.ConvertToInt32(txtKeyid.Value); if (txtKeyid.Value == "0" || hidOrderTypeId.Value == "1") { eC_OrderBasic = bll_EC_OrderBasicBLL.SelectModelById(eC_OrderExtend.Keyid ?? 0); if (eC_OrderBasic == null || eC_OrderBasic.Keyid == null) { eC_OrderBasic = new EC_OrderBasic(); } if (eC_OrderBasic.ShejiStatus == 1) { //操作失败 JavaScript.MessageBox("已下单,不能修改", this); return false; } eC_OrderExtend.Remark = MyConvert.ConvertToString(Request["txtRemark"]).Trim(); eC_OrderExtend.PrintPackDeliveryRequir = MyConvert.ConvertToString(Request["txtPrintPackDeliveryRequir"]).Trim(); eC_OrderExtend.Operate = CurrentUser.ShortName; eC_OrderExtend.ExigencyCaseId = MyConvert.ConvertToInt32(Request["selExigencyDegree"]); eC_OrderExtend.ProofreadWayId = MyConvert.ConvertToInt32(Request["selVerifyWay"]); eC_OrderExtend.BusinessManagerId = MyConvert.ConvertToInt32(Request["selBusinessManagers"]); eC_OrderExtend.CustomerManagerId = MyConvert.ConvertToInt32(Request["selCustormerManagers"]); eC_OrderExtend.CustomerLevelId = MyConvert.ConvertToInt32(Request["selCustormerLevel"]); eC_OrderExtend.Contacts = MyConvert.ConvertToString(Request["txtContact"]).Trim(); eC_OrderExtend.ContactPhone = MyConvert.ConvertToString(Request["txtPhone"]).Trim(); eC_OrderExtend.printunit = MyConvert.ConvertToInt32(Request["ysUnit"]).Value; eC_OrderBasic.Remark = eC_OrderExtend.Remark; eC_OrderBasic.DocumentName = MyConvert.ConvertToString(Request["txtDocumentName"]).Trim(); eC_OrderBasic.Operator = eC_OrderBasic.Creater = eC_OrderExtend.Operate; if (Request["txtUnitPrice"] != null && !string.IsNullOrEmpty(Request["txtUnitPrice"])) { eC_OrderBasic.UnitPrice = MyConvert.ConvertToDecimal(Request["txtUnitPrice"]); } eC_OrderBasic.SumPrice = MyConvert.ConvertToDecimal(Request["txtSumPrice"]); //eC_OrderExtend.SurplusPrintNum = MyConvert.ConvertToInt32(txtSurplusPrintNum.Value); if (Request["hidPrintTypeId"].ToString().ToInt32() == -1 ) { _inquiryCommonModel = new InquiryCommonModel(); _inquiryCommonModel.PrintTypeId = -1; _inquiryCommonModel.PrintCount = Request["printCount"].ToString().ToInt32().Value; _inquiryCommonModel.Unit = MyConvert.ConvertToInt32(Request["ysUnit"]).Value; if (Request["txtPrintDemand"].ToString().IndexOf(Request["printSizeName"].ToString()) >= 0) { _inquiryCommonModel.PrintDemand = Request["txtPrintDemand"].ToString(); } else { _inquiryCommonModel.PrintDemand = Request["printSizeName"].ToString() + ";" + Request["txtPrintDemand"].ToString(); } _inquiryCommonModel.PrintSizeName = Request["printSizeName"].ToString(); } else { _inquiryCommonModel = CY.WebForm.Pages.front.InquiryOnLine.GetInquiryCommonModel(); } if (null == _inquiryCommonModel) return false; if (_inquiryCommonModel.PrintTypeId == 13) { eC_OrderExtend.PrintNum = _inquiryCommonModel.PrintCount * _inquiryCommonModel.PrintBoxNumber; eC_OrderExtend.SurplusPrintNum = _inquiryCommonModel.PrintCount * _inquiryCommonModel.PrintBoxNumber; } else { eC_OrderExtend.PrintNum = _inquiryCommonModel.PrintCount; eC_OrderExtend.SurplusPrintNum = _inquiryCommonModel.PrintCount; } orderPrintParameter = new EC_OrderPrintParameter()//订单印刷参数 { PrintParameter = SerializationHelper.Serialize(_inquiryCommonModel) , OrderId = eC_OrderExtend.Keyid.HasValue ? eC_OrderExtend.Keyid.Value : 0 }; } eC_OrderBasic.DocumentName = MyConvert.ConvertToString(Request["txtDocumentName"]); eC_OrderBasic.DeliveryTime = MyConvert.ConvertToDateTime(Request["txtDeliveryTime"]); eC_OrderExtend.Duiyinghetongbianhao = MyConvert.ConvertToString(Request["txtDuiyinghetongbianhao"]).Trim(); var PrintTypeId = MyConvert.ConvertToInt32(Request["selPrintTypes"]); #region 绑定设计信息 封面的数值就是1 内页的数量需要计算所有的内页页码的总和 //系统表格中工价为16开工价;32开下浮30%;32开以下减半;8开上浮30%,4开以上上浮1半 仅限于:黑白印件、书刊、画册、DM但、报纸5种,其他不管 decimal gongjia = new decimal(1); if(PrintTypeId == 29 || PrintTypeId == 6 || PrintTypeId == 15 || PrintTypeId == 14 || PrintTypeId == 7) { var paperSize = Request["paperSize"]; if (paperSize != "-1") { var paperSizeDetail = _paperSizeDetailBLL.GetPaperSizeDetail(PrintTypeId.Value, paperSize.ToInt32().Value); if (paperSizeDetail != null) { if (paperSizeDetail.Name.IndexOf("48开") >= 0 || paperSizeDetail.Name.IndexOf("64开") >= 0) { gongjia = new decimal(0.5); } else if (paperSizeDetail.Name.IndexOf("32开") >= 0) { gongjia = new decimal(0.7); } else if (paperSizeDetail.Name.IndexOf("16开") >= 0) { gongjia = new decimal(1); } else if (paperSizeDetail.Name.IndexOf("8开") >= 0 || paperSizeDetail.Name.IndexOf("6开") >= 0) { gongjia = new decimal(1.3); } else if(paperSizeDetail.Name.IndexOf("4开") >= 0 || paperSizeDetail.Name.IndexOf("3开") >= 0 || paperSizeDetail.Name.IndexOf("2开") >= 0 || paperSizeDetail.Name.IndexOf("全开") >= 0) { gongjia = new decimal(1.5); } } } else { decimal sikai = 420 * 570; if (PrintTypeId == 29) { sikai = 380 * 680; } decimal bakai = 420 * 285; decimal sanshierkai = 130 * 185; var txtFirstSize = Request["txtFirstSize"].ToDecimal2()??0; var txtSecondSize = Request["txtSecondSize"].ToDecimal2() ?? 0; var chicun = txtFirstSize * txtSecondSize; if (chicun>= sikai) { gongjia = new decimal(1.5); } else if (chicun >= bakai) { gongjia = new decimal(1.3); } else if (chicun == sanshierkai) { gongjia = new decimal(0.7); } else if (chicun < sanshierkai) { gongjia = new decimal(0.5); } } } if (PrintTypeId == 29) { eC_OrderExtend.Shejicount = 1;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan29.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } eC_OrderExtend.Shejileixing = this.SelShejileixing29.Value.ToInt32(); eC_OrderExtend.ShejileixingName = this.shejileixing(eC_OrderExtend.Shejileixing.Value.ToString()); eC_OrderExtend.Danshuangmian = this.SelDanshuangmian29.Value; eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu29.Value; eC_OrderExtend.ShejiStatus = 2; var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(),"", eC_OrderExtend.Shejileixing.ToString(),null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney * gongjia; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } } else if (PrintTypeId == 6) { eC_OrderExtend.Shejicount = 1;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejileixing = this.SelShejileixing6.Value.ToInt32(); if (eC_OrderExtend.Shejileixing != 8) { eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan6.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "1", eC_OrderExtend.Shejileixing.ToString(), null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney * gongjia; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } } else { eC_OrderExtend.Shejirenyuan = 0; eC_OrderExtend.ShejirenyuanName = ""; eC_OrderExtend.ShejiUnitPrice = 0; eC_OrderExtend.ShejiSumPrice = 0; } eC_OrderExtend.ShejileixingName = this.shejileixing(eC_OrderExtend.Shejileixing.Value.ToString()); eC_OrderExtend.Danshuangmian = this.SelDanshuangmian6.Value; eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu6.Value; eC_OrderExtend.ShejiStatus = 2; int insidePageNum = 1; if (Request["hidInsidePageNum"] != null) insidePageNum = Request["hidInsidePageNum"].ToString().ToInt32().Value; int PageNumneiye = 0; for (int i = 1; i <= insidePageNum; i++) { if (Request["pageNum" + i] != null) PageNumneiye += Request["pageNum" + i].ToInt32().HasValue ? Request["pageNum" + i].ToInt32().Value : 0; } eC_OrderExtend.Shejicountneiye = PageNumneiye;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejileixingneiye = this.SelShejileixingneiye6.Value.ToInt32(); if (eC_OrderExtend.Shejileixingneiye != 8) { eC_OrderExtend.Shejirenyuanneiye = this.SelShejirenyuanneiye6.Value.ToInt32(); var oA_Staff1 = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuanneiye); if (oA_Staff1 != null) { eC_OrderExtend.ShejirenyuanNameneiye = oA_Staff1.Name; } var shejijijian1 = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "2", eC_OrderExtend.Shejileixingneiye.ToString(), null).FirstOrDefault(); if (shejijijian1 != null) { eC_OrderExtend.ShejiUnitPriceneiye = shejijijian1.Shejilemoney * gongjia; if (eC_OrderExtend.ShejiUnitPriceneiye.HasValue) { eC_OrderExtend.ShejiSumPriceneiye = eC_OrderExtend.ShejiUnitPriceneiye * eC_OrderExtend.Shejicountneiye; } } } else { eC_OrderExtend.Shejirenyuanneiye = 0; eC_OrderExtend.ShejirenyuanNameneiye = ""; eC_OrderExtend.ShejiUnitPriceneiye = 0; eC_OrderExtend.ShejiSumPriceneiye = 0; } eC_OrderExtend.ShejileixingNameneiye = this.shejileixing(eC_OrderExtend.Shejileixingneiye.Value.ToString()); eC_OrderExtend.Shejiyaoqiuneiye = this.txtShejiyaoqiuneiye6.Value; } else if (PrintTypeId == 15) { eC_OrderExtend.Shejicount = 1;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejileixing = this.SelShejileixing15.Value.ToInt32(); if (eC_OrderExtend.Shejileixing != 8) { eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan15.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "1", eC_OrderExtend.Shejileixing.ToString(), null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney * gongjia; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } } else { eC_OrderExtend.Shejirenyuan = 0; eC_OrderExtend.ShejirenyuanName = ""; eC_OrderExtend.ShejiUnitPrice = 0; eC_OrderExtend.ShejiSumPrice = 0; } eC_OrderExtend.ShejileixingName = this.shejileixing(eC_OrderExtend.Shejileixing.Value.ToString()); eC_OrderExtend.Danshuangmian = this.SelDanshuangmian15.Value; eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu15.Value; eC_OrderExtend.ShejiStatus = 2; int insidePageNum = 1; if (Request["hidInsidePageNum"] != null) insidePageNum = Request["hidInsidePageNum"].ToString().ToInt32().Value; int PageNumneiye = 0; for (int i = 1; i <= insidePageNum; i++) { if (Request["pageNum" + i] != null) PageNumneiye += Request["pageNum" + i].ToInt32().HasValue ? Request["pageNum" + i].ToInt32().Value : 0; } eC_OrderExtend.Shejicountneiye = PageNumneiye;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejileixingneiye = this.SelShejileixingneiye15.Value.ToInt32(); if (eC_OrderExtend.Shejileixingneiye != 8) { eC_OrderExtend.Shejirenyuanneiye = this.SelShejirenyuanneiye15.Value.ToInt32(); var oA_Staff1 = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuanneiye); if (oA_Staff1 != null) { eC_OrderExtend.ShejirenyuanNameneiye = oA_Staff1.Name; } var shejijijian1 = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "2", eC_OrderExtend.Shejileixingneiye.ToString(), null).FirstOrDefault(); if (shejijijian1 != null) { eC_OrderExtend.ShejiUnitPriceneiye = shejijijian1.Shejilemoney * gongjia; if (eC_OrderExtend.ShejiUnitPriceneiye.HasValue) { eC_OrderExtend.ShejiSumPriceneiye = eC_OrderExtend.ShejiUnitPriceneiye * eC_OrderExtend.Shejicountneiye; } } } else { eC_OrderExtend.Shejirenyuanneiye = 0; eC_OrderExtend.ShejirenyuanNameneiye = ""; eC_OrderExtend.ShejiUnitPriceneiye = 0; eC_OrderExtend.ShejiSumPriceneiye = 0; } eC_OrderExtend.ShejileixingNameneiye = this.shejileixing(eC_OrderExtend.Shejileixingneiye.Value.ToString()); eC_OrderExtend.Shejiyaoqiuneiye = this.txtShejiyaoqiuneiye15.Value; } else if (PrintTypeId == 14) { eC_OrderExtend.Shejicount = 1;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan14.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } eC_OrderExtend.Shejileixing = this.SelShejileixing14.Value.ToInt32(); eC_OrderExtend.ShejileixingName = this.shejileixing(eC_OrderExtend.Shejileixing.Value.ToString()); eC_OrderExtend.Danshuangmian = this.SelDanshuangmian14.Value; eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu14.Value; eC_OrderExtend.ShejiStatus = 2; var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "", eC_OrderExtend.Shejileixing.ToString(), null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney * gongjia; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } } else if (PrintTypeId == 27) { eC_OrderExtend.Shejicount = 1;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan27.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } eC_OrderExtend.Shejileixing = this.SelShejileixing27.Value.ToInt32(); eC_OrderExtend.ShejileixingName = this.shejileixing(eC_OrderExtend.Shejileixing.Value.ToString()); eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu27.Value; eC_OrderExtend.ShejiStatus = 2; var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "", eC_OrderExtend.Shejileixing.ToString(), null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } } else if (PrintTypeId == 21) { eC_OrderExtend.Shejicount = 1;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan21.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } eC_OrderExtend.Shejileixing = this.SelShejileixing21.Value.ToInt32(); eC_OrderExtend.ShejileixingName = this.shejileixing(eC_OrderExtend.Shejileixing.Value.ToString()); eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu21.Value; eC_OrderExtend.ShejiStatus = 2; var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "", eC_OrderExtend.Shejileixing.ToString(), null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } } else if (PrintTypeId == 7) { eC_OrderExtend.Shejicount = 1;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan7.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } eC_OrderExtend.Shejileixing = this.SelShejileixing7.Value.ToInt32(); eC_OrderExtend.ShejileixingName = this.shejileixing(eC_OrderExtend.Shejileixing.Value.ToString()); eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu7.Value; eC_OrderExtend.ShejiStatus = 2; var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "", eC_OrderExtend.Shejileixing.ToString(), null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney * gongjia; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } } else if (PrintTypeId == 38) { eC_OrderExtend.Shejicount = this.ShijuanprintCount.Value.ToInt32() ?? 0; //Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan38.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } eC_OrderExtend.ShejileixingName = this.txtShejileixingName38.Value; eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu38.Value; eC_OrderExtend.ShejiStatus = 2; var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "1", "", null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } eC_OrderExtend.Shejicountneiye = this.DatikaprintCount.Value.ToInt32()??0; //Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejirenyuanneiye = this.SelShejirenyuanneiye38.Value.ToInt32(); var oA_Staff1 = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuanneiye); if (oA_Staff1 != null) { eC_OrderExtend.ShejirenyuanNameneiye = oA_Staff1.Name; } eC_OrderExtend.ShejileixingNameneiye = this.txtShejileixingNameneiye38.Value; eC_OrderExtend.Shejiyaoqiuneiye = this.txtShejiyaoqiuneiye38.Value; var shejijijian1 = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "2", "", null).FirstOrDefault(); if (shejijijian1 != null) { eC_OrderExtend.ShejiUnitPriceneiye = shejijijian1.Shejilemoney; if (eC_OrderExtend.ShejiUnitPriceneiye.HasValue) { eC_OrderExtend.ShejiSumPriceneiye = eC_OrderExtend.ShejiUnitPriceneiye * eC_OrderExtend.Shejicountneiye; } } } else if (PrintTypeId == 20) { eC_OrderExtend.Shejicount = 1;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan20.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } eC_OrderExtend.Shejileixing = this.SelShejileixing20.Value.ToInt32(); eC_OrderExtend.ShejileixingName = this.shejileixing(eC_OrderExtend.Shejileixing.Value.ToString()); eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu20.Value; eC_OrderExtend.ShejiStatus = 2; var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "", eC_OrderExtend.Shejileixing.ToString(), null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } } else if (PrintTypeId == 16) { eC_OrderExtend.Shejicount = 1;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan16.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } eC_OrderExtend.Shejileixing = this.SelShejileixing16.Value.ToInt32(); eC_OrderExtend.ShejileixingName = this.shejileixing(eC_OrderExtend.Shejileixing.Value.ToString()); eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu16.Value; eC_OrderExtend.ShejiStatus = 2; var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "", eC_OrderExtend.Shejileixing.ToString(), null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } } else if (PrintTypeId == 22) { eC_OrderExtend.Shejicount = 1;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan22.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } eC_OrderExtend.Shejileixing = this.SelShejileixing22.Value.ToInt32(); eC_OrderExtend.ShejileixingName = this.shejileixing(eC_OrderExtend.Shejileixing.Value.ToString()); eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu22.Value; eC_OrderExtend.ShejiStatus = 2; var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "", eC_OrderExtend.Shejileixing.ToString(), null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } } else if (PrintTypeId == 39) { eC_OrderExtend.Shejicount = 1;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan39.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu39.Value; eC_OrderExtend.ShejiStatus = 2; var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "", "", null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } } else if (PrintTypeId == 23) { eC_OrderExtend.Shejicount = 1;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan23.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } eC_OrderExtend.Shejileixing = this.SelShejileixing23.Value.ToInt32(); eC_OrderExtend.ShejileixingName = this.shejileixing(eC_OrderExtend.Shejileixing.Value.ToString()); eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu23.Value; eC_OrderExtend.ShejiStatus = 2; var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "", eC_OrderExtend.Shejileixing.ToString(), null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } } else if (PrintTypeId == 25) { eC_OrderExtend.Shejicount = 1;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan25.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } eC_OrderExtend.Shejileixing = this.SelShejileixing25.Value.ToInt32(); eC_OrderExtend.ShejileixingName = this.shejileixing(eC_OrderExtend.Shejileixing.Value.ToString()); eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu25.Value; eC_OrderExtend.ShejiStatus = 2; var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "", eC_OrderExtend.Shejileixing.ToString(), null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } } else if (PrintTypeId == 26) { eC_OrderExtend.Shejicount = 1;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan26.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } eC_OrderExtend.Shejileixing = this.SelShejileixing26.Value.ToInt32(); eC_OrderExtend.ShejileixingName = this.shejileixing(eC_OrderExtend.Shejileixing.Value.ToString()); eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu26.Value; eC_OrderExtend.ShejiStatus = 2; var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "", eC_OrderExtend.Shejileixing.ToString(), null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } } else { eC_OrderExtend.Shejicount = 1;// Request["printCount"].ToString().ToInt32(); eC_OrderExtend.Shejirenyuan = this.SelShejirenyuan1111.Value.ToInt32(); var oA_Staff = oA_StaffBLL.GetModelByKeyid(eC_OrderExtend.Shejirenyuan); if (oA_Staff != null) { eC_OrderExtend.ShejirenyuanName = oA_Staff.Name; } eC_OrderExtend.Shejiyaoqiu = this.txtShejiyaoqiu1111.Value; eC_OrderExtend.ShejiStatus = 2; var shejijijian = bll_OA_ShejijijianBLLBLL.GetModelByformid(CurrentUser.MemberId, PrintTypeId.ToString(), "", "", null).FirstOrDefault(); if (shejijijian != null) { eC_OrderExtend.ShejiUnitPrice = shejijijian.Shejilemoney; if (eC_OrderExtend.ShejiUnitPrice.HasValue) { eC_OrderExtend.ShejiSumPrice = eC_OrderExtend.ShejiUnitPrice * eC_OrderExtend.Shejicount; } } } #endregion ///是修改时只保存扩展信息 if (eC_OrderExtend.Keyid.HasValue && 0 < eC_OrderExtend.Keyid.Value) { EC_OrderBLL orderBLL = new EC_OrderBLL(); //eC_OrderExtend.CustomerManagerId = 0; //eC_OrderExtend.BusinessManagerId = 0; if (!string.IsNullOrEmpty(hidOrderTypeId.Value)) { eC_OrderBasic.OrderTypeId = hidOrderTypeId.Value.ToString().ToInt32().Value; } EC_AcceptWayByOrderBLL _AcceptWayByOrderBLL = new EC_AcceptWayByOrderBLL(); EC_AcceptWayByOrder acceptWayByOrder = _AcceptWayByOrderBLL.GetModelByTargetId(eC_OrderExtend.Keyid.Value); Sys_DictionaryBLL _bll_Sys_DictionaryBLL = new Sys_DictionaryBLL(); string ReceiptType = _bll_Sys_DictionaryBLL.GetModelByKeyid(Request["AcceptTypeId"].ToInt32()); acceptWayByOrder.AcceptTypeId = Request["AcceptTypeId"].ToInt32(); acceptWayByOrder.InvoiceDemand = Request["InvoiceId"].ToString2(); switch (ReceiptType) { case "自提": break; case "代发货运": acceptWayByOrder.City = Request["City_OnBehalfOfCargo"].ToString2(); acceptWayByOrder.Accepter = Request["Accepter_OnBehalfOfCargo"].ToString2(); acceptWayByOrder.AccepterPhone = Request["AccepterPhone_OnBehalfOfCargo"].ToString2(); break; case "送货上门": acceptWayByOrder.City = Request["City_HomeDelivery"].ToString2(); acceptWayByOrder.Accepter = Request["Accepter_HomeDelivery"].ToString2(); acceptWayByOrder.AccepterPhone = Request["AccepterPhone_HomeDelivery"].ToString2(); acceptWayByOrder.AccepterAddress = Request["AccepterAddress_HomeDelivery"].ToString(); break; case "指定货运公司": acceptWayByOrder.City = Request["City_OfficialFreightForwarder"].ToString2(); acceptWayByOrder.Accepter = Request["Accepter_OfficialFreightForwarder"].ToString2(); acceptWayByOrder.AccepterPhone = Request["AccepterPhone_OfficialFreightForwarder"].ToString2(); acceptWayByOrder.AppointCourierCompany = Request["AppointCourierCompany"].ToString2(); acceptWayByOrder.AccepterAddress = Request["AccepterAddress"].ToString2(); acceptWayByOrder.AccepterPhoneNum = Request["AccepterPhoneNum"].ToString2(); acceptWayByOrder.AcceptContacts = Request["AcceptContacts"].ToString2(); acceptWayByOrder.FetchAddress = Request["FetchAddress"].ToString2(); acceptWayByOrder.FetchPhoneNum = Request["FetchPhoneNum"].ToString2(); acceptWayByOrder.FetchContacts = Request["FetchContacts"].ToString2(); acceptWayByOrder.AppointCourierCompany = Request["AppointCourierCompany"].ToString2(); break; default: break; } eC_OrderBasic.AcceptWayByOrder = acceptWayByOrder; eC_OrderExtend.BookNum = MyConvert.ConvertToString(Request["txtBookNumber"]).Trim(); eC_OrderExtend.BookPrice = MyConvert.ConvertToString(Request["txtBookPrice"]).Trim(); eC_OrderExtend.NumPerBag = MyConvert.ConvertToString(Request["txtNumberPerBag"]).Trim(); eC_OrderExtend.BagNum = MyConvert.ConvertToString(Request["txtBagNum"]).Trim(); isWin = orderBLL.UpdateOrderInfo(eC_OrderBasic, eC_OrderExtend, orderPrintParameter); } else { eC_OrderBasic.PrintTypeId = MyConvert.ConvertToInt32(Request["selPrintTypes"]); eC_OrderBasic.DocumentName = MyConvert.ConvertToString(Request["txtDocumentName"]); eC_OrderBasic.DeliveryTime = MyConvert.ConvertToDateTime(Request["txtDeliveryTime"]); OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = new OA_CorporateClientsBLL(); OA_CorporateClients m_OA_CorporateClients = bll_OA_CorporateClientsBLL.GetModel(MyConvert.ConvertToGuid(Request["selCustormer"])); if (m_OA_CorporateClients == null) { eC_OrderBasic.BuyerId = MyConvert.ConvertToGuid(Request["selCustormer"]); } else { eC_OrderBasic.BuyerId = m_OA_CorporateClients.MemberId; } eC_OrderBasic.BuyerName = MyConvert.ConvertToString(Request["txtCompanyName"]).Trim(); //设计订单用反转的MemberId var originalGuid = CurrentUser.MemberId; Guid reversedGuid = new Guid(originalGuid.ToByteArray().Reverse().ToArray()); eC_OrderBasic.SellerId = reversedGuid; eC_OrderBasic.SellerName = CurrentUser.Name; eC_OrderBasic.OrderTypeId = 1;// 设置订单类型为新增订单(MeanValue为1的"EC_订单类型"为"新增订单") eC_OrderBasic.PayState = 0;//支付状态为未付款 eC_OrderExtend.BookNum = MyConvert.ConvertToString(Request["txtBookNumber"]).Trim(); eC_OrderExtend.BookPrice = MyConvert.ConvertToString(Request["txtBookPrice"]).Trim(); eC_OrderExtend.NumPerBag = MyConvert.ConvertToString(Request["txtNumberPerBag"]).Trim(); eC_OrderExtend.BagNum = MyConvert.ConvertToString(Request["txtBagNum"]).Trim(); eC_OrderExtend.Duiyinghetongbianhao = MyConvert.ConvertToString(Request["txtDuiyinghetongbianhao"]).Trim(); if (!eC_OrderBasic.Keyid.HasValue || 0 == eC_OrderBasic.Keyid.Value) { isWin = null != PayAbout.NewOrderSheji(eC_OrderBasic, eC_OrderExtend, _inquiryCommonModel); } else { isWin = false; } } return isWin; } /// /// 保存订单 /// private bool SaveOrderAsk() { bool isWin = false; EC_OrderBasicBLL bll_EC_OrderBasicBLL = new EC_OrderBasicBLL(); EC_OrderExtend eC_OrderExtend = new EC_OrderExtend();//订单扩展信息 EC_OrderBasic eC_OrderBasic = new EC_OrderBasic();//订单主要信息 EC_OrderPrintParameter orderPrintParameter = null; InquiryCommonModel _inquiryCommonModel = null; eC_OrderExtend.Keyid = MyConvert.ConvertToInt32(txtKeyid.Value); if (txtKeyid.Value == "0" || hidOrderTypeId.Value == "1") { eC_OrderBasic = bll_EC_OrderBasicBLL.SelectModelById(eC_OrderExtend.Keyid ?? 0); if (eC_OrderBasic == null || eC_OrderBasic.Keyid == null) { eC_OrderBasic = new EC_OrderBasic(); } eC_OrderExtend.Remark = MyConvert.ConvertToString(Request["txtRemark"]).Trim(); eC_OrderExtend.PrintPackDeliveryRequir = MyConvert.ConvertToString(Request["txtPrintPackDeliveryRequir"]).Trim(); eC_OrderExtend.Operate = CurrentUser.ShortName; eC_OrderExtend.ExigencyCaseId = MyConvert.ConvertToInt32(Request["selExigencyDegree"]); eC_OrderExtend.ProofreadWayId = MyConvert.ConvertToInt32(Request["selVerifyWay"]); eC_OrderExtend.BusinessManagerId = MyConvert.ConvertToInt32(Request["selBusinessManagers"]); eC_OrderExtend.CustomerManagerId = MyConvert.ConvertToInt32(Request["selCustormerManagers"]); eC_OrderExtend.CustomerLevelId = MyConvert.ConvertToInt32(Request["selCustormerLevel"]); eC_OrderExtend.Contacts = MyConvert.ConvertToString(Request["txtContact"]).Trim(); eC_OrderExtend.ContactPhone = MyConvert.ConvertToString(Request["txtPhone"]).Trim(); eC_OrderExtend.printunit= MyConvert.ConvertToInt32(Request["ysUnit"]).Value; eC_OrderBasic.Remark = eC_OrderExtend.Remark; eC_OrderBasic.DocumentName = MyConvert.ConvertToString(Request["txtDocumentName"]).Trim(); eC_OrderBasic.Operator = eC_OrderBasic.Creater = eC_OrderExtend.Operate; if (Request["txtUnitPrice"] != null && !string.IsNullOrEmpty(Request["txtUnitPrice"])) { eC_OrderBasic.UnitPrice = MyConvert.ConvertToDecimal(Request["txtUnitPrice"]); } eC_OrderBasic.SumPrice = MyConvert.ConvertToDecimal(Request["txtSumPrice"]); //eC_OrderExtend.SurplusPrintNum = MyConvert.ConvertToInt32(txtSurplusPrintNum.Value); if (Request["hidPrintTypeId"].ToString().ToInt32() == -1 || Request["hidPrintTypeId"].ToString().ToInt32() == 38 || Request["hidPrintTypeId"].ToString().ToInt32() == 39) { _inquiryCommonModel = new InquiryCommonModel(); _inquiryCommonModel.PrintTypeId = -1; _inquiryCommonModel.PrintCount = Request["printCount"].ToString().ToInt32().Value; _inquiryCommonModel.Unit = MyConvert.ConvertToInt32(Request["ysUnit"]).Value; if (Request["txtPrintDemand"].ToString().IndexOf(Request["printSizeName"].ToString()) >= 0) { _inquiryCommonModel.PrintDemand = Request["txtPrintDemand"].ToString(); } else { _inquiryCommonModel.PrintDemand = Request["printSizeName"].ToString() + ";" + Request["txtPrintDemand"].ToString(); } _inquiryCommonModel.PrintSizeName = Request["printSizeName"].ToString(); } else { _inquiryCommonModel = CY.WebForm.Pages.front.InquiryOnLine.GetInquiryCommonModel(); } if (null == _inquiryCommonModel) return false; if (_inquiryCommonModel.PrintTypeId == 13) { eC_OrderExtend.PrintNum = _inquiryCommonModel.PrintCount * _inquiryCommonModel.PrintBoxNumber; eC_OrderExtend.SurplusPrintNum = _inquiryCommonModel.PrintCount * _inquiryCommonModel.PrintBoxNumber; } else { eC_OrderExtend.PrintNum = _inquiryCommonModel.PrintCount; eC_OrderExtend.SurplusPrintNum = _inquiryCommonModel.PrintCount; } orderPrintParameter = new EC_OrderPrintParameter()//订单印刷参数 { PrintParameter = SerializationHelper.Serialize(_inquiryCommonModel) , OrderId = eC_OrderExtend.Keyid.HasValue ? eC_OrderExtend.Keyid.Value : 0 }; } eC_OrderBasic.DocumentName = MyConvert.ConvertToString(Request["txtDocumentName"]); eC_OrderBasic.DeliveryTime = MyConvert.ConvertToDateTime(Request["txtDeliveryTime"]); eC_OrderExtend.Duiyinghetongbianhao = MyConvert.ConvertToString(Request["txtDuiyinghetongbianhao"]).Trim(); ///是修改时只保存扩展信息 if (eC_OrderExtend.Keyid.HasValue && 0 < eC_OrderExtend.Keyid.Value) { EC_OrderBLL orderBLL = new EC_OrderBLL(); //eC_OrderExtend.CustomerManagerId = 0; //eC_OrderExtend.BusinessManagerId = 0; if (!string.IsNullOrEmpty(hidOrderTypeId.Value)) { eC_OrderBasic.OrderTypeId = hidOrderTypeId.Value.ToString().ToInt32().Value; } EC_AcceptWayByOrderBLL _AcceptWayByOrderBLL = new EC_AcceptWayByOrderBLL(); EC_AcceptWayByOrder acceptWayByOrder = _AcceptWayByOrderBLL.GetModelByTargetId(eC_OrderExtend.Keyid.Value); Sys_DictionaryBLL _bll_Sys_DictionaryBLL = new Sys_DictionaryBLL(); string ReceiptType = _bll_Sys_DictionaryBLL.GetModelByKeyid(Request["AcceptTypeId"].ToInt32()); acceptWayByOrder.AcceptTypeId = Request["AcceptTypeId"].ToInt32(); acceptWayByOrder.InvoiceDemand = Request["InvoiceId"].ToString2(); switch (ReceiptType) { case "自提": break; case "代发货运": acceptWayByOrder.City = Request["City_OnBehalfOfCargo"].ToString2(); acceptWayByOrder.Accepter = Request["Accepter_OnBehalfOfCargo"].ToString2(); acceptWayByOrder.AccepterPhone = Request["AccepterPhone_OnBehalfOfCargo"].ToString2(); break; case "送货上门": acceptWayByOrder.City = Request["City_HomeDelivery"].ToString2(); acceptWayByOrder.Accepter = Request["Accepter_HomeDelivery"].ToString2(); acceptWayByOrder.AccepterPhone = Request["AccepterPhone_HomeDelivery"].ToString2(); acceptWayByOrder.AccepterAddress = Request["AccepterAddress_HomeDelivery"].ToString(); break; case "指定货运公司": acceptWayByOrder.City = Request["City_OfficialFreightForwarder"].ToString2(); acceptWayByOrder.Accepter = Request["Accepter_OfficialFreightForwarder"].ToString2(); acceptWayByOrder.AccepterPhone = Request["AccepterPhone_OfficialFreightForwarder"].ToString2(); acceptWayByOrder.AppointCourierCompany = Request["AppointCourierCompany"].ToString2(); acceptWayByOrder.AccepterAddress = Request["AccepterAddress"].ToString2(); acceptWayByOrder.AccepterPhoneNum = Request["AccepterPhoneNum"].ToString2(); acceptWayByOrder.AcceptContacts = Request["AcceptContacts"].ToString2(); acceptWayByOrder.FetchAddress = Request["FetchAddress"].ToString2(); acceptWayByOrder.FetchPhoneNum = Request["FetchPhoneNum"].ToString2(); acceptWayByOrder.FetchContacts = Request["FetchContacts"].ToString2(); acceptWayByOrder.AppointCourierCompany = Request["AppointCourierCompany"].ToString2(); break; default: break; } eC_OrderBasic.AcceptWayByOrder = acceptWayByOrder; eC_OrderExtend.BookNum = MyConvert.ConvertToString(Request["txtBookNumber"]).Trim(); eC_OrderExtend.BookPrice = MyConvert.ConvertToString(Request["txtBookPrice"]).Trim(); eC_OrderExtend.NumPerBag = MyConvert.ConvertToString(Request["txtNumberPerBag"]).Trim(); eC_OrderExtend.BagNum = MyConvert.ConvertToString(Request["txtBagNum"]).Trim(); isWin = orderBLL.UpdateOrderInfo(eC_OrderBasic, eC_OrderExtend, orderPrintParameter); } else { eC_OrderBasic.PrintTypeId = MyConvert.ConvertToInt32(Request["selPrintTypes"]); eC_OrderBasic.DocumentName = MyConvert.ConvertToString(Request["txtDocumentName"]); eC_OrderBasic.DeliveryTime = MyConvert.ConvertToDateTime(Request["txtDeliveryTime"]); OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = new OA_CorporateClientsBLL(); OA_CorporateClients m_OA_CorporateClients = bll_OA_CorporateClientsBLL.GetModel(MyConvert.ConvertToGuid(Request["selCustormer"])); if (m_OA_CorporateClients == null) { eC_OrderBasic.BuyerId = MyConvert.ConvertToGuid(Request["selCustormer"]); } else { eC_OrderBasic.BuyerId = m_OA_CorporateClients.MemberId; } eC_OrderBasic.BuyerName = MyConvert.ConvertToString(Request["txtCompanyName"]).Trim(); //设计订单用反转的MemberId var originalGuid = CurrentUser.MemberId; Guid reversedGuid = new Guid(originalGuid.ToByteArray().Reverse().ToArray()); eC_OrderBasic.SellerId = reversedGuid; eC_OrderBasic.SellerName = CurrentUser.Name; eC_OrderBasic.OrderTypeId = 1;// 设置订单类型为新增订单(MeanValue为1的"EC_订单类型"为"新增订单") eC_OrderBasic.PayState = 0;//支付状态为未付款 eC_OrderExtend.BookNum = MyConvert.ConvertToString(Request["txtBookNumber"]).Trim(); eC_OrderExtend.BookPrice = MyConvert.ConvertToString(Request["txtBookPrice"]).Trim(); eC_OrderExtend.NumPerBag = MyConvert.ConvertToString(Request["txtNumberPerBag"]).Trim(); eC_OrderExtend.BagNum = MyConvert.ConvertToString(Request["txtBagNum"]).Trim(); if (!eC_OrderBasic.Keyid.HasValue || 0 == eC_OrderBasic.Keyid.Value) { isWin = null != PayAbout.NewOrder(eC_OrderBasic, eC_OrderExtend, _inquiryCommonModel); } else { isWin = false; } } //add by zyyao 订单为书刊的时候,保存客户的印刷要求 OA_CorporateClientsBLL _oA_CorporateClientsBLL = new OA_CorporateClientsBLL(); List oA_CorporateClientsPrints = _oA_CorporateClientsBLL.SelectPrintListByCorId(eC_OrderBasic.BuyerId).Where(x => x.DocumentName == eC_OrderBasic.DocumentName).ToList(); ; OA_CorporateClientsPrint a_CorporateClientsPrint = null; if (oA_CorporateClientsPrints != null && oA_CorporateClientsPrints.Count > 0) { a_CorporateClientsPrint = oA_CorporateClientsPrints[0]; a_CorporateClientsPrint.CorporateClientsid = eC_OrderBasic.BuyerId; a_CorporateClientsPrint.BusinessManagers = eC_OrderExtend.Contacts; a_CorporateClientsPrint.ManagersMobile = eC_OrderExtend.ContactPhone; a_CorporateClientsPrint.ManagersQQ = MyConvert.ConvertToString(Request["txtQQ"]).Trim(); //a_CorporateClientsPrint.Xinge = ""; a_CorporateClientsPrint.DocumentName = eC_OrderBasic.DocumentName; a_CorporateClientsPrint.UnitPrice = eC_OrderBasic.UnitPrice.HasValue ? eC_OrderBasic.UnitPrice.Value : 0; a_CorporateClientsPrint.SumPrice = eC_OrderBasic.SumPrice.HasValue ? eC_OrderBasic.SumPrice.Value : 0; a_CorporateClientsPrint.Deliveryrequirements = eC_OrderExtend.PrintPackDeliveryRequir; a_CorporateClientsPrint.Updater = CurrentUser.TrueMemberId; a_CorporateClientsPrint.LastUpdateTime = DateTime.Now; isWin = _oA_CorporateClientsBLL.UpdateModelPrint(a_CorporateClientsPrint); } else { a_CorporateClientsPrint = new OA_CorporateClientsPrint();//订单扩展信息 a_CorporateClientsPrint.CorporateClientsid = eC_OrderBasic.BuyerId; a_CorporateClientsPrint.BusinessManagers = eC_OrderExtend.Contacts; a_CorporateClientsPrint.ManagersMobile = eC_OrderExtend.ContactPhone; a_CorporateClientsPrint.ManagersQQ = MyConvert.ConvertToString(Request["txtQQ"]).Trim(); a_CorporateClientsPrint.Xinge = ""; a_CorporateClientsPrint.DocumentName = eC_OrderBasic.DocumentName; a_CorporateClientsPrint.UnitPrice = eC_OrderBasic.UnitPrice.HasValue ? eC_OrderBasic.UnitPrice.Value : 0; a_CorporateClientsPrint.SumPrice = eC_OrderBasic.SumPrice.HasValue ? eC_OrderBasic.SumPrice.Value : 0; a_CorporateClientsPrint.Deliveryrequirements = eC_OrderExtend.PrintPackDeliveryRequir; a_CorporateClientsPrint.Creater = CurrentUser.TrueMemberId; a_CorporateClientsPrint.CreateTime = DateTime.Now; a_CorporateClientsPrint.Updater = CurrentUser.TrueMemberId; a_CorporateClientsPrint.LastUpdateTime = DateTime.Now; isWin = _oA_CorporateClientsBLL.InsertModelPrint(a_CorporateClientsPrint); } OA_CorporateClientsParameter a_CorporateClientsParameter = null; a_CorporateClientsParameter = _oA_CorporateClientsBLL.GetModelParameter(a_CorporateClientsPrint.Keyid); if (string.IsNullOrEmpty(a_CorporateClientsParameter.PrintParameter)) { a_CorporateClientsParameter = new OA_CorporateClientsParameter()//订单印刷参数 { PrintParameter = SerializationHelper.Serialize(_inquiryCommonModel) , TargetId = a_CorporateClientsPrint.Keyid }; _oA_CorporateClientsBLL.InsertModelParameter(a_CorporateClientsParameter); } else { a_CorporateClientsParameter = new OA_CorporateClientsParameter()//订单印刷参数 { PrintParameter = SerializationHelper.Serialize(_inquiryCommonModel) , TargetId = a_CorporateClientsPrint.Keyid }; _oA_CorporateClientsBLL.UpdateModelParameter(a_CorporateClientsParameter); } return isWin; } /// /// 获取订单收货方式 /// /// /// internal static CY.Infrastructure.Domain.IAggregateRoot GetAcceptWay(CY.Infrastructure.Domain.IAggregateRoot writeTarget) { if (null == writeTarget) return writeTarget; HttpRequest Request = HttpContext.Current.Request; string receiptType = (new Sys_DictionaryBLL()).GetModelByKeyid(Request["AcceptTypeId"].ToInt32()); if (string.IsNullOrEmpty(receiptType)) return writeTarget; string theAwb = Request["txtTheAwb"]; writeTarget.Visiter("TheAwb", -1, true, string.IsNullOrEmpty(theAwb) ? "" : theAwb); writeTarget.Visiter("AcceptTypeId", -1, true, Request["AcceptTypeId"].ToInt32()); writeTarget.Visiter("InvoiceDemand", -1, true, Request["InvoiceId"].ToString2()); writeTarget.Visiter("Remark", -1, true, Request["Remark"].ToString2()); writeTarget.Visiter("LastUpdateTime", -1, true, DateTime.Now); writeTarget.Visiter("City", -1, true, ""); writeTarget.Visiter("Accepter", -1, true, ""); writeTarget.Visiter("AccepterPhone", -1, true, ""); writeTarget.Visiter("AppointCourierCompany", -1, true, ""); writeTarget.Visiter("AccepterAddress", -1, true, Request["AccepterAddress_HomeDelivery"].ToString2()); writeTarget.Visiter("AccepterPhoneNum", -1, true, ""); writeTarget.Visiter("AcceptContacts", -1, true, ""); writeTarget.Visiter("FetchAddress", -1, true, ""); writeTarget.Visiter("FetchPhoneNum", -1, true, ""); writeTarget.Visiter("FetchContacts", -1, true, ""); writeTarget.Visiter("AppointCourierCompany", -1, true, ""); writeTarget.Visiter("AppointCourierCompany", -1, true, Request["AppointCourierCompany"].ToString2()); writeTarget.Visiter("AccepterPhoneNum", -1, true, Request["AccepterPhoneNum"].ToString2()); writeTarget.Visiter("AcceptContacts", -1, true, Request["AcceptContacts"].ToString2()); writeTarget.Visiter("FetchAddress", -1, true, Request["FetchAddress"].ToString2()); writeTarget.Visiter("FetchPhoneNum", -1, true, Request["FetchPhoneNum"].ToString2()); writeTarget.Visiter("FetchContacts", -1, true, Request["FetchContacts"].ToString2()); writeTarget.Visiter("AppointCourierCompany", -1, true, Request["AppointCourierCompany"].ToString2()); switch (receiptType) { case "自提": case "代发货运": writeTarget.Visiter("City", -1, true, Request["City_OnBehalfOfCargo"].ToString2()); writeTarget.Visiter("Accepter", -1, true, Request["Accepter_OnBehalfOfCargo"].ToString2()); writeTarget.Visiter("AccepterPhone", -1, true, Request["AccepterPhone_OnBehalfOfCargo"].ToString2()); break; case "送货上门": writeTarget.Visiter("City", -1, true, Request["City_HomeDelivery"].ToString2()); writeTarget.Visiter("Accepter", -1, true, Request["Accepter_HomeDelivery"].ToString2()); writeTarget.Visiter("AccepterPhone", -1, true, Request["AccepterPhone_HomeDelivery"].ToString2()); break; case "指定货运公司": writeTarget.Visiter("City", -1, true, Request["City_OfficialFreightForwarder"].ToString2()); writeTarget.Visiter("Accepter", -1, true, Request["Accepter_OfficialFreightForwarder"].ToString2()); writeTarget.Visiter("AccepterPhone", -1, true, Request["AccepterPhone_OfficialFreightForwarder"].ToString2()); writeTarget.Visiter("AccepterAddress", -1, true, Request["AccepterAddress"].ToString2()); break; default: break; } return writeTarget; } /// /// 重新加载客户列表 /// /// private string ReLoadClients() { try { string res = ""; OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = new OA_CorporateClientsBLL(); IList m_OA_CorporateClientsList = bll_OA_CorporateClientsBLL.SelectListByFirmId(CurrentUser.MemberId) as IList; if (null != m_OA_CorporateClientsList) { m_OA_CorporateClientsList.Where(cc => CurrentUser.MemberId.Equals(cc.MemberId) && m_OA_CorporateClientsList.Remove(cc)); if (m_OA_CorporateClientsList.Count > 0) { foreach (var m_OA_CorporateClients in m_OA_CorporateClientsList) { res = res + (""); } } } return res; } catch (Exception ex) { PAGEHandleException(ex); return ""; } } private string shejileixing(string Shejileixing) { var ShejileixingName = ""; switch (Shejileixing) { case "1": ShejileixingName = "文字照排"; break; case "2": ShejileixingName = "整页表格"; break; case "3": ShejileixingName = "半文半表"; break; case "4": ShejileixingName = "扫描照做"; break; case "5": ShejileixingName = "文件修改"; break; case "6": ShejileixingName = "文字封面"; break; case "7": ShejileixingName = "设计封面"; break; case "8": ShejileixingName = "客供文件"; break; case "9": ShejileixingName = "彩色设计"; break; case "10": ShejileixingName = "设计制作"; break; case "11": ShejileixingName = "照排制作"; break; case "12": ShejileixingName = "设计照排"; break; default: ShejileixingName = ""; break; } return ShejileixingName; } } }