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; } }
protected void dispatcherTimer_Tick(object sender, EventArgs e) { if (bLoaded == true) { int i = BLVoucher.GetCurrentRowIndex(GridTable, "TableID"); LoadSimple(); GridTable.FocusRowHandle(i); } }
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(); }
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; }
public frmVoucher() { InitializeComponent(); voucher = new BLVoucher(); LoadData(); }