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); } } }
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"); } }
public override void viewbtn_Click(object sender, EventArgs e) { RetrivalData.getMenu(dataGridView1, catIDGV, catGV, MenuItemGV, menuIDGV, priceGV, StatusGV); }