private void dgvMembers_CellClick(object sender, DataGridViewCellEventArgs e) { dgvProduct.DataSource = null; string inde = dgvMembers.CurrentRow.Cells[0].Value.ToString(); //MessageBox.Show(index); mem.LoadDGVPackage(dgvPackage, inde); mem.loadDGVProduct(dgvProduct, inde); btEditMachine.Enabled = true; string index = dgvMembers.CurrentRow.Cells[0].Value.ToString(); DataTable dt = new DataTable(); dt = getmem.getMemberbyID(index); GetEditMember.FName = dt.Rows[0][1].ToString(); GetEditMember.LName = dt.Rows[0][2].ToString(); GetEditMember.Address = dt.Rows[0][5].ToString(); GetEditMember.Birthday = Convert.ToDateTime(dt.Rows[0][4].ToString()); GetEditMember.IDCard = dt.Rows[0][8].ToString(); GetEditMember.Phone = dt.Rows[0][7].ToString(); GetEditMember.Gender = dt.Rows[0][6].ToString(); GetEditMember.IDMember = index; try { byte[] picPD; picPD = (byte[])dt.Rows[0][3]; MemoryStream pic = new MemoryStream(picPD); GetEditMember.Picture = Image.FromStream(pic); } catch { } }
string getMemName() { string memName = null; MEMBERs mem = new MEMBERs(); string memID = null; memID = dgvContracts.CurrentRow.Cells[1].Value.ToString(); DataTable dt = new DataTable(); dt = mem.getMemberbyID(memID); memName = dt.Rows[0][1].ToString() + " " + dt.Rows[0][2].ToString(); return memName; }