private void button2_Click(object sender, EventArgs e) { MessageBoxButtons msgButton = MessageBoxButtons.OKCancel; DialogResult dr = MessageBox.Show("Are you sure to CHECK OUT for TABLE " + table.Num + "? Order will set to \"Completed\" and Table will be set \"Dirty\"", "Confirm", msgButton); if (dr == DialogResult.OK) { order.Status = "Completed"; order.FinishedTime = DateTime.Now; table.Status = "Dirty"; orderDao.updateOrder(order); tableDao.updateTable(table); } }
private void btn_add_edit_table_Click(object sender, EventArgs e) { TableDao tableDao = new TableDao(); Table table = new Table(); table.Name = txt_table_name.Text; table.Description = txt_table_desc.Text; int returnId; if (isUpdate) { table.Id = addEdittable.Id; returnId = tableDao.updateTable(table); } else { returnId = tableDao.insertTable(table); } if (returnId != -1) { this.Close(); } if (returnId == -9) { MessageBox.Show("Belə bir STOL adı mövcuddur"); } }
public void updateTableTest() { TableDao tableDao = new TableDao(); Table table = tableDao.GetTableById(1); table.Status = "Dirty"; tableDao.updateTable(table); Assert.IsTrue(tableDao.GetTableById(1).Status == "Dirty"); }