private void cmdNew_Click(object sender, EventArgs e) { if (SqlDb.IsAllow(AppVariable.CURRENT_SUB_MENU, AppVariable.CURRENT_USER_LEVEL_ID.ToString(), "IsInsert") == true) { curIndex = grdViewDiagnosis.RowCount; frmDiagnosisDetail DiagnosisDetailForm = new frmDiagnosisDetail(); DiagnosisDetailForm.txtDiagnosis.Tag = string.Empty; DiagnosisDetailForm.txtDiagnosis.Text = string.Empty; DiagnosisDetailForm.cmdSave.Tag = "Add"; DiagnosisDetailForm.ShowDialog(); BindingDiagnosis(); } else { MessageBox.Show("Sorry, Administrator is not allow this action?", "MediPro :: Clinic System", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void Edit() { if (SqlDb.IsAllow(AppVariable.CURRENT_SUB_MENU, AppVariable.CURRENT_USER_LEVEL_ID.ToString(), "IsEdit") == true) { curIndex = grdViewDiagnosis.GetDataSourceRowIndex(grdViewDiagnosis.FocusedRowHandle); frmDiagnosisDetail DiagnosisDetailForm = new frmDiagnosisDetail(); DiagnosisDetailForm.txtDiagnosis.Tag = drDiagnosis.ItemArray[0].ToString(); DiagnosisDetailForm.txtDiagnosis.Text = drDiagnosis.ItemArray[1].ToString(); DiagnosisDetailForm.chkIsActive.EditValue = bool.Parse(drDiagnosis.ItemArray[2].ToString()); DiagnosisDetailForm.cmdSave.Tag = "Edit"; DiagnosisDetailForm.ShowDialog(); BindingDiagnosis(); } else { MessageBox.Show("Sorry, Administrator is not allow this action?", "MediPro :: Clinic System", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }