private void gridView1_CellValueChanging_1(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { Model.ProduceMaterialExitDetail detail = this.gridView1.GetRow(e.RowHandle) as Model.ProduceMaterialExitDetail; if (e.Column == this.ColProductId) { if (detail != null) { Model.Product p = productManager.Get(e.Value.ToString()); detail.ProduceMaterialExitDetailId = Guid.NewGuid().ToString(); detail.ProduceQuantity = 0; // detail.ProduceAllUserQuantity = 0; detail.Product = p; detail.ProductStock = p.StocksQuantity; detail.ProductId = p.ProductId; // detail.DepotPosition = null; this.bindingSourceDetails.Position = this.bindingSourceDetails.IndexOf(detail); } this.gridControl1.RefreshDataSource(); } //if (e.Column == this.gridColumnDepot) //{ // detail.DepotPosition = null; //} }
private void gridView1_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { Model.InvoiceBSDetail detail = this.gridView1.GetRow(e.RowHandle) as Model.InvoiceBSDetail; if (e.Column == this.colproductId) { if (detail != null) { Model.Product p = productManager.Get(e.Value.ToString()); detail.InvoiceBSDetailId = Guid.NewGuid().ToString(); detail.Invoice = this.invoice; detail.InvoiceBSDetailNote = ""; detail.InvoiceBSDetailQuantity = 0; detail.Product = p; detail.ProductId = p.ProductId; //detail.InvoiceProductUnit = detail.Product.ProductBaseUnit; this.bindingSourceInvoiceBSDetail.Position = this.bindingSourceInvoiceBSDetail.IndexOf(detail); this.gridControl1.RefreshDataSource(); } } if (e.Column == this.gridColumnPositionId) { if (detail != null) { Model.DepotPosition position = new BL.DepotPositionManager().Get(e.Value.ToString()); detail.DepotPosition = position; detail.DepotPositionId = position.DepotPositionId; } this.gridControl1.RefreshDataSource(); } }
private void gridView1_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { Model.ProduceOtherInDepotDetail detail = this.gridView1.GetRow(e.RowHandle) as Model.ProduceOtherInDepotDetail; if (e.Column == this.ColProductId || e.Column == this.gridColumnCustomPro || e.Column == this.gridColumn2) { if (detail != null) { Model.Product p = productManager.Get(e.Value.ToString()); detail.ProduceOtherInDepotDetailId = Guid.NewGuid().ToString(); detail.ProduceQuantity = 0; detail.ProducePrice = 0; detail.ProduceMoney = 0; detail.ProcessPrice = 0; detail.Product = p; detail.ProductId = p.ProductId; detail.ProductUnit = p.MainUnit == null ? "" : p.MainUnit.CnName; detail.ProductGuige = p.ProductSpecification; this.bindingSourceDetails.Position = this.bindingSourceDetails.IndexOf(detail); } this.gridControl1.RefreshDataSource(); } //if (e.Column == this.gridColumn7) //{ // detail.DepotPosition = null; //} }
private void gridView1_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { if (e.Column == this.colProductId || e.Column == this.colProduct) { Model.InvoiceCTDetail detail = this.gridView1.GetRow(e.RowHandle) as Model.InvoiceCTDetail; if (detail != null) { Model.Product p = productManager.Get(e.Value.ToString()); detail.InvoiceCTDetailId = Guid.NewGuid().ToString(); detail.Invoice = this.invoice; detail.InvoiceCTDetailDisount = decimal.Zero; detail.InvoiceCTDetailDiscountRate = 0; detail.InvoiceCTDetailNote = ""; detail.InvoiceCTDetailQuantity = 1; detail.InvoiceCTDetailTax = decimal.Zero; detail.InvoiceCTDetailTaxRate = 0; detail.InvoiceCTDetailZS = false; detail.Product = p; detail.ProductId = p.ProductId; detail.InvoiceProductUnit = p.DepotUnit == null ? "" : p.DepotUnit.CnName; detail.InvoiceCTDetailMoney0 = Convert.ToDecimal(detail.InvoiceCTDetailQuantity.Value) * detail.InvoiceCTDetailPrice; detail.InvoiceCTDetailMoney1 = detail.InvoiceCTDetailMoney0; this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(detail); } this.gridControl1.RefreshDataSource(); } }
private void gridView1_CellValueChanging_1(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { if (e.Column == this.gridColumnProductId || e.Column == this.gridColumn2) { Model.CustomerPackageDetail detail = this.gridView1.GetRow(e.RowHandle) as Model.CustomerPackageDetail; if (detail != null) { Model.Product p = productManager.Get(e.Value.ToString()); if (p != null) { detail.CustomerPackageDetailId = Guid.NewGuid().ToString(); detail.ConsumeRate = 0; detail.Quantity = 1; detail.CustomerPackage = this._customerPackage; if (this._customerPackage != null) { detail.CustomerPackageId = this._customerPackage.CustomerPackageId; } detail.Description = ""; detail.ExpiringDate = global::Helper.DateTimeParse.EndDate; detail.EffectsDate = DateTime.Now;; detail.Product = p; detail.ProductId = p.ProductId; // detail.InvoiceProductUnit = p.DepotUnit == null ? "" : p.DepotUnit.CnName; } this.bindingSource1.Position = this.bindingSource1.IndexOf(detail); } this.gridControl1.RefreshDataSource(); } }
/// <summary> /// 窗体加载 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BomManagerForm2_Load(object sender, EventArgs e) { // this.WindowState = FormWindowState.Maximized; band(); if (treeList1.Nodes.Count != 0) { this._product = productManager.Get(treeList1.Nodes[0].Tag.ToString()); this._bomparent = this.BomparentManager.Get(this._product); this._comDetails.Clear(); this._comDetails = bomComponenmtInfoByBom(this._bomparent); this.bindingSource1.DataSource = this._comDetails; this.gridControl1.RefreshDataSource(); } }
private void gridControl1_DoubleClick(object sender, EventArgs e) { if (this.bindingSource1.Current == null) { return; } Model.Product product = productManager.Get((this.bindingSource1.Current as Model.Product).ProductId); Products.EditForm f = new Book.UI.Settings.BasicData.Products.EditForm(product, "view"); f.ShowDialog(); }
private void gridViewOut_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { if (e.Column == this.colProductId1) { Model.InvoiceZZDetail detailOut = this.gridViewOut.GetRow(e.RowHandle) as Model.InvoiceZZDetail; if (detailOut != null) { Model.Product p = productManager.Get(e.Value.ToString()); detailOut.InvoiceZZDetailId = Guid.NewGuid().ToString(); detailOut.InvoiceZZDetailKind = "O"; detailOut.InvoiceZZDetailNote = ""; detailOut.InvoiceZZDetailPrice = 0; detailOut.InvoiceZZDetailQuantity = 0; detailOut.InvoiceZZDetailZongji = 0; detailOut.Product = p; detailOut.ProductId = p.ProductId; //detailOut.InvoiceProductUnit = detailOut.Product.ProductBaseUnit; this.bindingSourceOut.Position = this.bindingSourceOut.IndexOf(detailOut); } this.gridControlOut.RefreshDataSource(); } }
//新增改為直接填寫商品編號 private void slue_ProductId_EditValueChanged(object sender, EventArgs e) { if (this.action == "insert" && this.slue_ProductId.EditValue != null) { this._CustomerProductPrice.Product = productManager.Get(this.slue_ProductId.EditValue.ToString()); if (this._CustomerProductPrice.Product != null) { this.btn_CheckProduct.EditValue = this._CustomerProductPrice.Product; this._CustomerProductPrice.ProductId = this._CustomerProductPrice.Product.ProductId; this._CustomerProductPrice.ProductIDNo = this._CustomerProductPrice.Product.Id; this._CustomerProductPrice.ProductName = this._CustomerProductPrice.Product.ProductName; this._CustomerProductPrice.ProductDesc = this._CustomerProductPrice.Product.ProductDescription; this._CustomerProductPrice.ProductVersion = this._CustomerProductPrice.Product.ProductVersion; this._CustomerProductPrice.CustomerProductId = this._CustomerProductPrice.Product.CustomerProductName; this._CustomerProductPrice.CustomerProductsId = (new BL.CustomerProductsManager()).SelectPrimaryIdByProceName(this._CustomerProductPrice.ProductId); } this._CustomerProductPrice.Customer = this.bindingSourceCustomer.Current as Model.Customer; if (this._CustomerProductPrice.Customer != null) { this._CustomerProductPrice.CustomerId = this._CustomerProductPrice.Customer.CustomerId; } if (this._CustomerProductPriceList.Where(c => c.CustomerId == this._CustomerProductPrice.CustomerId && c.ProductId == this._CustomerProductPrice.ProductId).ToList <Model.CustomerProductPrice>().Count > 0) { //MessageBox.Show("有重複商品輸入", "提示"); //return; Model.CustomerProductPrice model = this._CustomerProductPriceList.Where(c => c.CustomerId == this._CustomerProductPrice.CustomerId && c.ProductId == this._CustomerProductPrice.ProductId).First(); model = this._CustomerProductPrice; this.bindingSourceCustomerProduct.Position = this._CustomerProductPriceList.IndexOf(this._CustomerProductPriceList.First(c => c.CustomerId == this._CustomerProductPrice.CustomerId && c.ProductId == this._CustomerProductPrice.ProductId)); } else { this._CustomerProductPriceList.Add(this._CustomerProductPrice); this.bindingSourceCustomerProduct.Position = this.bindingSourceCustomerProduct.IndexOf(this._CustomerProductPrice); } this.gridControl2.RefreshDataSource(); AnalyzePriceRange(this._CustomerProductPrice.CustomerProductPriceRage); this.gridControl3.RefreshDataSource(); } }
private void gridView1_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { if (e.Column == this.colProductId || e.Column == this.colProduct) { Model.PronoteProceduresAbilityDetail detail = this.gridView1.GetRow(e.RowHandle) as Model.PronoteProceduresAbilityDetail; if (detail != null) { Model.Product p = productManager.Get(e.Value.ToString()); detail.PronoteProceduresAbilityDetailId = Guid.NewGuid().ToString(); detail.PronoteProceduresAbility = this._pronoteProceduresAbility; detail.Product = p; detail.ProductId = p.ProductId; detail.TimeConsuming = 0; detail.UnitOutput = 0; detail.ProductUnit = detail.Product.ProduceUnit == null ? "" : detail.Product.ProduceUnit.CnName; this.bindingSource1.Position = this.bindingSource1.IndexOf(detail); } this.gridControl1.RefreshDataSource(); } }
private void gridView1_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { if (e.Column == this.colProductId) { Model.InvoiceXJDetail detail = this.gridView1.GetRow(e.RowHandle) as Model.InvoiceXJDetail; if (detail != null) { Model.Product p = ProductsManager.Get(e.Value.ToString()); detail.InvoiceXJDetailId = Guid.NewGuid().ToString(); detail.Invoice = this.invoice; detail.InvoiceXJDetailNote = ""; detail.InvoiceXJDetailQuantity = 1; detail.Product = p; detail.ProductId = p.ProductId; detail.InvoiceProductUnit = p.MainUnit == null ? "" : p.MainUnit.CnName; this.bindingSource1.Position = this.bindingSource1.IndexOf(detail); } this.gridControl1.RefreshDataSource(); } }
private void gridView1_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { if (e.Column == this.ColProductId) { Model.ProduceOtherCompactDetail detail = this.gridView1.GetRow(e.RowHandle) as Model.ProduceOtherCompactDetail; if (detail != null) { Model.Product p = productManager.Get(e.Value.ToString()); detail.OtherCompactDetailId = Guid.NewGuid().ToString(); detail.OtherCompactCount = 0; detail.OtherCompactPrice = 0; detail.InDepotCount = 0; detail.OtherCompactMoney = 0; detail.Product = p; detail.ProductId = p.ProductId; detail.ProductSpecification = p.ProductSpecification; this.bindingSourceDetails.Position = this.bindingSourceDetails.IndexOf(detail); } this.gridControl1.RefreshDataSource(); } }
private void gridView1_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { Model.ProduceTransferDetail detail = this.gridView1.GetRow(e.RowHandle) as Model.ProduceTransferDetail; if (detail == null) { return; } if (e.Column == this.gridProductId) { Model.Product p = productManager.Get(e.Value.ToString()); detail.ProduceTransferDetailId = Guid.NewGuid().ToString(); detail.ScrapQuantity = 0; detail.TransferQuantity = 0; detail.Product = p; detail.ProductId = p.ProductId; detail.ProductUnit = p.ProduceUnit.CnName; this.bindingSourceDetails.Position = this.bindingSourceDetails.IndexOf(detail); } if (e.Column == this.gridProceduresOut) { Model.Procedures procedures = this.proceduresManager.GetById(e.Value.ToString()); if (procedures != null) { detail.ProceduresOut = procedures; detail.ProceduresOutId = procedures.ProceduresId; } } if (e.Column == this.gridProceduresIn) { Model.Procedures procedures = this.proceduresManager.GetById(e.Value.ToString()); if (procedures != null) { detail.ProceduresIn = procedures; detail.ProceduresInId = procedures.ProceduresId; } } this.gridControl1.RefreshDataSource(); }
private void gridView1_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { if (e.Column == this.gridColumn1 || e.Column == this.gridColumn2) { Model.StockCheckDetail detail = this.gridView1.GetRow(e.RowHandle) as Model.StockCheckDetail; if (detail != null) { Model.Product p = productManager.Get(e.Value.ToString()); detail.StockCheckDetailId = Guid.NewGuid().ToString(); detail.StockCheckId = _stockCheck.StockCheckId; detail.StockCheck = _stockCheck; detail.Directions = ""; detail.StockCheckQuantity = null; detail.Product = p; detail.Directions = p.ProductDescription; detail.ProductId = p.ProductId; detail.ProductUnitName = p.DepotUnit == null ? null : p.DepotUnit.CnName; this.bindingSourceStockCheckDetail.Position = this.bindingSourceStockCheckDetail.IndexOf(detail); } this.gridControl1.RefreshDataSource(); } }
private void gridView1_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { Model.InvoiceHZDetail detail = this.gridView1.GetRow(e.RowHandle) as Model.InvoiceHZDetail; if (e.Column == this.colProductId) { if (detail != null) { Model.Product p = productManager.Get(e.Value.ToString()); detail.InvoiceHZDetailId = Guid.NewGuid().ToString(); detail.InvoiceHZDetailMoney = 0; detail.InvoiceHZDetailNote = ""; detail.InvoiceHZDetailPrice = 0; detail.InvoiceHZDetailQuantity = 0; detail.Product = p; detail.ProductId = p.ProductId; //detail.InvoiceCGDetailPrice = detail.Product.ProductCurrentCGPrice == null ? 0 : detail.Product.ProductCurrentCGPrice.Value; //detail.InvoiceProductUnit = detail.Product.ProductBaseUnit; //detail.InvoiceCGDetailMoney0 = Convert.ToDecimal(detail.InvoiceCGDetailQuantity.Value) * detail.InvoiceCGDetailPrice; //detail.InvoiceCGDetailMoney1 = detail.InvoiceCGDetailMoney0; this.bindingSourceInvoiceHZDetail.Position = this.bindingSourceInvoiceHZDetail.IndexOf(detail); } this.gridControl1.RefreshDataSource(); } if (e.Column == this.DepotPositionId) { if (detail != null) { Model.DepotPosition position = new BL.DepotPositionManager().Get(e.Value.ToString()); detail.DepotPosition = position; if (position != null) { detail.DepotPositionId = position.DepotPositionId; } } this.gridControl1.RefreshDataSource(); } }
private void treeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e) { if (e.Node != null && e.Node.ParentNode != null) { this._bomcomDetail.Clear(); Model.Product product = productManager.Get(e.Node.Tag.ToString()); if (product != null) { this._bomparent = this.BomparentManager.Get(product); this._bomparents = this._bomparent; if (_bomparent != null) { //根据母件查询子件 this._bomcomDetail = this.BomcomManager.Select(_bomparent); } IList <Model.BomComponentInfo> a = null; if (this._bomcomDetail.Count != 0) { for (int i = 0; i < this._bomcomDetail.Count; i++) // foreach(Model.BomComponentInfo com in this._bomcomDetail) { //在BOM中查询 是否 存在此子件 this._bomparent = this.BomparentManager.Get(_bomcomDetail[i].Product); //判定是否加工后产品 if (this._bomparent == null) { if (this._bomcomDetail[i].Product.IsProcee == true) { this._bomparent = this.BomparentManager.Get(this.productManager.Get(_bomcomDetail[i].Product.ProceebeforeProductId)); } } //如果存在此子件 if (this._bomparent != null) { //将此子件作为BOM 继续 查询他 的子件 a = this.BomcomManager.Select(this._bomparent); //将a的子件填进 集合 foreach (Model.BomComponentInfo bom in a) { //子件级别为他的母件级别加1 bom.Jibie = _bomcomDetail[i].Jibie + 1; bom.Product.Id = this._bomparent.Product.Id + "/" + bom.Product.Id; this._bomcomDetail.Add(bom); } //清空临时a a.Clear(); } } } this.bindingSource1.DataSource = this._bomcomDetail; this.gridControl1.RefreshDataSource(); } } //if (e.Node != null && e.Node.ParentNode != null) //{ // this._cusProductsBomDetail.Clear(); // Model.Product product = productManager.Get(e.Node.Tag.ToString()); // if (product != null) // { // this._cusProduct = this.CusProductsManager.Get(product); // this._cusProducts = this._cusProduct; // if (_cusProduct != null) // this._cusProductsBomDetail = this.CusProductsBomManager.Select(_cusProduct); // IList<Model.CustomerProductsBom> c= null; // if (this._cusProductsBomDetail.Count != 0) // { // for (int i = 0; i < this._cusProductsBomDetail.Count; i++) // { // this._cusProduct = this.CusProductsManager.Get(_cusProductsBomDetail[i].Product); // // if (this._cusProduct != null) // { // c = this.CusProductsBomManager.Select(this._cusProduct); // foreach (Model.CustomerProductsBom cusBom in c) // { // cusBom.Jibie = _cusProductsBomDetail[i].Jibie + 1; // cusBom.Product.Id = this._cusProduct.Product.Id + "/" + cusBom.Product.Id; // this._cusProductsBomDetail.Add(cusBom); // } // c.Clear(); // } // } // } // this.bindingSource1.DataSource = this._cusProductsBomDetail; // this.gridControl1.RefreshDataSource(); // } //} }