//选择加工单据 private void btnGetPronoteHeader_Click(object sender, EventArgs e) { Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderDetailsForm pronoForm = new Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderDetailsForm(null, 0); if (pronoForm.ShowDialog(this) == DialogResult.OK) { Model.PronoteHeader currentModel = pronoForm.SelectItem; if (currentModel != null) { this._PCOPC.PronoteHeaderId = currentModel.PronoteHeaderID; this._PCOPC.InvoiceCusXOId = currentModel.CustomerInvoiceXOId; this._PCOPC.Product = new BL.ProductManager().Get(currentModel.ProductId); this._PCOPC.ProductId = this._PCOPC.Product.ProductId; this._PCOPC.InvoiceXOQuantity = currentModel.InvoiceXODetailQuantity; this.Refresh(); } } pronoForm.Dispose(); GC.Collect(); }
//选择加工单据 private void btnGetPronoteHeader_Click(object sender, EventArgs e) { Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderDetailsForm pronoForm = new Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderDetailsForm(null, 0); if (pronoForm.ShowDialog(this) == DialogResult.OK) { Model.PronoteHeader currentModel = pronoForm.SelectItem; if (currentModel != null) { this._ansipcic.Invoice = currentModel.InvoiceXO; this._ansipcic.InvoiceId = currentModel.InvoiceXOId; this._ansipcic.PronoteHeaderId = currentModel.PronoteHeaderID; this._ansipcic.InvoiceCusXOId = currentModel.CustomerInvoiceXOId; this._ansipcic.Product = new BL.ProductManager().Get(currentModel.ProductId); this._ansipcic.ProductId = this._ansipcic.Product.ProductId; this._ansipcic.CheckStandard = currentModel.CustomerCheckStandard; this._ansipcic.InvoiceXOQuantity = currentModel.InvoiceXODetailQuantity; //this._ansipcic.ANSIPCImpactCheckCount = Convert.ToInt16(Math.Ceiling(Convert.ToDouble(currentModel.InvoiceXODetailQuantity) / 500)); this._ansipcic.ANSIPCImpactCheckCount = Common.AutoCalculation.Calculation(this.ForANSIOrJIS, Convert.ToInt32(currentModel.InvoiceXODetailQuantity)); this._ansipcic.UnitId = this._ansipcic.Product.QualityTestUnitId; this._ansipcic.Unit = this._ansipcic.Product.QualityTestUnit; //if (!string.IsNullOrEmpty(this._ansipcic.CheckStandard)) //{ // if (this.CJLD.Any(d => d.SettingDescription == this._ansipcic.CheckStandard)) // this.coBoxCJLD.EditValue = this.CJLD.First(d => d.SettingDescription == this._ansipcic.CheckStandard).SettingCurrentValue; // if (this.ZQZL.Any(d => d.SettingDescription == this._ansipcic.CheckStandard)) // this.coBoxZQZL.EditValue = this.ZQZL.FirstOrDefault(d => d.SettingDescription == this._ansipcic.CheckStandard).SettingCurrentValue; // if (this.LYBTXX.Any(d => d.SettingDescription == this._ansipcic.CheckStandard)) // this.coBoxLYBTXX.EditValue = this.LYBTXX.First(d => d.SettingDescription == this._ansipcic.CheckStandard).SettingCurrentValue; //} this.Refresh(); } } pronoForm.Dispose(); GC.Collect(); }
private void barPronoteHeader_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderDetailsForm pronoForm = new Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderDetailsForm(null, 0); if (pronoForm.ShowDialog(this) == DialogResult.OK) { Model.PronoteHeader currentModel = pronoForm.SelectItem; if (currentModel != null) { this.txt_PronoteHeaderId.Text = currentModel.PronoteHeaderID; //this.nccCustomer.EditValue = currentModel.InvoiceXO.Customer; Model.InvoiceXO xo = new BL.InvoiceXOManager().Get(currentModel.InvoiceXOId); if (xo != null) { this.nccCustomer.EditValue = xo.Customer; this.txt_InvoiceCusId.Text = xo.CustomerInvoiceXOId; } //this.txt_Model.Text = (currentModel.Product) == null ? "" : (currentModel.Product).CustomerProductName; Model.Product p = new BL.ProductManager().Get(currentModel.ProductId); if (p != null) { this.txt_Model.Text = p.CustomerProductName; } Model.PCSamplingEarDetail detail = new Book.Model.PCSamplingEarDetail(); detail.PCSamplingEarDetailId = Guid.NewGuid().ToString(); detail.PCSamplingEarDetailDate = DateTime.Now; detail.PCSamplingEarId = this._PCSamplingEar.PCSamplingEarId; detail.Product = p; detail.ProductId = currentModel.ProductId; this._PCSamplingEar.Details.Add(detail); this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(detail); this.gridControl1.RefreshDataSource(); } } pronoForm.Dispose(); GC.Collect(); }
//选择加工单据 private void btnGetPronoteHeader_Click(object sender, EventArgs e) { Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderDetailsForm pronoForm = new Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderDetailsForm(0, "Check"); if (pronoForm.ShowDialog(this) == DialogResult.OK) { Model.PronoteHeader currentModel = pronoForm.SelectItem; if (currentModel != null) { this._PCFC.PronoteHeader = currentModel; this._PCFC.PronoteHeaderID = currentModel.PronoteHeaderID; this._PCFC.InvoiceCusXOId = currentModel.CustomerInvoiceXOId; this._PCFC.Product = new BL.ProductManager().Get(currentModel.ProductId); this._PCFC.ProductId = this._PCFC.Product.ProductId; this._PCFC.CustomerProductName = currentModel.CustomerProductName; //客户型号 this._PCFC.PCFinishCheckInCoiunt = currentModel.InvoiceXODetailQuantity; //this._PCFC.PCFinishCheckCount = Math.Ceiling(Convert.ToDouble(this._PCFC.PCFinishCheckInCoiunt) / 500); this._PCFC.PCFinishCheckCount = Common.AutoCalculation.Calculation(currentModel.CustomerCheckStandard, Convert.ToInt32(this._PCFC.PCFinishCheckInCoiunt)); this._PCFC.ProductUnit = this._PCFC.Product.QualityTestUnit; this._PCFC.ProductUnitId = this._PCFC.Product.QualityTestUnitId; if (currentModel.InvoiceXOId != null) { Model.InvoiceXO xo = new BL.InvoiceXOManager().Get(currentModel.InvoiceXOId); if (xo != null) { this._PCFC.Pihao = xo.CustomerLotNumber; this._PCFC.PronoteHeader.InvoiceXO = xo; } } this.Refresh(); } } pronoForm.Dispose(); GC.Collect(); }
//选择加工单据 private void btnGetPronoteHeader_Click(object sender, EventArgs e) { Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderDetailsForm pronoForm = new Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderDetailsForm(0, "Check"); if (pronoForm.ShowDialog(this) == DialogResult.OK) { Model.PronoteHeader currentModel = pronoForm.SelectItem; if (currentModel != null) { this._PCFC.PronoteHeaderID = currentModel.PronoteHeaderID; this._PCFC.InvoiceCusXOId = currentModel.CustomerInvoiceXOId; this._PCFC.Product = new BL.ProductManager().Get(currentModel.ProductId); this._PCFC.ProductId = this._PCFC.Product.ProductId; this._PCFC.CustomerProductName = currentModel.CustomerProductName; //客户型号 this._PCFC.PCFinishCheckInCoiunt = currentModel.InvoiceXODetailQuantity; this._PCFC.ProductUnit = this._PCFC.Product.ProduceUnit; this._PCFC.ProductUnitId = this._PCFC.Product.ProduceUnitId; this.Refresh(); } } pronoForm.Dispose(); GC.Collect(); }
private void barPronoteHeader_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderDetailsForm pronoForm = new Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderDetailsForm(null, 0); if (pronoForm.ShowDialog(this) == DialogResult.OK) { if (pronoForm.SelectItems == null || pronoForm.SelectItems.Count == 0) { Model.PronoteHeader currentModel = pronoForm.SelectItem; if (currentModel != null) { this.txt_PronoteHeaderId.Text = currentModel.PronoteHeaderID; this._pCAssemblyInspection.PronoteHeader = currentModel; Model.InvoiceXO xo = new BL.InvoiceXOManager().Get(currentModel.InvoiceXOId); if (xo != null) { currentModel.InvoiceXO = xo; this.txt_InvoiceCusId.Text = xo.CustomerInvoiceXOId; } //this.txt_Model.Text = (currentModel.Product) == null ? "" : (currentModel.Product).CustomerProductName; Model.Product p = new BL.ProductManager().Get(currentModel.ProductId); Model.PCAssemblyInspectionDetail detail = new Book.Model.PCAssemblyInspectionDetail(); detail.PCAssemblyInspectionDetailId = Guid.NewGuid().ToString(); detail.PCAssemblyInspectionDetailDate = DateTime.Now; detail.PCAssemblyInspectionId = this._pCAssemblyInspection.PCAssemblyInspectionId; detail.Product = p; detail.ProductId = currentModel.ProductId; detail.CustomerId = xo == null ? null : xo.CustomerId; if (p.IsQiangHua == true) { detail.Jiagongbie = "強化"; } else if (p.IsFangWu == true) { detail.Jiagongbie = "防霧"; } else if (p.IsNoQiangFang == true) { detail.Jiagongbie = "無強化防霧"; } this._pCAssemblyInspection.Details.Add(detail); this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(detail); } } else { foreach (var item in pronoForm.SelectItems) { Model.Product p = new BL.ProductManager().Get(item.ProductId); Model.PCAssemblyInspectionDetail detail = new Book.Model.PCAssemblyInspectionDetail(); detail.PCAssemblyInspectionDetailId = Guid.NewGuid().ToString(); detail.PCAssemblyInspectionDetailDate = DateTime.Now; detail.PCAssemblyInspectionId = this._pCAssemblyInspection.PCAssemblyInspectionId; detail.Product = p; detail.ProductId = item.ProductId; //detail.CustomerId = xo == null ? null : xo.CustomerId; if (p.IsQiangHua == true) { detail.Jiagongbie = "強化"; } else if (p.IsFangWu == true) { detail.Jiagongbie = "防霧"; } else if (p.IsNoQiangFang == true) { detail.Jiagongbie = "無強化防霧"; } this._pCAssemblyInspection.Details.Add(detail); this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(detail); } } this.gridControl1.RefreshDataSource(); } pronoForm.Dispose(); GC.Collect(); }