void closeTableBill() { bill = new cBillOperations(); bill.sqlQuery = "update BILLS set closingTime = @closingTime, billStatus = 0 where billID = @billId"; bill.closingTime = DateTime.Now; bill.billId = Convert.ToInt32(dGridView.CurrentRow.Cells["Bill No"].Value); bill.closeBill(); }
void getBillId() { newBill = new cBillOperations(); newBill.sqlQuery = "select top 1 billID from BILLS where tableID = @tableId order by billID desc"; newBill.tableId = Convert.ToInt32(PBoxClicked.Tag); newBill.getBillId(); billId = Convert.ToInt32(newBill.dataTable.Rows[0][0]); }
void createNewBill() { newBill = new cBillOperations(); newBill.sqlQuery = "insert into BILLS (tableID, openingTime, billStatus) " + "values (@tableId, @openingTime, 1)"; newBill.tableId = Convert.ToInt32(PBoxClicked.Tag); newBill.openingTime = DateTime.Now; newBill.insertNewBill(); }
void addPriceToBill(decimal price) { newBill = new cBillOperations(); newBill.sqlQuery = "update BILLS set total = total + @addCost where billID = " + "(select top 1 billID from BILLS where tableID = @tableId order by billID desc)"; newBill.tableId = Convert.ToInt32(PBoxClicked.Tag); newBill.billId = billId; newBill.additionalCost = price; newBill.addPriceToTotal(); }
void showClosedBills() { bill = new cBillOperations(); bill.sqlQuery = "select billID as 'Bill No', BILLS.tableID, rowNumber as 'Table No', Total, openingTime as 'Opening Time', " + "closingTime as 'Closing Time' from BILLS inner join TABLES on BILLS.tableID = TABLES.tableID where billStatus = 0 " + "and openingTime between @open and @closed order by billID desc"; bill.openingTime = DateTime.Now.Date; bill.closingTime = DateTime.Now.Date.AddHours(23).AddMinutes(59).AddSeconds(59); bill.getAllBills(); dGridView.DataSource = bill.dataTable; dGridView.Columns["tableID"].Visible = false; }