//選取委外合同 private void btn_SelectProduceOther_Click(object sender, EventArgs e) { ProduceOtherCompact.ChooseOutContract f = new Book.UI.produceManager.ProduceOtherCompact.ChooseOutContract(); if (f.ShowDialog(this) == DialogResult.OK) { foreach (var item in f.key) { Model.PCFlameRetardantDetail detail = new Book.Model.PCFlameRetardantDetail(); detail.PCFlameRetardantDetailId = Guid.NewGuid().ToString(); detail.Number = this._pCFlameRetardant.Details.Count + 1; detail.Product = item.Product; detail.ProductId = item.ProductId; detail.EmployeeId = BL.V.ActiveOperator.EmployeeId; detail.InvoiceXOId = item.ProduceOtherCompact.InvoiceXOId; detail.ProduceOtherCompactId = item.ProduceOtherCompactId; if (string.IsNullOrEmpty(this.Pihao)) { Model.InvoiceXO xo = invoiceXOManager.Get(detail.InvoiceXOId); if (xo != null) { detail.Pihao = xo.CustomerLotNumber; } } else { detail.Pihao = this.Pihao; } this._pCFlameRetardant.Details.Add(detail); } this.gridControl1.RefreshDataSource(); } }
private void btn_ProduceOtherCompact_Click(object sender, EventArgs e) { #region 取客户订单(弃用2013年5月17日11:40:06 CN) //createProduce.EditForm f = new Book.UI.produceManager.createProduce.EditForm(); //if (f.ShowDialog(this) == DialogResult.OK) //{ // if (f.SelectList != null && f.SelectList.Count > 0) // { // Model.InvoiceXODetail model = f.SelectList[0]; // this._pcBoxFootCheck.ProductId = model.ProductId; // this.txt_Product.EditValue = model.Product == null ? null : model.Product.ToString(); // this._pcBoxFootCheck.InvoiceXOId = model.InvoiceId; // this.txt_InvoiceXO.EditValue = model.InvoiceId; // this.spinEditGetNum.EditValue = model.InvoiceXODetailQuantity; // } //} #endregion #region 取委外合同 2013年5月17日11:40:23 CN ProduceOtherCompact.ChooseOutContract f = new Book.UI.produceManager.ProduceOtherCompact.ChooseOutContract(); if (f.ShowDialog(this) == DialogResult.OK) { Model.ProduceOtherCompact currentModel = f.SelectItem as Model.ProduceOtherCompact; if (currentModel != null) { this._pcBoxFootCheck.PronoteHeaderId = currentModel.PronoteHeaderId; //加工单据编号 this._pcBoxFootCheck.InvoiceXOId = currentModel.InvoiceXOId; //客户订单编号 this._pcBoxFootCheck.InvoiceXO = currentModel.InvoiceXO; if (currentModel.InvoiceXO != null) { this._pcBoxFootCheck.Customer = currentModel.InvoiceXO.Customer; this._pcBoxFootCheck.CheckStandard = currentModel.InvoiceXO.xocustomer.CheckedStandard; this.txt_InvoiceXO.EditValue = currentModel.InvoiceXO.CustomerInvoiceXOId; } Model.ProduceOtherCompactDetail pocd = new Book.BL.ProduceOtherCompactDetailManager().Select(currentModel)[0]; if (pocd != null) { //if (this._pcBoxFootCheck.Product != null) //{ this._pcBoxFootCheck.Product = pocd.Product; this._pcBoxFootCheck.ProductId = this._pcBoxFootCheck.Product.ProductId; //} if (pocd.ProduceOtherCompact != null) { this._pcBoxFootCheck.PronoteHeaderId = pocd.ProduceOtherCompact.PronoteHeaderId; } this._pcBoxFootCheck.GetNum = pocd.OtherCompactCount; } this.Refresh(); } } #endregion }
//选择委外单据 private void btnGetOtherPacmt_Click(object sender, EventArgs e) { ProduceOtherCompact.ChooseOutContract f = new Book.UI.produceManager.ProduceOtherCompact.ChooseOutContract(); if (f.ShowDialog(this) == DialogResult.OK) { Model.ProduceOtherCompact currentModel = f.SelectItem as Model.ProduceOtherCompact; if (currentModel != null) { this._PCIC.WorkHouse = (this.nccWorkHouse.EditValue as Model.WorkHouse); if (this._PCIC.WorkHouse != null) { this._PCIC.WorkHouseId = this._PCIC.WorkHouse.WorkHouseId; } this._PCIC.PCImpactCheckDate = this.DE_PCImpactCheckDate.DateTime; this._PCIC.PronoteHeaderId = currentModel.PronoteHeaderId; //加工单据编号 this._PCIC.InvoiceCusXOId = currentModel.CustomerInvoiceXOId; //客户订单编号 this._PCIC.mCheckStandard = currentModel.Customer.CheckedStandard; //质检标准 //if (!string.IsNullOrEmpty(currentModel.MRSHeaderId)) //客户订单编号 //{ // Model.MRSHeader mrsHeader = new BL.MRSHeaderManager().Get(currentModel.MRSHeaderId); // if (mrsHeader != null) // { // Model.MPSheader mPSheader = new BL.MPSheaderManager().Get(mrsHeader.MPSheaderId); // if (mPSheader != null) // { // Model.InvoiceXO invoiceXo = new BL.InvoiceXOManager().Get(mPSheader.InvoiceXOId); // this._PCIC.InvoiceCusXOId = invoiceXo == null ? string.Empty : invoiceXo.CustomerInvoiceXOId; // } // } //} if (this.OtherCompactDetailManager.Select(currentModel)[0] != null) { this._PCIC.Product = this.OtherCompactDetailManager.Select(currentModel)[0].Product; this._PCIC.ProductId = this.OtherCompactDetailManager.Select(currentModel)[0].ProductId; this._PCIC.PronoteHeaderId = currentModel.ProduceOtherCompactId; this._PCIC.PCFromType = 1; //单据类型 this._PCIC.ProductUnit = this._PCIC.Product.ProduceUnit; this._PCIC.ProductUnitId = this._PCIC.Product.ProduceUnitId; } this.Refresh(); } } f.Dispose(); GC.Collect(); }
private void simpleButtonXO_Click(object sender, EventArgs e) { _produceOtherCompactDetail.Clear(); ProduceOtherCompact.ChooseOutContract f = new Book.UI.produceManager.ProduceOtherCompact.ChooseOutContract(); if (f.ShowDialog(this) != DialogResult.OK) { return; } if (_produceOtherCompactDetail.Count != 0) { this._produceOtherMaterial.Details.Clear(); if (_produceOtherCompactDetail != null) { foreach (Model.ProduceOtherCompactDetail ProduceOtherCompactDetail in _produceOtherCompactDetail) { Model.ProduceOtherMaterialDetail produceOtherMaterialDetail = new Book.Model.ProduceOtherMaterialDetail(); produceOtherMaterialDetail.ProduceOtherMaterialDetailId = Guid.NewGuid().ToString(); if (ProduceOtherCompactDetail.Product != null) { produceOtherMaterialDetail.Product = ProduceOtherCompactDetail.Product; produceOtherMaterialDetail.ProductId = ProduceOtherCompactDetail.Product.ProductId; produceOtherMaterialDetail.ProductStock = ProduceOtherCompactDetail.Product.StocksQuantity; if (ProduceOtherCompactDetail.Product.MainUnit != null) { produceOtherMaterialDetail.ProductUnit = ProduceOtherCompactDetail.Product.MainUnit.CnName; } produceOtherMaterialDetail.ProductSpecification = ProduceOtherCompactDetail.Product.ProductSpecification; } produceOtherMaterialDetail.MPSheaderId = ProduceOtherCompactDetail.MPSheaderId; produceOtherMaterialDetail.OtherMaterialQuantity = ProduceOtherCompactDetail.OtherCompactCount; produceOtherMaterialDetail.OtherMaterialALLUserQuantity = ProduceOtherCompactDetail.OtherCompactCount; produceOtherMaterialDetail.ProduceOtherMaterial = this._produceOtherMaterial; produceOtherMaterialDetail.ProduceOtherMaterialId = this._produceOtherMaterial.ProduceOtherMaterialId; produceOtherMaterialDetail.InvoiceXOId = ProduceOtherCompactDetail.InvoiceXOId; produceOtherMaterialDetail.InvoiceXODetailId = ProduceOtherCompactDetail.InvoiceXODetailId; this._produceOtherMaterial.Details.Add(produceOtherMaterialDetail); } } this.gridControl1.RefreshDataSource(); } }
//委外加工單 private void btn_SelectOtherCompact_Click(object sender, EventArgs e) { ProduceOtherCompact.ChooseOutContract f = new Book.UI.produceManager.ProduceOtherCompact.ChooseOutContract(); if (f.ShowDialog(this) == DialogResult.OK) { if (f.key != null) { foreach (var item in f.key) { Model.PCEarplugsStayWireCheckDetail detail = new Book.Model.PCEarplugsStayWireCheckDetail(); detail.PCEarplugsStayWireCheckDetailId = Guid.NewGuid().ToString(); detail.Number = (this._pCEarplugsStayWireCheck.Details.Count + 1).ToString(); detail.FromId = item.ProduceOtherCompactId; detail.Product = item.Product; detail.ProductId = item.ProductId; detail.ProductUnit = item.ProductUnit; if (!string.IsNullOrEmpty(item.ProduceOtherCompactId)) { Model.ProduceOtherCompact model = new BL.ProduceOtherCompactManager().Get(item.ProduceOtherCompactId); if (model != null) { detail.InvoiceXOId = model.InvoiceXOId; } } detail.InvoiceXOQuantity = item.OtherCompactCount.HasValue ? item.OtherCompactCount.Value : 0; Model.InvoiceXO xo = invoiceXOManager.Get(detail.InvoiceXOId); if (xo != null) { detail.InvoiceXO = xo; } this._pCEarplugsStayWireCheck.Details.Add(detail); } this.gridControl1.RefreshDataSource(); } f.Dispose(); GC.Collect(); } }
//选择委外入库单据 2016-1-6 将数据来源从委外入库单改为委外加工单 private void btnSelectWeiWai_Click(object sender, EventArgs e) { #region 原版委外入库单 //ProduceOtherInDepot.ChooseProduceOtherInDepotForPCO f = new Book.UI.produceManager.ProduceOtherInDepot.ChooseProduceOtherInDepotForPCO(); //if (f.ShowDialog(this) != DialogResult.OK) return; //if (f.SelectItems.Count > 0) //{ // //清空数据 // if (this._PCOtherCheck.FromPCType > 0) // { // this._PCOtherCheck.Detail.Clear(); // } // this._PCOtherCheck.FromPCType = -1; // //this.lcDanJuId.Text = "委外入库單編號:"; // //this.textInvoiceCusXOId.Text = f.SelectItems[0].ProduceOtherInDepot == null ? "" : f.SelectItems[0].ProduceOtherInDepot.InvoiceCusId; // #region 对控件进行赋值 // //if (!string.IsNullOrEmpty(OtherCompact.MRSHeaderId)) //客户订单编号 // //{ // // Model.MRSHeader mrsHeader = new BL.MRSHeaderManager().Get(OtherCompact.MRSHeaderId); // // if (mrsHeader != null) // // { // // Model.MPSheader mPSheader = new BL.MPSheaderManager().Get(mrsHeader.MPSheaderId); // // if (mPSheader != null) // // { // // Model.InvoiceXO invoiceXo = new BL.InvoiceXOManager().Get(mPSheader.InvoiceXOId); // // this.textInvoiceCusXOId.Text = invoiceXo == null ? string.Empty : invoiceXo.CustomerInvoiceXOId; // // } // // } // //} // #endregion // this.Ncc_Supplier.EditValue = f.SelectItems[0].ProduceOtherInDepot.Supplier; //厂商 // foreach (Model.ProduceOtherInDepotDetail item in f.SelectItems) // { // Model.PCOtherCheckDetail detail = new Model.PCOtherCheckDetail(); //详细 // detail.PCOtherCheckDetailId = Guid.NewGuid().ToString(); //详细本身编号 // detail.PCOtherCheckId = this._PCOtherCheck.PCOtherCheckId; //头编号 // detail.FromInvoiceDetailID = item.ProduceOtherInDepotDetailId; //来源详细本身编号 // detail.FromInvoiceID = item.ProduceOtherInDepotId; //来源详细头编号 // //detail.ProceduresId = item.ProceduresId; //工序编号 // //detail.Procedures = item.Procedures; //加工 // detail.ProductId = item.ProductId; //商品编号 // detail.Product = item.Product; //品名 // detail.PCOtherCheckDetailDesc = item.Product.ProductDescription; //说明 // detail.PCOtherCheckDetailQuantity = 0; //数量 // detail.ProductUnit = detail.Product.ProduceUnit == null ? null : detail.Product.ProduceUnit.CnName; //单位 // detail.PerspectiveRate = item.Customer == null ? "" : item.Customer.CheckedStandard;//透视率 // detail.DeliveryDate = this.OtherCompactDetailManager.Get(item.ProduceOtherCompactDetailId) == null ? null : this.OtherCompactDetailManager.Get(item.ProduceOtherCompactDetailId).JiaoQi;//交期 // detail.InQuantity = item.ProduceQuantity; //进厂数量 // detail.OutQuantity = 0; //出厂数量 // detail.Determinant = ""; //判定 // detail.PCOtherCheckDetailFromPC = "0"; //来源于 委外入库单 // //客户订单编号 // detail.InvoiceCusXOId = item.InvoiceCusId; // this._PCOtherCheck.Detail.Add(detail); // } // this.gridControl1.RefreshDataSource(); //} //f.Dispose(); //GC.Collect(); #endregion ProduceOtherCompact.ChooseOutContract f = new Book.UI.produceManager.ProduceOtherCompact.ChooseOutContract(); if (f.ShowDialog(this) == DialogResult.OK) { if (f.key != null && f.key.Count > 0) { //清空数据 if (this._PCOtherCheck.FromPCType > 0) { this._PCOtherCheck.Detail.Clear(); } this._PCOtherCheck.FromPCType = -1; Model.ProduceOtherCompact poc = f.key[0].ProduceOtherCompact; this.Ncc_Supplier.EditValue = poc == null ? null : poc.Supplier; foreach (var item in f.key) { Model.PCOtherCheckDetail detail = new Book.Model.PCOtherCheckDetail(); detail.PCOtherCheckDetailId = Guid.NewGuid().ToString(); detail.PCOtherCheckId = this._PCOtherCheck.PCOtherCheckId; detail.FromInvoiceDetailID = item.OtherCompactDetailId; detail.FromInvoiceID = item.ProduceOtherCompactId; detail.ProductId = item.ProductId; detail.Product = item.Product; detail.PCOtherCheckDetailDesc = item.Product.ProductDescription; detail.ProductUnit = detail.Product.ProduceUnit == null ? null : detail.Product.ProduceUnit.CnName; if (poc != null) { detail.PerspectiveRate = poc.Customer == null ? "" : poc.Customer.CheckedStandard; } detail.PCOtherCheckDetailQuantity = 0; detail.DeliveryDate = item.JiaoQi; detail.InQuantity = item.OtherCompactCount - Convert.ToDouble(item.HasCheckQuantity); detail.InQuantity = detail.InQuantity < 0 ? 0 : detail.InQuantity; detail.OutQuantity = 0; detail.Determinant = ""; detail.PCOtherCheckDetailFromPC = "0"; detail.InvoiceCusXOId = item.InvoiceCusId; this._PCOtherCheck.Detail.Add(detail); } this.gridControl1.RefreshDataSource(); } f.Dispose(); GC.Collect(); } }
//选择委外单据 private void btnGetOtherPacmt_Click(object sender, EventArgs e) { ProduceOtherCompact.ChooseOutContract f = new Book.UI.produceManager.ProduceOtherCompact.ChooseOutContract(); if (f.ShowDialog(this) == DialogResult.OK) { this._PCIC.PCFromType = 1; //单据类型 //this._PCIC.Details.Clear(); //Model.ProduceOtherCompact currentModel = f.SelectItem as Model.ProduceOtherCompact; //if (currentModel != null) //{ // this._PCIC.PronoteHeaderId = currentModel.PronoteHeaderId; //加工单据编号 // this._PCIC.InvoiceCusXOId = currentModel.CustomerInvoiceXOId; //客户订单编号 // this._PCIC.mCheckStandard = currentModel.Customer.CheckedStandard; //质检标准 // //if (!string.IsNullOrEmpty(currentModel.MRSHeaderId)) //客户订单编号 // //{ // // Model.MRSHeader mrsHeader = new BL.MRSHeaderManager().Get(currentModel.MRSHeaderId); // // if (mrsHeader != null) // // { // // Model.MPSheader mPSheader = new BL.MPSheaderManager().Get(mrsHeader.MPSheaderId); // // if (mPSheader != null) // // { // // Model.InvoiceXO invoiceXo = new BL.InvoiceXOManager().Get(mPSheader.InvoiceXOId); // // this._PCIC.InvoiceCusXOId = invoiceXo == null ? string.Empty : invoiceXo.CustomerInvoiceXOId; // // } // // } // //} // //if (this.OtherCompactDetailManager.Select(currentModel)[0] != null) // //{ // // this._PCIC.Product = this.OtherCompactDetailManager.Select(currentModel)[0].Product; // // this._PCIC.ProductId = this.OtherCompactDetailManager.Select(currentModel)[0].ProductId; // // this._PCIC.PronoteHeaderId = currentModel.ProduceOtherCompactId; // // this._PCIC.PCFromType = 1; //单据类型 // //} if (this._PCIC.Details.Count > 0 && string.IsNullOrEmpty(this._PCIC.Details[0].ProductId)) { this._PCIC.Details.RemoveAt(0); } Model.PCImpactCheckDetail detail; foreach (var item in f.key) { detail = new Book.Model.PCImpactCheckDetail(); detail.PCImpactCheckDetailId = Guid.NewGuid().ToString(); detail.PCImpactCheckId = this._PCIC.PCImpactCheckId; detail.attrDate = DateTime.Now; detail.PronoteHeaderId = item.ProduceOtherCompactId; //if (this.OtherCompactDetailManager.Select(currentModel)[0] != null) //{ // detail.Product = this.OtherCompactDetailManager.Select(currentModel)[0].Product; // detail.ProductId = this.OtherCompactDetailManager.Select(currentModel)[0].ProductId; // detail.ProductUnitId = this.OtherCompactDetailManager.Select(currentModel)[0].ProductUnit; //} detail.Product = item.Product; detail.ProductId = item.ProductId; detail.ProductUnitId = item.ProductUnit; detail.InvoiceCusXOId = item.ProduceOtherCompact.CustomerInvoiceXOId; detail.mCheckStandard = item.ProduceOtherCompact.Customer == null ? null : item.ProduceOtherCompact.Customer.CheckedStandard; detail.InvoiceXOQuantity = item.OtherCompactCount.HasValue ? item.OtherCompactCount.Value : 0; this._PCIC.Details.Add(detail); } //} //this.Refresh(); this.gridControl1.RefreshDataSource(); } f.Dispose(); GC.Collect(); }