private void btn_InvoiceCO_Click(object sender, EventArgs e) { Invoices.CG.CGForm f = new Book.UI.Invoices.CG.CGForm(); if (f.ShowDialog(this) == DialogResult.OK) { if (f.key.Count == 0) { return; } Model.InvoiceCODetail coDetail = f.key[0]; if (coDetail != null) { this._pcfog.PronoteHeaderId = coDetail.InvoiceId; this._pcfog.InvoiceCusXOId = coDetail.Invoice.InvoiceCustomXOId; this._pcfog.Product = new BL.ProductManager().Get(coDetail.ProductId); this._pcfog.ProductId = coDetail.ProductId; this._pcfog.mCheckStandard = (coDetail.Invoice.Customer == null ? "" : coDetail.Invoice.Customer.CheckedStandard); this._pcfog.InvoiceXOQuantity = coDetail.OrderQuantity; this._pcfog.ProductUnit = this._pcfog.Product.BuyUnit; this._pcfog.ProductUnitId = this._pcfog.Product.BuyUnitId; this.Refresh(); } } f.Dispose(); GC.Collect(); }
//采购单 private void btn_invoiceCO_Click(object sender, EventArgs e) { Invoices.CG.CGForm f = new Book.UI.Invoices.CG.CGForm(); if (f.ShowDialog(this) == DialogResult.OK) { //this._pcpgoc.Details.Clear(); foreach (var SelectModel in f.key) { if (SelectModel != null) { this._pcpgoc.PCPGOnlineCheckType = 0; Model.InvoiceXO xo = null; if (SelectModel.Invoice.InvoiceXOId != null) { xo = new BL.InvoiceXOManager().Get(SelectModel.Invoice.InvoiceXOId); this._pcpgoc.Customer = xo == null ? null : xo.xocustomer; this._pcpgoc.InvoiceCusXOId = xo == null ? "" : xo.CustomerInvoiceXOId; } this.txtInvoiceCusXOId.Text = this._pcpgoc.InvoiceCusXOId; //Detail Model.PCPGOnlineCheckDetail d = new Book.Model.PCPGOnlineCheckDetail(); d.PCPGOnlineCheckDetailId = Guid.NewGuid().ToString(); d.PCPGOnlineCheckId = this._pcpgoc.PCPGOnlineCheckId; if (SelectModel.Invoice.InvoiceXOId != null) { d.InvoiceCusXOId = xo == null ? "" : xo.CustomerInvoiceXOId; } d.PCPGOnlineCheckDetailDate = DateTime.Now; //d.PCPGOnlineCheckDetailTime = DateTime.Now; d.ProductId = SelectModel.ProductId; d.Product = SelectModel.Product; d.CheckQuantity = Convert.ToInt32(SelectModel.OrderQuantity); d.FromInvoiceId = SelectModel.InvoiceId; if (this._pcpgoc.Customer != null) { d.CheckedStandard = this._pcpgoc.Customer.CheckedStandard; } this._pcpgoc.Details.Add(d); } } this.gridControl1.RefreshDataSource(); } f.Dispose(); GC.Collect(); }
//选择采购单 private void btn_SelectCO_Click(object sender, EventArgs e) { Invoices.CG.CGForm form = new Book.UI.Invoices.CG.CGForm(); if (form.ShowDialog() == DialogResult.OK) { if (form.key.Count == 0) { return; } foreach (var item in form.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.Invoice.InvoiceXOId; detail.InvoiceCOId = item.InvoiceId; 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(); } form.Dispose(); GC.Collect(); }
//採購單 private void btn_InvoiceCO_Click(object sender, EventArgs e) { Invoices.CG.CGForm form = new Book.UI.Invoices.CG.CGForm(); if (form.ShowDialog() == DialogResult.OK) { if (this._PCIC.Details.Count > 0 && string.IsNullOrEmpty(this._PCIC.Details[0].ProductId)) { this._PCIC.Details.RemoveAt(0); } if (form.key != null && form.key.Count > 0) { this._PCIC.PCFromType = 2; //单据类型 //this._PCIC.Details.Clear(); Model.PCImpactCheckDetail detail; foreach (var item in form.key) { detail = new Book.Model.PCImpactCheckDetail(); detail.PCImpactCheckDetailId = Guid.NewGuid().ToString(); detail.PCImpactCheckId = this._PCIC.PCImpactCheckId; detail.attrDate = DateTime.Now; detail.PronoteHeaderId = item.InvoiceId; detail.Product = item.Product; detail.ProductId = item.ProductId; detail.ProductUnitId = item.InvoiceProductUnit; detail.InvoiceCusXOId = item.Invoice.InvoiceCustomXOId; if (item.Invoice.Customer != null) { detail.mCheckStandard = item.Invoice.Customer.CheckedStandard; } detail.InvoiceXOQuantity = item.OrderQuantity.HasValue ? item.OrderQuantity.Value : 0; this._PCIC.Details.Add(detail); } } } this.gridControl1.RefreshDataSource(); form.Dispose(); GC.Collect(); }
//選擇採購單 private void btn_SelectInvoiceCO_Click(object sender, EventArgs e) { Invoices.CG.CGForm form = new Book.UI.Invoices.CG.CGForm(); if (form.ShowDialog() == DialogResult.OK) { if (form.key != null && form.key.Count > 0) { //this._PCIC.Details.Clear(); Model.PCEarplugsResilienceCheckDetail detail; foreach (var item in form.key) { detail = new Book.Model.PCEarplugsResilienceCheckDetail(); detail.PCEarplugsResilienceCheckDetailId = Guid.NewGuid().ToString(); detail.Number = (this._pCEarplugsResilienceCheck.Details.Count + 1).ToString(); detail.FromId = item.InvoiceId; detail.Product = item.Product; detail.ProductId = item.ProductId; detail.ProductUnit = item.InvoiceProductUnit; if (!string.IsNullOrEmpty(item.Invoice.InvoiceXOId)) { detail.InvoiceXOId = item.Invoice.InvoiceXOId; } detail.InvoiceXOQuantity = item.OrderQuantity; Model.InvoiceXO xo = invoiceXOManager.Get(detail.InvoiceXOId); if (xo != null) { detail.InvoiceXO = xo; } this._pCEarplugsResilienceCheck.Details.Add(detail); } } } this.gridControl1.RefreshDataSource(); form.Dispose(); GC.Collect(); }
//採購單 private void btn_InvoiceCO_Click(object sender, EventArgs e) { Invoices.CG.CGForm form = new Book.UI.Invoices.CG.CGForm(); if (form.ShowDialog() == DialogResult.OK) { if (form.key.Count == 0) { return; } this._PCIC.PCFromType = 2; //单据类型 this._PCIC.PCImpactCheckDate = this.DE_PCImpactCheckDate.DateTime; this._PCIC.PronoteHeaderId = form.key[0].InvoiceId; this._PCIC.InvoiceCusXOId = form.key[0].Invoice.InvoiceCustomXOId; this._PCIC.Product = new BL.ProductManager().Get(form.key[0].ProductId); this._PCIC.ProductId = this._PCIC.Product.ProductId; this._PCIC.mCheckStandard = (form.key[0].Invoice.Customer == null ? "" : form.key[0].Invoice.Customer.CheckedStandard); this._PCIC.InvoiceXOQuantity = form.key[0].OrderQuantity; this.Refresh(); } form.Dispose(); GC.Collect(); }
private void btn_invoiceCO_Click(object sender, EventArgs e) { Invoices.CG.CGForm f = new Book.UI.Invoices.CG.CGForm(); if (f.ShowDialog(this) == DialogResult.OK) { if (f.key.Count == 0) { return; } this._pcpgoc.Details.Clear(); this._pcpgoc.PCPGOnlineCheckType = 2; this.layoutDanJuBianHao.Text = "采购单编号:"; this._pcpgoc.FromPCId = f.key[0].InvoiceId; this._pcpgoc.Customer = f.key[0].Invoice.Customer; this._pcpgoc.CustomerId = f.key[0].Invoice.CustomerId; this._pcpgoc.InvoiceCusXOId = f.key[0].Invoice.InvoiceCustomXOId; this._pcpgoc.Product = f.key[0].Product; this._pcpgoc.ProductId = f.key[0].ProductId; this._pcpgoc.InvoiceXOQuantity = f.key[0].OrderQuantity; this._pcpgoc.InvoiceXOId = f.key[0].Invoice.InvoiceXOId; if (!string.IsNullOrEmpty(f.key[0].Invoice.InvoiceXOId)) { Model.InvoiceXO xo = new BL.InvoiceXOManager().Get(f.key[0].Invoice.InvoiceXOId); this.txtInvoiceCusXOId.Text = xo == null ? "" : xo.CustomerInvoiceXOId; } this.nccCHCustomer.EditValue = this._pcpgoc.Customer; this.txtDatnJuBianHao.Text = this._pcpgoc.FromPCId; this.txtCheckStandard.Text = this._pcpgoc.Customer == null ? "" : this._pcpgoc.Customer.CheckedStandard; this.txtProductName.Text = this._pcpgoc.Product == null ? "" : this._pcpgoc.Product.ToString(); this.calcInvoiceXOQuantity.EditValue = this._pcpgoc.InvoiceXOQuantity; this.txtProductDescription.Rtf = this._pcpgoc.Product == null ? "" : this._pcpgoc.Product.ProductDescription; foreach (var SelectModel in f.key) { if (SelectModel != null) { //Detail Model.PCPGOnlineCheckDetail d = new Book.Model.PCPGOnlineCheckDetail(); d.PCPGOnlineCheckDetailId = Guid.NewGuid().ToString(); d.PCPGOnlineCheckId = this._pcpgoc.PCPGOnlineCheckId; d.PCPGOnlineCheckDetailDate = DateTime.Now; d.PCPGOnlineCheckDetailTime = DateTime.Now; //d.PCPGOnlineCheckDetailTime = DateTime.Now; //d.ProductId = SelectModel.ProductId; //d.Product = SelectModel.Product; d.CheckQuantity = Convert.ToInt32(SelectModel.OrderQuantity); d.FromInvoiceId = SelectModel.InvoiceId; //if (this._pcpgoc.Customer != null) // d.CheckedStandard = this._pcpgoc.Customer.CheckedStandard; this._pcpgoc.Details.Add(d); } } this.gridControl1.RefreshDataSource(); } f.Dispose(); GC.Collect(); }
//private void AddDataRows() //{ // Model.PCOtherCheckDetail pcocDetail = new Book.Model.PCOtherCheckDetail(); // pcocDetail.PCOtherCheckDetailId = Guid.NewGuid().ToString(); // pcocDetail.PCOtherCheckId = this._PCOtherCheck.PCOtherCheckId; // this._PCOtherCheck.Detail.Add(pcocDetail); // this.bindingSourceDetails.Position = this.bindingSourceDetails.IndexOf(pcocDetail); //} #endregion //选择采购单据 2016-1-6 将数据来源从采购入库单改为采购单 private void btnSelectCaiGou_Click(object sender, EventArgs e) { #region 原版 采购入库单 //Book.UI.Invoices.CG.SearchCGDetail cgform = new Book.UI.Invoices.CG.SearchCGDetail(); //if (cgform.ShowDialog() == DialogResult.OK) //{ // if (cgform.selectItems.Count > 0) // { // BL.InvoiceCOManager mCOM = new Book.BL.InvoiceCOManager(); // //Model.InvoiceCO co = cgform.Invoice; // //清空数据 // if (this._PCOtherCheck.FromPCType < 0) // { // this._PCOtherCheck.Detail.Clear(); // } // this._PCOtherCheck.FromPCType = 1; // this.Ncc_Supplier.EditValue = cgform.selectItems[0].Invoice == null ? null : cgform.selectItems[0].Invoice.Supplier;//厂商 // Model.InvoiceCO co = new Book.Model.InvoiceCO(); // foreach (Model.InvoiceCGDetail item in cgform.selectItems) // { // Model.PCOtherCheckDetail detail = new Model.PCOtherCheckDetail(); //详细 // detail.PCOtherCheckDetailId = Guid.NewGuid().ToString(); //详细本身编号 // detail.PCOtherCheckId = this._PCOtherCheck.PCOtherCheckId; //头编号 // detail.FromInvoiceDetailID = item.InvoiceCGDetailId; //来源详细本身编号 // detail.FromInvoiceID = item.InvoiceId; //来源详细头编号 // detail.ProceduresId = null; //工序编号 // detail.Procedures = null; //加工 // detail.ProductId = item.ProductId; //商品编号 // detail.Product = item.Product; //品名 // detail.PCOtherCheckDetailDesc = item.Product == null ? "" : item.Product.ProductDescription;//说明 // detail.PCOtherCheckDetailQuantity = 0; //数量 // detail.ProductUnit = detail.Product.ProduceUnit == null ? null : detail.Product.ProduceUnit.CnName; //单位 // co = mCOM.Get(item.InvoiceCOId); // if (co == null) // { // detail.PerspectiveRate = ""; // detail.DeliveryDate = null; // } // else // { // try // { // detail.PerspectiveRate = co.Customer == null ? "" : mCOM.Get(cgform.selectItems[0].InvoiceCOId).Customer.CheckedStandard;//透视率 // } // catch // { // detail.PerspectiveRate = ""; // } // detail.DeliveryDate = co.InvoiceYjrq;//交期 // } // detail.InQuantity = item.InvoiceCGDetailQuantity; //进厂数量 // detail.OutQuantity = 0; //出厂数量 // detail.Determinant = ""; //判定 // detail.PCOtherCheckDetailFromPC = "1"; //来源于 采购入库订单 // //客户订单编号 // detail.InvoiceCusXOId = co == null ? "" : co.InvoiceCustomXOId; // this._PCOtherCheck.Detail.Add(detail); // } // this.gridControl1.RefreshDataSource(); // } //} //cgform.Dispose(); //GC.Collect(); #endregion Invoices.CG.CGForm f = new Book.UI.Invoices.CG.CGForm(); 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.InvoiceCO co = f.key[0].Invoice; this.Ncc_Supplier.EditValue = co == null ? null : co.Supplier; foreach (var item in f.key) { Model.PCOtherCheckDetail detail = new Model.PCOtherCheckDetail(); detail.PCOtherCheckDetailId = Guid.NewGuid().ToString(); detail.PCOtherCheckId = this._PCOtherCheck.PCOtherCheckId; detail.FromInvoiceDetailID = item.InvoiceCODetailId; detail.FromInvoiceID = item.InvoiceId; detail.ProceduresId = null; detail.Procedures = null; detail.ProductId = item.ProductId; detail.Product = item.Product; if (item.Product != null) { detail.PCOtherCheckDetailDesc = item.Product == null ? "" : item.Product.ProductDescription; detail.ProductUnit = item.Product.ProduceUnit == null ? null : item.Product.ProduceUnit.CnName; } detail.PCOtherCheckDetailQuantity = 0; //数量以后改为合格数量,进场数量即为检验数量 detail.InQuantity = item.OrderQuantity - Convert.ToDouble(item.HasCheckQuantity); detail.InQuantity = detail.InQuantity < 0 ? 0 : detail.InQuantity; detail.OutQuantity = 0; detail.Determinant = ""; detail.PCOtherCheckDetailFromPC = "1"; if (co != null) { try { detail.PerspectiveRate = co.Customer == null ? "" : co.Customer.CheckedStandard;//透视率 } catch { detail.PerspectiveRate = ""; } detail.DeliveryDate = co.InvoiceYjrq;//交期 detail.InvoiceCusXOId = co.InvoiceCustomXOId; } else { detail.PerspectiveRate = ""; detail.DeliveryDate = null; detail.InvoiceCusXOId = ""; } this._PCOtherCheck.Detail.Add(detail); } this.gridControl1.RefreshDataSource(); } } f.Dispose(); GC.Collect(); }