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; using CY.Infrastructure.Query; using CY.WebForm.Pages.common; using CY.SQLDAL; namespace CY.WebForm.Pages.business { //吴辉 //后道外协 public partial class AgSealEdit : BasePage { EC_SpecialOrdersBLL bll_EC_SpecialOrdersBLL = null; OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = null; EC_OrderBLL bll_EC_OrderBLL = null; public Guid targetid = Guid.Empty; //初始化 public AgSealEdit() { bll_EC_SpecialOrdersBLL = new EC_SpecialOrdersBLL(); bll_OA_CorporateClientsBLL = new OA_CorporateClientsBLL(); bll_EC_OrderBLL = new EC_OrderBLL(); } //页面加载 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitData(); } } //加载合版施工单信息 private bool InitData() { targetid = CurrentUser.MemberId; #region 获取订单及其相关 EC_OrderBasicBLL _eC_OrderBasicBLL = new EC_OrderBasicBLL(); string orderIdStr = 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_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 this.spanOrderNum.InnerText = _eC_OrderBasic.SellerOrderId; this.spanOrderTitle.InnerText = _eC_OrderBasic.DocumentName; this.spanCustomName.InnerText = _eC_OrderBasic.BuyerName; this.spanPrintCount.InnerText = _eC_OrderBasic.OrderExtend.PrintNum.ToString2(); this.txtBookNumber.Value = _eC_OrderBasic.OrderExtend.BookNum.ToString2(); this.txtBookPrice.Value = _eC_OrderBasic.OrderExtend.BookPrice.ToString2(); this.txtNumberPerBag.Value = _eC_OrderBasic.OrderExtend.NumPerBag.ToString2(); this.txtBagNum.Value = _eC_OrderBasic.OrderExtend.BagNum.ToString2(); if (_eC_OrderBasic.PrintTypeId != 6) { this.trbook.Style.Add("display", "none"); } else { //this.trbook.Style.Add("display", "block"); } Pagination pa = new Pagination(); pa.PageSize = 500; pa.PageIndex = 1; return true; } //提交事件 protected void btn_Submit_form(object sender, EventArgs e) { try { if (SaveOrder()) JavaScript.RefreshDIVOpener(this); else JavaScript.MessageBox("操作失败", this); } catch (Exception ex) { PAGEHandleException(ex); JavaScript.MessageBox("操作失败", this); } } //保存订单 private bool SaveOrder() { EC_OrderBasicBLL _eC_OrderBasicBLL = new EC_OrderBasicBLL(); string orderIdStr = Request["orderid"]; if (string.IsNullOrEmpty(orderIdStr) || "0".Equals(orderIdStr)) return false; if (string.IsNullOrEmpty(orderIdStr)) { JavaScript.MessageBox("未传递参数!", this); return false; } int? orderid = MyConvert.ConvertToInt32(orderIdStr); if (!orderid.HasValue) { JavaScript.MessageBox("未传递参数!", this); return false; } EC_OrderBasic _eC_OrderBasic = _eC_OrderBasicBLL.SelectModelById(orderid.Value); EC_OrderExtend OrderExtend = _eC_OrderBasic.OrderExtend; OrderExtend.BookNum = txtBookNumber.Value; OrderExtend.BookPrice = txtBookPrice.Value; OrderExtend.NumPerBag = txtNumberPerBag.Value; OrderExtend.BagNum = txtBagNum.Value; return bll_EC_OrderBLL.OldUpdate(OrderExtend); } } }