private void updateToolStripMenuItem_Click(object sender, EventArgs e) { try { frmSuathongtinkhachhang frm = new frmSuathongtinkhachhang(); frm.id = int.Parse(dtgdskh.SelectedRows[0].Cells[0].Value.ToString()); frm.name = dtgdskh.SelectedRows[0].Cells[1].Value.ToString(); frm.phone = dtgdskh.SelectedRows[0].Cells[2].Value.ToString(); frm.gender = dtgdskh.SelectedRows[0].Cells[3].Value.ToString(); frm.address = dtgdskh.SelectedRows[0].Cells[4].Value.ToString(); this.Hide(); frm.Show(); } catch (Exception) { MessageBox.Show("Không Có Dữ Liệu!"); } }
private void btnedit_Click(object sender, EventArgs e) { try { frmSuathongtinkhachhang frm = new frmSuathongtinkhachhang(); frm.id = int.Parse(dtgdskh.SelectedRows[0].Cells[0].Value.ToString()); frm.name = dtgdskh.SelectedRows[0].Cells[1].Value.ToString(); frm.phone = dtgdskh.SelectedRows[0].Cells[2].Value.ToString(); frm.gender = dtgdskh.SelectedRows[0].Cells[3].Value.ToString(); frm.address = dtgdskh.SelectedRows[0].Cells[4].Value.ToString(); this.Hide(); frm.Show(); } catch (Exception) { MessageBox.Show("Lỗi Không Có Dữ Liệu!"); } }