public override void savebtn_Click(object sender, EventArgs e) { if (rolesTxt.Text == "") { rolesErrorLabel.Visible = true; } else { rolesErrorLabel.Visible = false; } if (rolesErrorLabel.Visible) { MainClass.showMessage("Fields with * are mandatory", "Error"); } else { if (edit == 0) { insertion.insertRole(rolesTxt.Text); MainClass.resetDisable(leftpanel); RetrivalData.getRoles(dataGridView1, RoleIDGV, RoleGV); } else if (edit == 1) { Updates.updateRole(rolesTxt.Text, roleID); MainClass.resetDisable(leftpanel); RetrivalData.getRoles(dataGridView1, RoleIDGV, RoleGV); } } }
private void ChefOrderWindow_Load(object sender, EventArgs e) { RetrivalData.getPendingOrders(dataGridView1, orderIDGV, statusGV); MainClass.sno(dataGridView1, "snoGV"); addbtn.Visible = false; deletebtn.Visible = false; searchtxt.Visible = false; }
private void button1_Click(object sender, EventArgs e) { if (MainClass.checkControls(leftpanel).Count == 0) { if (RetrivalData.ValidUser(textBox1.Text, passTxt.Text)) { if (RetrivalData.ROLE == "admin") { adminHomeScreenWindow hs = new adminHomeScreenWindow(); MainClass.showWindow(hs, this, MDI.ActiveForm); } else if (RetrivalData.ROLE == "Chef") { HomeScreen2 hs = new HomeScreen2 (); MainClass.showWindow(hs, this, MDI.ActiveForm); } } else { } } else { MessageBox.Show("Please enter all required fields"); } }
private void itemDD_SelectedIndexChanged(object sender, EventArgs e) { if (itemDD.SelectedIndex != -1) { try { itemEL.Visible = false; SqlCommand cmd = new SqlCommand("st_getPriceWRTitem", MainClass.con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mid", Convert.ToInt32(itemDD.SelectedValue.ToString())); MainClass.con.Open(); priceTxt.Text = Math.Round(Convert.ToDouble(cmd.ExecuteScalar().ToString()), 0).ToString(); MainClass.con.Close(); DataRowView drv = itemDD.SelectedItem as DataRowView; RetrivalData.loadCategoryWRTItem(drv["Menu Name"].ToString()); } catch (Exception ex) { MainClass.showMessage(ex.Message, "error"); } } else { itemEL.Visible = true; priceTxt.Text = ""; } }
private void billButton_Click(object sender, EventArgs e) { if (orderTypeDD.SelectedIndex == 0) { if (retrunedTXt.Text != "" && floorDD.SelectedIndex != -1 && tableDD.SelectedIndex != -1) { int ch = Updates.updateOrder(Convert.ToInt64(orderidTxt.Text), Convert.ToSingle(paidTxt.Text), Convert.ToSingle(retrunedTXt.Text), 2); if (ch > 0) { DialogResult dr = MessageBox.Show("Order completed successfully", "Success..", MessageBoxButtons.OK, MessageBoxIcon.Information); if (dr == DialogResult.OK) { rd = new ReportDocument(); RetrivalData.loadReport(rd, crystalReportViewer1, 2, null, Convert.ToInt32(tableDD.SelectedValue.ToString())); } } } } else { if (retrunedTXt.Text != "" && phoneTxt.Text != "") { int ch = Updates.updateOrder(Convert.ToInt64(orderidTxt.Text), Convert.ToSingle(paidTxt.Text), Convert.ToSingle(retrunedTXt.Text), 2); if (ch > 0) { DialogResult dr = MessageBox.Show("Order completed successfully", "Success..", MessageBoxButtons.OK, MessageBoxIcon.Information); if (dr == DialogResult.OK) { rd = new ReportDocument(); RetrivalData.loadReport(rd, crystalReportViewer1, 2, phoneTxt.Text); } } } } }
private void floorDD_SelectedIndexChanged(object sender, EventArgs e) { if (floorDD.SelectedIndex != -1) { RetrivalData.loadItems("st_getTablesWRTfloor", tableDD, "Table Number", "Table ID", "@floorID", Convert.ToInt32(floorDD.SelectedValue.ToString())); tableDD.SelectedIndex = -1; } }
private void ordersWindow_Load(object sender, EventArgs e) { RetrivalData.loadItems("st_getMenu", itemListBox, "Menu Name", "Menu ID"); RetrivalData.loadItems("st_getMenu", itemDD, "Menu Name", "Menu ID"); itemDD.SelectedIndex = -1; RetrivalData.loadItems("st_getFloors", floorDD, "Floor", "ID"); floorDD.SelectedIndex = -1; }
private void phoneTxt_Leave(object sender, EventArgs e) { if (phoneTxt.Text != "") { RetrivalData.getOrderBill(phoneTxt.Text, dataGridView1, ItemGV, QuantGV, amountGV, orderIDGV, totalAmountGV); BillLabel.Text = Math.Round(Convert.ToDouble(dataGridView1.Rows[0].Cells["totalAmountGV"].Value.ToString()), 0).ToString(); orderidTxt.Text = dataGridView1.Rows[0].Cells["orderIDGV"].Value.ToString(); } }
private void orderCompletionWindow_Load(object sender, EventArgs e) { dataGridView1.AutoGenerateColumns = false; RetrivalData.loadItems("st_getFloors", floorDD, "Floor", "ID"); floorDD.SelectedIndex = -1; dataGridView1.DataSource = null; BillLabel.Text = ""; orderidTxt.Text = ""; }
private void tableDD_SelectedIndexChanged(object sender, EventArgs e) { if (tableDD.SelectedIndex != -1) { RetrivalData.getOrderBill(Convert.ToInt32(tableDD.SelectedValue.ToString()), dataGridView1, ItemGV, QuantGV, amountGV, orderIDGV, totalAmountGV); BillLabel.Text = Math.Round(Convert.ToDouble(dataGridView1.Rows[0].Cells["totalAmountGV"].Value.ToString()), 0).ToString(); orderidTxt.Text = dataGridView1.Rows[0].Cells["orderIDGV"].Value.ToString(); } }
private void tableDD_SelectedIndexChanged(object sender, EventArgs e) { if (tableDD.SelectedIndex != -1) { if (RetrivalData.CheckTableStatus(Convert.ToInt32(tableDD.SelectedValue.ToString()), Convert.ToInt16(floorDD.SelectedValue.ToString()))) { tableDD.SelectedIndex = -1; } } }
private void floorDD_SelectedIndexChanged(object sender, EventArgs e) { if (floorDD.SelectedIndex != -1) { RetrivalData.loadItems("st_getTablesWRTfloor", tableDD, "Table Number", "Table ID", "@floorID", Convert.ToInt32(floorDD.SelectedValue.ToString())); tableDD.SelectedIndex = -1; dataGridView1.DataSource = null; BillLabel.Text = ""; orderidTxt.Text = ""; paidTxt.Text = ""; retrunedTXt.Text = ""; } }
public override void deletebtn_Click(object sender, EventArgs e) { if (delStatus == 1) { DialogResult dr = MessageBox.Show("Want to delete this record?", "Question.", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { Deletion.deleteData("st_deleteUsers", "@userID", userID); MainClass.resetDisable(leftpanel); RetrivalData.getUsers(dataGridView1, userIDGV, NameGV, usernameGV, passGV, phoneGV, addressGV, RoleIDGV, RoleGV); } } }
public override void deletebtn_Click(object sender, EventArgs e) { if (delStatus == 1) { DialogResult dr = MessageBox.Show("Want to delete this record?", "Question.", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { Deletion.deleteData("st_deleteFloor", "@floorID", floorID); MainClass.resetDisable(leftpanel); RetrivalData.getFloors(dataGridView1, floorIDGV, floorNameGV, floorNumberGV); } } }
public override void deletebtn_Click(object sender, EventArgs e) { if (delStatus == 1) { DialogResult dr = MessageBox.Show("Want to delete this record?", "Question.", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { Deletion.deleteData("st_deleteMenuItem", "@menuID", menuID); MainClass.resetDisable(leftpanel); RetrivalData.getMenu(dataGridView1, catIDGV, catGV, MenuItemGV, menuIDGV, priceGV, StatusGV); } } }
private void phoneTxt_Leave(object sender, EventArgs e) { try { if (phoneTxt.Text != "") { RetrivalData.getOrderBill(phoneTxt.Text, dataGridView1, ItemGV, QuantGV, amountGV, orderIDGV, totalAmountGV); BillLabel.Text = Math.Round(Convert.ToDouble(dataGridView1.Rows[0].Cells["totalAmountGV"].Value.ToString()), 0).ToString(); orderidTxt.Text = dataGridView1.Rows[0].Cells["orderIDGV"].Value.ToString(); } } catch (Exception) { MainClass.showMessage("No order found", "error"); } }
private void insertOrderDetails() { Int64 orderID = RetrivalData.lastOrderID(); int count = 0; foreach (DataGridViewRow row in dataGridView1.Rows) { count += insertion.insertOrderDetails(orderID, Convert.ToInt32(row.Cells["itemIDGV"].Value.ToString()), Convert.ToInt16(row.Cells["QuantityGV"].Value.ToString())); } if (count > 0) { } else { MainClass.showMessage("An Error Occured", "error"); } }
private void phonetxt_Leave(object sender, EventArgs e) { if (phonetxt.Text != "") { PhoneEL.Visible = false; custID = RetrivalData.getCustIDwrtPhone(phonetxt.Text); if (custID == 0) { customersWindow cw = new customersWindow(); MainClass.showWindow(cw, this, MDI.ActiveForm); } else { MainClass.showMessage(RetrivalData.CUSTOMER + "\n" + RetrivalData.ADDRESS + "\n", "success"); } } }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1 && e.ColumnIndex != -1) { DataGridViewRow row = dataGridView1.Rows[e.RowIndex]; orderID = Convert.ToInt64(row.Cells["orderIDGV"].Value.ToString()); RetrivalData.getPendingOrderdetails(orderID, dataGridView2, productGV, quantityGV); MainClass.sno(dataGridView1, "snoGV"); if (e.ColumnIndex == 3) { DialogResult dr = MessageBox.Show("Are you sure?", "Question..", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { Updates.updateOrderStatus(orderID, 1); RetrivalData.getPendingOrders(dataGridView1, orderIDGV, statusGV); MainClass.sno(dataGridView1, "snoGV"); } } } }
public override void savebtn_Click(object sender, EventArgs e) { if (MainClass.checkControls(leftpanel).Count == 0) { if (edit == 0)//save { insertion.insertCategory(categoryTxt.Text); MainClass.resetDisable(leftpanel); RetrivalData.getCategory(dataGridView1, catIDGV, catGV); } else if (edit == 1)//update { Updates.updateCategory(categoryTxt.Text, catID); MainClass.resetDisable(leftpanel); RetrivalData.getCategory(dataGridView1, catIDGV, catGV); } } else { MessageBox.Show("Please enter all required fields"); } }
public override void savebtn_Click(object sender, EventArgs e) { if (MainClass.checkControls(leftpanel).Count == 0) { if (edit == 0)//save { insertion.insertUsers(userTxt.Text, usernameTxt.Text, passwordTxt.Text, addressTxt.Text, phoneTxt.Text, Convert.ToInt16(rolesDD.SelectedValue.ToString())); MainClass.resetDisable(leftpanel); RetrivalData.getUsers(dataGridView1, userIDGV, NameGV, usernameGV, passGV, phoneGV, addressGV, RoleIDGV, RoleGV); } else if (edit == 1)//update { Updates.updateUsers(userID, userTxt.Text, usernameTxt.Text, passwordTxt.Text, addressTxt.Text, phoneTxt.Text, Convert.ToInt16(rolesDD.SelectedValue.ToString())); MainClass.resetDisable(leftpanel); RetrivalData.getUsers(dataGridView1, userIDGV, NameGV, usernameGV, passGV, phoneGV, addressGV, RoleIDGV, RoleGV); } } else { MessageBox.Show("Please enter all required fiels"); } }
public override void savebtn_Click(object sender, EventArgs e) { if (MainClass.checkControls(leftpanel).Count == 0) { if (edit == 0)//save { insertion.insertCustomer(nameTxt.Text, phoneTxt.Text, addressTxt.Text); MainClass.resetDisable(leftpanel); RetrivalData.getCustomer(dataGridView1, custIDGV, NameGV, phoneGV, addressGV); } else if (edit == 1)//update { Updates.updateCustomer(custID, nameTxt.Text, phoneTxt.Text, addressTxt.Text); MainClass.resetDisable(leftpanel); RetrivalData.getCustomer(dataGridView1, custIDGV, NameGV, phoneGV, addressGV); } } else { MessageBox.Show("Please enter all required fiels"); } }
public override void savebtn_Click(object sender, EventArgs e) { if (MainClass.checkControls(leftpanel).Count == 0) { if (edit == 0)//save { insertion.insertFloors(floorTxt.Text, Convert.ToInt16(floorNumberDD.SelectedItem.ToString())); MainClass.resetDisable(leftpanel); RetrivalData.getFloors(dataGridView1, floorIDGV, floorNameGV, floorNumberGV); } else if (edit == 1)//update { Updates.updateFloors(floorID, floorTxt.Text, Convert.ToInt16(floorNumberDD.SelectedItem.ToString())); MainClass.resetDisable(leftpanel); RetrivalData.getFloors(dataGridView1, floorIDGV, floorNameGV, floorNumberGV); } } else { MessageBox.Show("Please enter all required fields"); } }
public override void savebtn_Click(object sender, EventArgs e) { if (MainClass.checkControls(leftpanel).Count == 0) { short status = statusDD.SelectedItem == "Available" ? Convert.ToInt16(1) : Convert.ToInt16(0); if (edit == 0)//save { insertion.insertMenuItem(itemTxt.Text, Convert.ToSingle(priceTxt.Text), Convert.ToInt32(categoryDD.SelectedValue.ToString()), status); MainClass.resetDisable(leftpanel); RetrivalData.getMenu(dataGridView1, catIDGV, catGV, MenuItemGV, menuIDGV, priceGV, StatusGV); } else if (edit == 1)//update { Updates.updateMenuItem(menuID, itemTxt.Text, Convert.ToSingle(priceTxt.Text), Convert.ToInt32(categoryDD.SelectedValue.ToString()), status); MainClass.resetDisable(leftpanel); RetrivalData.getMenu(dataGridView1, catIDGV, catGV, MenuItemGV, menuIDGV, priceGV, StatusGV); } } else { MessageBox.Show("Please enter all required fields"); } }
private void TablesWindow_Load(object sender, EventArgs e) { RetrivalData.loadItems("st_getFloors", floorNumberDD, "Floor", "ID"); floorNumberDD.SelectedIndex = -1; }
private void usersWindow_Load(object sender, EventArgs e) { RetrivalData.loadItems("st_getRoles", rolesDD, "Role", "RoleID"); rolesDD.SelectedIndex = -1; roleErrorLabel.Visible = false; }
public override void viewbtn_Click(object sender, EventArgs e) { RetrivalData.getUsers(dataGridView1, userIDGV, NameGV, usernameGV, passGV, phoneGV, addressGV, RoleIDGV, RoleGV); }
public override void viewbtn_Click(object sender, EventArgs e) { RetrivalData.getCategory(dataGridView1, catIDGV, catGV); }
public override void viewbtn_Click(object sender, EventArgs e) { RetrivalData.getFloors(dataGridView1, floorIDGV, floorNameGV, floorNumberGV); }
public override void viewbtn_Click(object sender, EventArgs e) { RetrivalData.getTables(dataGridView1, floorIDGV, floorNameGV, TableNumberGV, tableIDGV, ChairsGV); }