/// <summary> /// Update a ProduceOtherReturnDetail. /// </summary> public void Update(Model.ProduceOtherReturnDetail produceOtherReturnDetail) { // // todo: add other logic here. // accessor.Update(produceOtherReturnDetail); }
/// <summary> /// Insert a ProduceOtherReturnDetail. /// </summary> public void Insert(Model.ProduceOtherReturnDetail produceOtherReturnDetail) { // // todo:add other logic here // accessor.Insert(produceOtherReturnDetail); }
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ProduceOtherCompact.ChooseOutContract f = new ProduceOtherCompact.ChooseOutContract(); if (f.ShowDialog(this) != DialogResult.OK) { return; } if (f.key == null || f.key.Count == 0) { return; } this.newChooseSupplier.EditValue = f.key[0].ProduceOtherCompact.Supplier; if (this._produceOtherReturnMaterial.Details.Count > 0 && string.IsNullOrEmpty(this._produceOtherReturnMaterial.Details[0].ProductId)) { this._produceOtherReturnMaterial.Details.RemoveAt(0); } foreach (Model.ProduceOtherCompactDetail item in f.key) { Model.ProduceOtherReturnDetail detail = new Model.ProduceOtherReturnDetail(); detail.ProduceOtherReturnDetailId = Guid.NewGuid().ToString(); detail.ProduceOtherReturnMaterialId = this._produceOtherReturnMaterial.ProduceOtherReturnMaterialId; detail.Product = item.Product; detail.ProductId = item.ProductId; detail.ProductUnit = item.ProductUnit; detail.ProduceOtherCompactId = item.ProduceOtherCompactId; detail.ProduceOtherCompactDetailId = item.OtherCompactDetailId; //detail.Quantity = 0; //item.ProduceQuantity;// - (item.AlreadyOutQuantity == null ? 0 : item.AlreadyOutQuantity); // detail.ProcessPrice = 0; // detail.ProduceOtherReturnDetailDesc = item.Description; //detail.Inumber = this._produceOtherMaterial.Details.Count + 1; detail.Quantity = this.PCOtherCheckDetailManager.SelectReturnQuantity(item.OtherCompactDetailId); detail.Price = item.OtherCompactPrice; detail.Amount = detail.Price * Convert.ToDecimal(detail.Quantity); this._produceOtherReturnMaterial.Details.Add(detail); } this.gridControl1.RefreshDataSource(); decimal?d = 0; foreach (Model.ProduceOtherReturnDetail detail in this._produceOtherReturnMaterial.Details) { d += detail.Amount; } this.txt_AmountMoney.Text = d.ToString(); this.txt_Tax.Text = (Convert.ToDouble(d) * 0.05).ToString(); this.txt_TotalMoney.Text = (Convert.ToDouble(d) * 0.05 + Convert.ToDouble(d)).ToString(); f.Dispose(); GC.Collect(); }
private void simple_Append_Click(object sender, EventArgs e) { ChooseProductForm f = new ChooseProductForm(); if (f.ShowDialog(this) == DialogResult.OK) { if (this._produceOtherReturnMaterial.Details.Count > 0 && this._produceOtherReturnMaterial.Details[0] != null && string.IsNullOrEmpty(this._produceOtherReturnMaterial.Details[0].ProductId)) { this._produceOtherReturnMaterial.Details.RemoveAt(0); } Model.ProduceOtherReturnDetail detail = null; if (ChooseProductForm.ProductList != null || ChooseProductForm.ProductList.Count > 0) { foreach (Model.Product product in ChooseProductForm.ProductList) { detail = new Book.Model.ProduceOtherReturnDetail(); detail.ProduceOtherReturnDetailId = Guid.NewGuid().ToString(); detail.ProduceOtherReturnMaterialId = this._produceOtherReturnMaterial.ProduceOtherReturnMaterialId; detail.Product = this.productManager.Get(product.ProductId); detail.ProductId = product.ProductId; detail.ProductUnit = product.DepotUnit.ToString(); detail.Quantity = 0; this._produceOtherReturnMaterial.Details.Add(detail); } } if (ChooseProductForm.ProductList == null || ChooseProductForm.ProductList.Count == 0) { detail = new Book.Model.ProduceOtherReturnDetail(); detail.ProduceOtherReturnDetailId = Guid.NewGuid().ToString(); detail.ProduceOtherReturnMaterialId = this._produceOtherReturnMaterial.ProduceOtherReturnMaterialId; detail.Product = this.productManager.Get((f.SelectedItem as Model.Product).ProductId); detail.ProductId = detail.Product.ProductId; detail.ProductUnit = (f.SelectedItem as Model.Product).DepotUnit.ToString(); detail.Quantity = 0; this._produceOtherReturnMaterial.Details.Add(detail); } this.bindingSourceProduceOtherReturnDetail.Position = this.bindingSourceProduceOtherReturnDetail.IndexOf(detail); this.gridControl1.RefreshDataSource(); } f.Dispose(); System.GC.Collect(); }
private void gridView1_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { Model.ProduceOtherReturnDetail detail = this.gridView1.GetRow(e.RowHandle) as Model.ProduceOtherReturnDetail; if (e.Column == this.gridColumnId || e.Column == this.gridColumnPName) { if (detail != null) { Model.Product p = detail.Product; //detail.ProduceOtherMaterialDetailId = Guid.NewGuid().ToString(); detail.Quantity = 0; detail.Product = p; detail.ProductId = p.ProductId; detail.ProductUnit = p.DepotUnit.ToString(); detail.ProduceOtherReturnDetailDesc = string.Empty; this.bindingSourceProduceOtherReturnDetail.Position = this.bindingSourceProduceOtherReturnDetail.IndexOf(detail); } this.gridControl1.RefreshDataSource(); } }
private void simple_Remove_Click(object sender, EventArgs e) { if (this.bindingSourceProduceOtherReturnDetail.Current != null) { this._produceOtherReturnMaterial.Details.Remove(this.bindingSourceProduceOtherReturnDetail.Current as Book.Model.ProduceOtherReturnDetail); if (this._produceOtherReturnMaterial.Details.Count == 0) { Model.ProduceOtherReturnDetail detail = new Model.ProduceOtherReturnDetail(); detail.ProduceOtherReturnDetailId = Guid.NewGuid().ToString(); detail.Quantity = 0; detail.ProduceOtherReturnDetailDesc = ""; detail.Product = new Book.Model.Product(); this._produceOtherReturnMaterial.Details.Add(detail); this.bindingSourceProduceOtherReturnDetail.Position = this.bindingSourceProduceOtherReturnDetail.IndexOf(detail); } this.gridControl1.RefreshDataSource(); } }
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ProduceOtherCompact.ChooseOutContract f = new ProduceOtherCompact.ChooseOutContract(); if (f.ShowDialog(this) != DialogResult.OK) { return; } if (f.key == null || f.key.Count == 0) { return; } this.newChooseSupplier.EditValue = f.key[0].ProduceOtherCompact.Supplier; if (this._produceOtherReturnMaterial.Details.Count > 0 && string.IsNullOrEmpty(this._produceOtherReturnMaterial.Details[0].ProductId)) { this._produceOtherReturnMaterial.Details.RemoveAt(0); } foreach (Model.ProduceOtherCompactDetail item in f.key) { Model.ProduceOtherReturnDetail detail = new Model.ProduceOtherReturnDetail(); detail.ProduceOtherReturnDetailId = Guid.NewGuid().ToString(); detail.ProduceOtherReturnMaterialId = this._produceOtherReturnMaterial.ProduceOtherReturnMaterialId; detail.Product = item.Product; detail.ProductId = item.ProductId; detail.ProductUnit = item.ProductUnit; detail.ProduceOtherCompactId = item.ProduceOtherCompactId; detail.ProduceOtherCompactDetailId = item.OtherCompactDetailId; detail.Quantity = 0; //item.ProduceQuantity;// - (item.AlreadyOutQuantity == null ? 0 : item.AlreadyOutQuantity); detail.HandbookId = item.HandbookId; detail.HandbookProductId = item.HandbookProductId; // detail.ProcessPrice = 0; // detail.ProduceOtherReturnDetailDesc = item.Description; //detail.Inumber = this._produceOtherMaterial.Details.Count + 1; this._produceOtherReturnMaterial.Details.Add(detail); } this.gridControl1.RefreshDataSource(); f.Dispose(); GC.Collect(); }
public void Update(Model.ProduceOtherReturnDetail e) { this.Update <Model.ProduceOtherReturnDetail>(e); }
public void Insert(Model.ProduceOtherReturnDetail e) { this.Insert <Model.ProduceOtherReturnDetail>(e); }