Ejemplo n.º 1
0
 private void bPurchaseItemAdd_Click(object sender, EventArgs e)
 {
     QuantityUnitPriceForm form = new QuantityUnitPriceForm();
     if (form.ShowDialog(null, DbActionsEnum.Create) == System.Windows.Forms.DialogResult.OK)
     {
         PurchaseItem pi = new PurchaseItem(form.ResultData.Quantity, form.ResultData.UnitPrice, this.prodsPurchaseTab.getSelectedProduct(), this.psPurchasesTab.getSelectedProvider());
         this.purchaseCart.addPurchaseItem(pi);
     }
 }
Ejemplo n.º 2
0
 private void bPurchaseItemEdit_Click(object sender, System.EventArgs e)
 {
     QuantityUnitPriceForm form = new QuantityUnitPriceForm();
     PurchaseItem pi = this.items[this.dgvPurchaseItems.SelectedRows[0].Index];
     if (form.ShowDialog(new QuantityUnitPrice(pi.Quantity, pi.UnitPrice), DbActionsEnum.Update) == System.Windows.Forms.DialogResult.OK)
     {
         pi.UnitPrice = form.ResultData.UnitPrice;
         pi.Quantity = form.ResultData.Quantity;
         this.dgvPurchaseItems.Refresh();
     }
 }