private string InputForm(string codeGen) { FrmInputCode frm = new FrmInputCode(codeGen.Substring(5, 3), codeGen.Substring(0, 5), 3); frm.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { codeGen = frm.name + frm.code; } return(codeGen); }
private void gridView_DonViCoSo_RowCellClick(object sender, RowCellClickEventArgs e) { if (e.RowHandle >= 0) { GridColumn column = e.Column; if (column.Name == this.col_th_MaDVCS.Name) { string code = e.CellValue.ToString(); if (XtraMessageBox.Show("Bạn có muốn thay đổi mã " + code + " không?", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.No) { int result = 0; do { FrmInputCode frm = new FrmInputCode(code.Substring(5, 3), code.Substring(0, 5), 3); frm.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { code = frm.name + frm.code; if (CheckCodeExist(code)) { result = 0; gridView_DonViCoSo.SetRowCellValue(e.RowHandle, e.Column, code); } else { result = 1; } } else { result = 0; } } while (result == 1); } } } }
private void gridView_ChiCuc_RowCellClick(object sender, RowCellClickEventArgs e) { if (e.RowHandle >= 0) { GridColumn column = e.Column; if (column.Name == this.col_th_MaChiCuc.Name) { string code = e.CellValue.ToString(); if (XtraMessageBox.Show("Bạn có muốn thay đổi mã " + code + " không?", "Bệnh viện điện tử .NET", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.No) { int result = 0; do { FrmInputCode frm = new FrmInputCode(code.Substring(3, 2), code.Substring(0, 3), 2); frm.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { code = frm.name + frm.code; if (CheckCodeExist(code)) { result = 0; gridView_ChiCuc.SetRowCellValue(e.RowHandle, e.Column, code); } else { result = 1; } } else { result = 0; } } while (result == 1); } } } }