Пример #1
0
        private void NewSaleItem()
        {
            SaleItem         item            = new SaleItem();
            frmEditSalesItem frmEditSaleItem = new frmEditSalesItem(item);

            if (frmEditSaleItem.ShowDialog() == DialogResult.OK)
            {
                bsSaleItems.Add(item);
                bsSaleItems.MoveLast();
                dgvSaleItems.Invalidate();
            }
            else
            {
                bsSaleItems.Remove(item);
            }
        }
Пример #2
0
        private void EditSaleItem()
        {
            SaleItem item = GetSelectedItem();

            if (item == null)
            {
                return;
            }

            frmEditSalesItem frmEditSaleItem = new frmEditSalesItem(item);

            if (frmEditSaleItem.ShowDialog() == DialogResult.OK)
            {
                bsSaleItems.EndEdit();
                dgvSaleItems.Invalidate();
            }
            else
            {
                bsSaleItems.CancelEdit();
            }
        }
Пример #3
0
 private void NewSaleItem()
 {
     SaleItem item = new SaleItem();
     frmEditSalesItem frmEditSaleItem = new frmEditSalesItem(item);
     if (frmEditSaleItem.ShowDialog() == DialogResult.OK)
     {
         bsSaleItems.Add(item);
         bsSaleItems.MoveLast();
         dgvSaleItems.Invalidate();
     }
     else
     {
         bsSaleItems.Remove(item);
     }
 }
Пример #4
0
        private void EditSaleItem()
        {
            SaleItem item = GetSelectedItem();
            if (item == null)
            {
                return;
            }

            frmEditSalesItem frmEditSaleItem = new frmEditSalesItem(item);
            if (frmEditSaleItem.ShowDialog() == DialogResult.OK)
            {
                bsSaleItems.EndEdit();
                dgvSaleItems.Invalidate();
            }
            else
            {
                bsSaleItems.CancelEdit();
            }
        }