private void dgw_MouseClick(object sender, MouseEventArgs e) { try { if (lblOperation.Text == "Product Master") { DataGridViewRow dr = dgw.SelectedRows[0]; this.Hide(); Meal frm = new Meal(); frm.Show(); frm.txtID.Text = dr.Cells[0].Value.ToString(); frm.txtProductID.Text = dr.Cells[1].Value.ToString(); frm.txtProductName.Text = dr.Cells[2].Value.ToString(); frm.cmbCategory.Text = dr.Cells[3].Value.ToString(); frm.txtSubCategoryID.Text = dr.Cells[4].Value.ToString(); frm.cmbSubCategory.Text = dr.Cells[5].Value.ToString(); frm.txtFeatures.Text = dr.Cells[6].Value.ToString(); frm.txtPrice.Text = dr.Cells[7].Value.ToString(); frm.txtVAT.Text = dr.Cells[8].Value.ToString(); frm.txtServiceTax.Text = dr.Cells[9].Value.ToString(); frm.txtDiscount.Text = dr.Cells[10].Value.ToString(); byte[] data = (byte[])dr.Cells[11].Value; MemoryStream ms = new MemoryStream(data); frm.pictureBox1.Image = Image.FromStream(ms); frm.btnUpdate.Enabled = true; frm.btnDelete.Enabled = true; frm.btnSave.Enabled = false; frm.lblUser.Text = lblUser.Text; lblOperation.Text = ""; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void mealPriceSettingToolStripMenuItem_Click(object sender, EventArgs e) { Meal m = new Meal(); m.Show(); }