public FrmTaoMoiNoTien(NoTien rowsend) { InitializeComponent(); idSend = rowsend.IdNoTien; txtTen.Text = rowsend.Ten; txtDiachi.Text = rowsend.Diachi; txtSotien.Text = rowsend.Sotien.ToString(); txtGhiChu.Text = rowsend.Ghichu; dtpNgayNo.Value = rowsend.Ngayno; btnOK.Text = "Cập nhật"; }
private void btnSua_Click(object sender, EventArgs e) { int index = grvNoTien.CurrentCell.RowIndex; string idSelected = grvNoTien.Rows[index].Cells[0].Value.ToString(); string sql = "select * from NoTien where idNotien=" + idSelected; DataTable table = DataProvider.Instance.ExecuteQuery(sql); NoTien rowSelected = new NoTien(table.Rows[0]); FrmTaoMoiNoTien f = new FrmTaoMoiNoTien(rowSelected); f.Show(); }