private void dgw_MouseClick(object sender, MouseEventArgs e) { try { if (lblOperation.Text == "Stock") { DataGridViewRow dr = dgw.SelectedRows[0]; this.Hide(); MenuStock frm = new MenuStock(); frm.Show(); frm.txtID.Text = dr.Cells[0].Value.ToString(); frm.txtStockID.Text = dr.Cells[1].Value.ToString(); frm.dtpDate.Text = dr.Cells[2].Value.ToString(); frm.txtProductID.Text = dr.Cells[3].Value.ToString(); frm.cmbProductName.Text = dr.Cells[4].Value.ToString(); frm.txtSupplierID.Text = dr.Cells[5].Value.ToString(); frm.cmbSupplierName.Text = dr.Cells[6].Value.ToString(); frm.txtQuantity.Text = dr.Cells[7].Value.ToString(); frm.txtQty1.Text = dr.Cells[7].Value.ToString(); 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 mealStockToolStripMenuItem_Click(object sender, EventArgs e) { MenuStock mStock = new MenuStock(); mStock.Show(); }