private void btnCreate_Click(object sender, EventArgs e) { frmAddEditStageWorker frm = new frmAddEditStageWorker(cGlobalVariables.Add); if (frm.ShowDialog() == DialogResult.OK) { LoadData(); } }
private void btnEdit_Click(object sender, EventArgs e) { int id = TextUtils.ToInt(gvStageWorker.GetFocusedRowCellValue(colID)); if (id == 0) { return; } prevRow = gvStageWorker.GetSelectedRows()[0]; StageWorkerModel model = (StageWorkerModel)StageWorkerBO.Instance.FindByPK(id); frmAddEditStageWorker frm = new frmAddEditStageWorker(cGlobalVariables.Edit); frm.stageWorkerModel = model; if (frm.ShowDialog() == DialogResult.OK) { LoadData(); gvStageWorker.FocusedRowHandle = prevRow; } }