private void dgw_MouseClick(object sender, MouseEventArgs e) { try { if (lblOperation.Text == "Supplier Master") { DataGridViewRow dr = dgw.SelectedRows[0]; this.Hide(); Supplier frm = new Supplier(); frm.Show(); frm.txtID.Text = dr.Cells[0].Value.ToString(); frm.txtSupplierID.Text = dr.Cells[1].Value.ToString(); frm.txtSupplierName.Text = dr.Cells[2].Value.ToString(); frm.txtAddress.Text = dr.Cells[3].Value.ToString(); frm.txtCity.Text = dr.Cells[4].Value.ToString(); frm.txtContactNo.Text = dr.Cells[5].Value.ToString(); frm.txtEmailID.Text = dr.Cells[6].Value.ToString(); byte[] data = (byte[])dr.Cells[7].Value; MemoryStream ms = new MemoryStream(data); frm.Picture.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 supplierEntryToolStripMenuItem_Click(object sender, EventArgs e) { Supplier s = new Supplier(); s.Show(); }