Exemplo n.º 1
0
 private void btnDeleteQuatity_Click(object sender, RoutedEventArgs e)
 {
     if (dtGrid.Rows.Count > 0)
     {
         string InventoryID = GridVoucherInventory.GetFocusedRowCellValue(COL_InventoryID).ToString();
         int    n           = BLVoucher.GetCurrentRowIndex(GridVoucherInventory, "InventoryID");
         int    value_Old   = L3ConvertType.L3Int(GridVoucherInventory.GetCellValue(n, COL_Quantity));
         int    stock_Old   = L3ConvertType.L3Int(GridVoucherInventory.GetCellValue(n, COL_InStock));
         if (value_Old > 1)
         {
             GridVoucherInventory.SetCellValue(n, "Quantity", value_Old - 1);
             GridVoucherInventory.SetCellValue(n, "InStock", stock_Old + 1);
             CalAmountGrid(n);
         }
         else if (value_Old == 1)
         {
             GridVoucherInventory.DeleteRowFocusEvent();
         }
         CalAmount();
         btnSave.IsEnabled = true;
     }
     if (GridVoucherInventory.VisibleRowCount == 0)
     {
         btnAddQuatity.IsEnabled    = false;
         btnDeleteQuatity.IsEnabled = false;
         btnAdd10Quatity.IsEnabled  = false;
     }
 }
Exemplo n.º 2
0
 protected void dispatcherTimer_Tick(object sender, EventArgs e)
 {
     if (bLoaded == true)
     {
         int i = BLVoucher.GetCurrentRowIndex(GridTable, "TableID");
         LoadSimple();
         GridTable.FocusRowHandle(i);
     }
 }
Exemplo n.º 3
0
 public frmThongKe()
 {
     InitializeComponent();
     bill     = new BLBill();
     voucher  = new BLVoucher();
     nhanvien = new BLNhanVien();
     ColName  = "IDBILL";
     LoadDatetime();
     LoadData();
 }
 public frmQuanLyBanAn()
 {
     InitializeComponent();
     bill      = new BLBill();
     billinfo  = new BLBillInfo();
     food      = new BLFood();
     typefood  = new BLTypeFood();
     blvoucher = new BLVoucher();
     tablefood = new BLTableFood();
     LayBanaAn();
     LoadType();
     //menuStrip1.Hide();
 }
Exemplo n.º 5
0
        private void btnAdd10Quatity_Click(object sender, RoutedEventArgs e)
        {
            int n = BLVoucher.GetCurrentRowIndex(GridVoucherInventory, "InventoryID");

            try
            {
                int value_Old = L3ConvertType.L3Int(GridVoucherInventory.GetCellValue(n, COL_Quantity));
                int stock_Old = L3ConvertType.L3Int(GridVoucherInventory.GetCellValue(n, COL_InStock));
                if (stock_Old >= 10)
                {
                    GridVoucherInventory.SetCellValue(n, "Quantity", value_Old + 10);
                    GridVoucherInventory.SetCellValue(n, "InStock", stock_Old - 10);
                }
                CalAmountGrid(n);
            }
            catch (Exception)
            {
                MessageBox.Show("Lỗi!");
            }
            CalAmount();
            btnSave.IsEnabled = true;
        }
Exemplo n.º 6
0
 public frmVoucher()
 {
     InitializeComponent();
     voucher = new BLVoucher();
     LoadData();
 }