private void btn_ProduceOtherInDepot_Click(object sender, EventArgs e) { Book.UI.produceManager.ProduceOtherInDepot.ChooseProduceOtherInDepotForPCO f = new Book.UI.produceManager.ProduceOtherInDepot.ChooseProduceOtherInDepotForPCO(); if (f.ShowDialog(this) == DialogResult.OK) { if (f.SelectItems.Count != 0) { foreach (Model.ProduceOtherInDepotDetail item in f.SelectItems) { Model.AcInvoiceCOBillDetail detail = new Book.Model.AcInvoiceCOBillDetail(); detail.AcInvoiceCOBillDetailId = Guid.NewGuid().ToString(); detail.InvoiceCGDetailId = item.ProduceOtherInDepotDetailId; detail.ProductId = item.ProductId; detail.Product = item.Product; //detail.Invoice = item.Invoice; detail.InvoiceId = item.ProduceOtherInDepotId; detail.AcInvoiceCOBillId = this._acInvoiceCoBill.AcInvoiceCOBillId; //detail.InvoiceAllowance = decimal.Parse((item.InvoiceAllowance == null ? 0 : item.InvoiceAllowance.Value).ToString()); detail.InvoiceCGDetaiInQuantity = item.ProduceInDepotQuantity == null ? 0 : item.ProduceInDepotQuantity.Value; detail.InvoiceCGDetailPrice = item.ProducePrice == null ? 0 : item.ProducePrice.Value; // detail.InvoiceCGDetailMoney = item.InvoiceCGDetailMoney == null ? 0 : item.InvoiceCGDetailMoney.Value; detail.InvoiceCGDetailMoney = global::Helper.DateTimeParse.GetSiSheWuRu(decimal.Parse(detail.InvoiceCGDetaiInQuantity.ToString()) * detail.InvoiceCGDetailPrice.Value, BL.V.SetDataFormat.XSJEXiao.Value); this._acInvoiceCoBill.Details.Add(detail); } this.bindingSourceDetails.DataSource = this._acInvoiceCoBill.Details; this.gridControl1.RefreshDataSource(); this.UpdateMoneyFields(); } } f.Dispose(); GC.Collect(); }
//选择委外入库单据 private void btnSelectWeiWai_Click(object sender, EventArgs e) { 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 = item.ProductUnit; //单位 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(); }