private void btn_Add_Click(object sender, EventArgs e) { Invoices.ChooseProductForm f = new Invoices.ChooseProductForm(); if (f.ShowDialog(this) == DialogResult.OK) { if (Invoices.ChooseProductForm.ProductList != null && Invoices.ChooseProductForm.ProductList.Count > 0) { foreach (Model.Product product in Invoices.ChooseProductForm.ProductList) { Model.PCMaterialCheckDetail detail = new Book.Model.PCMaterialCheckDetail(); detail.PCMaterialCheckDetailId = Guid.NewGuid().ToString(); detail.PCMaterialCheckId = this._PCMaterialCheck.PCMaterialCheckId; detail.CheckDate = DateTime.Now; detail.Product = product; detail.ProductId = product.ProductId; this._PCMaterialCheck.Details.Add(detail); this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(detail); } } else if (Invoices.ChooseProductForm.ProductList == null || Invoices.ChooseProductForm.ProductList.Count == 0) { Model.PCMaterialCheckDetail detail = new Book.Model.PCMaterialCheckDetail(); detail.PCMaterialCheckDetailId = Guid.NewGuid().ToString(); detail.PCMaterialCheckId = this._PCMaterialCheck.PCMaterialCheckId; detail.CheckDate = DateTime.Now; detail.Product = f.SelectedItem as Model.Product; detail.ProductId = (f.SelectedItem as Model.Product).ProductId; this._PCMaterialCheck.Details.Add(detail); this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(detail); } } this.gridControl1.RefreshDataSource(); }
private void btn_Product_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { Invoices.ChooseProductForm f = new Invoices.ChooseProductForm(); if (f.ShowDialog(this) == DialogResult.OK) { this.btn_Product.EditValue = f.SelectedItem; } }
private void EndProductId_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { Invoices.ChooseProductForm form = new Invoices.ChooseProductForm(); if (form.ShowDialog(this) == DialogResult.OK) { this.EndProductId.EditValue = form.SelectedItem as Model.Product; } }
void buttonEditProduct1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { Invoices.ChooseProductForm form = new Invoices.ChooseProductForm(); if (form.ShowDialog() == DialogResult.OK) { this.buttonEditProduct1.EditValue = form.SelectedItem; } }
private void buttonEditProduct_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { Invoices.ChooseProductForm f = new Invoices.ChooseProductForm(); if (f.ShowDialog(this) != DialogResult.OK) { return; } this.buttonEditProduct.EditValue = f.SelectedItem as Model.Product; }
private void buttonEditPro1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { Invoices.ChooseProductForm form = new Invoices.ChooseProductForm(); if (form.ShowDialog(this) == DialogResult.OK) { this.buttonEditPro1.EditValue = form.SelectedItem as Model.Product; } form.Dispose(); GC.Collect(); }
private void btn_Product_Click(object sender, EventArgs e) { Invoices.ChooseProductForm form = new Invoices.ChooseProductForm(); if (form.ShowDialog(this) == DialogResult.OK) { this.btn_Product.EditValue = form.SelectedItem as Model.Product; } form.Dispose(); GC.Collect(); }
private void buttonEdit1_Click(object sender, EventArgs e) { Invoices.ChooseProductForm f = new Invoices.ChooseProductForm(); if (f.ShowDialog(this) == DialogResult.OK) { (sender as DevExpress.XtraEditors.ButtonEdit).EditValue = f.SelectedItem; if (f.SelectedItem != null) { // this.textEditId.Text = (this.newChooseContorlProductType.EditValue as Model.ProductCategory).Id; //this.product.ProductCategory = (this.newChooseContorlProductType.EditValue as Model.ProductCategory); this._packageDetails.Product = f.SelectedItem as Model.Product; this._packageDetails.ProductId = (f.SelectedItem as Model.Product).ProductId; this.buttonEditProduct.Text = (f.SelectedItem as Model.Product).ProductName; } } }
private void simBtnAdd_Click(object sender, EventArgs e) { Invoices.ChooseProductForm f = new Invoices.ChooseProductForm(); if (f.ShowDialog(this) == DialogResult.OK) { if (Invoices.ChooseProductForm.ProductList != null && Invoices.ChooseProductForm.ProductList.Count > 0) { foreach (Model.Product product in Invoices.ChooseProductForm.ProductList) { Model.AcInvoiceXOBillDetail detail = new Book.Model.AcInvoiceXOBillDetail(); detail.AcInvoiceXOBillDetailId = Guid.NewGuid().ToString(); //detail.InvoiceXODetailId = item.InvoiceXSDetailId; detail.ProductId = product.ProductId; detail.Product = product; //detail.Invoice = item.Invoice; //detail.InvoiceId = item.InvoiceId; detail.AcInvoiceXOBillId = this._acInvoiceXoBill.AcInvoiceXOBillId; detail.InvoiceProductUnit = detail.Product.SellUnit == null ? null : detail.Product.SellUnit.CnName; //detail.InvoiceAllowance = decimal.Parse((item.InvoiceAllowance == null ? 0 : item.InvoiceAllowance.Value).ToString()); //detail.InvoiceXODetaiInQuantity = (item.InvoiceXSDetailQuantity - (item.InvoiceXSDetailFPQuantity == null ? 0 : item.InvoiceXSDetailFPQuantity.Value)) < 0 ? 0 : (item.InvoiceXSDetailQuantity - (item.InvoiceXSDetailFPQuantity == null ? 0 : item.InvoiceXSDetailFPQuantity.Value)); //detail.InvoiceXODetailPrice = item.InvoiceXSDetailPrice == null ? 0 : item.InvoiceXSDetailPrice.Value; //detail.InvoiceXODetailMoney = global::Helper.DateTimeParse.GetSiSheWuRu(decimal.Parse(detail.InvoiceXODetaiInQuantity.ToString()) * detail.InvoiceXODetailPrice.Value - detail.InvoiceAllowance.Value, BL.V.SetDataFormat.XSJEXiao.Value); //detail.InvoiceCOIdNote = new BL.InvoiceXOManager().SelectCusXOIdByPrimaryId(item.InvoiceXOId); this._acInvoiceXoBill.Details.Add(detail); } } if (Invoices.ChooseProductForm.ProductList == null || Invoices.ChooseProductForm.ProductList.Count == 0) { Model.AcInvoiceXOBillDetail detail = new Book.Model.AcInvoiceXOBillDetail(); detail.AcInvoiceXOBillDetailId = Guid.NewGuid().ToString(); detail.ProductId = (f.SelectedItem as Model.Product).ProductId; detail.Product = f.SelectedItem as Model.Product; detail.AcInvoiceXOBillId = this._acInvoiceXoBill.AcInvoiceXOBillId; detail.InvoiceProductUnit = detail.Product.SellUnit == null ? null : detail.Product.SellUnit.CnName; this._acInvoiceXoBill.Details.Add(detail); } this.gridControl1.RefreshDataSource(); this.UpdateMoneyFields(); } }
private void btn_Add_Click(object sender, EventArgs e) { Invoices.ChooseProductForm f = new Invoices.ChooseProductForm(); if (f.ShowDialog(this) == DialogResult.OK) { if (Invoices.ChooseProductForm.ProductList != null && Invoices.ChooseProductForm.ProductList.Count > 0) { foreach (Model.Product product in Invoices.ChooseProductForm.ProductList) { Model.PCFlameRetardantDetail detail = new Book.Model.PCFlameRetardantDetail(); detail.PCFlameRetardantDetailId = Guid.NewGuid().ToString(); detail.Number = this._pCFlameRetardant.Details.Count + 1; detail.Product = product; detail.ProductId = product.ProductId; detail.EmployeeId = BL.V.ActiveOperator.EmployeeId; detail.Pihao = this.Pihao; this._pCFlameRetardant.Details.Add(detail); this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(detail); } } else if (Invoices.ChooseProductForm.ProductList == null || Invoices.ChooseProductForm.ProductList.Count == 0) { Model.PCFlameRetardantDetail detail = new Book.Model.PCFlameRetardantDetail(); detail.PCFlameRetardantDetailId = Guid.NewGuid().ToString(); detail.Number = this._pCFlameRetardant.Details.Count + 1; detail.Product = f.SelectedItem as Model.Product; detail.ProductId = (f.SelectedItem as Model.Product).ProductId; detail.EmployeeId = BL.V.ActiveOperator.EmployeeId; detail.Pihao = this.Pihao; this._pCFlameRetardant.Details.Add(detail); this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(detail); } this.gridControl1.RefreshDataSource(); } }