private void btnedit_Click(object sender, EventArgs e) { try { frmSuathongtinmuahang frm = new frmSuathongtinmuahang(); frm.purchasedate = dtgmuahang.SelectedRows[0].Cells[2].Value.ToString(); frm.productname = dtgmuahang.SelectedRows[0].Cells[1].Value.ToString(); frm.money = dtgmuahang.SelectedRows[0].Cells[3].Value.ToString(); frm.index = int.Parse(dtgmuahang.SelectedRows[0].Cells[0].Value.ToString()); frm.id = id; frm.name = name; frm.phone = phone; frm.gender = gender; frm.address = address; this.Hide(); frm.Show(); } catch (Exception) { MessageBox.Show("Không Có Dữ liệu!"); } }
private void btnedit_Click(object sender, EventArgs e) { try { frmSuathongtinmuahang frm = new frmSuathongtinmuahang(); frm.purchasedate = dtgmuahang.SelectedRows[0].Cells[2].Value.ToString(); frm.productname = dtgmuahang.SelectedRows[0].Cells[1].Value.ToString(); frm.money = dtgmuahang.SelectedRows[0].Cells[3].Value.ToString(); frm.index = int.Parse(dtgmuahang.SelectedRows[0].Cells[0].Value.ToString()); frm.id = id; frm.name = name; frm.phone = phone; frm.gender = gender; frm.address = address; this.Hide(); frm.Show(); } catch (Exception) { MessageBox.Show("Không Có Dữ liệu!"); } }