private void EditRow() { if ((int)cbLoaiBiTich.SelectedValue == (int)LoaiBiTich.HonPhoi) { gxHonPhoiList1.EditRow(); return; } if (gxDotBiTichList1.CurrentRow == null || (gxDotBiTichList1.CurrentRow.DataRow as DataRowView) == null) { return; } frmBiTichChiTiet frm = new frmBiTichChiTiet(); frm.Operation = GxOperation.EDIT; frm.LoaiBiTich = (LoaiBiTich)cbLoaiBiTich.SelectedValue; DataRow row = (gxDotBiTichList1.CurrentRow.DataRow as DataRowView).Row; frm.MaDotBiTich = (int)row[DotBiTichConst.MaDotBiTich]; frm.AssignControlData(); if (frm.ShowDialog() == DialogResult.OK) { row[DotBiTichConst.LinhMuc] = frm.DataReturn[DotBiTichConst.LinhMuc]; row[DotBiTichConst.NgayBiTich] = frm.DataReturn[DotBiTichConst.NgayBiTich]; row[DotBiTichConst.MoTa] = frm.DataReturn[DotBiTichConst.MoTa]; } }
private void gxAddEdit1_AddClick(object sender, EventArgs e) { frmBiTichChiTiet frm = new frmBiTichChiTiet(); frm.Operation = GxOperation.ADD; frm.LoaiBiTich = (LoaiBiTich)cbLoaiBiTich.SelectedValue; if (frm.ShowDialog() == DialogResult.OK) { DataTable tbl = (DataTable)gxDotBiTichList1.DataSource; if (tbl != null) { if (frm.DataReturn != null) { tbl.ImportRow(frm.DataReturn); } } } }