private void button_amdUser_Click(object sender, EventArgs e) { UserClinicMgr ucMgr = new UserClinicMgr(); userRegistration1.Enabled = false; if (!input_validation()) { return; } String statusMsg = ""; bool isSuccess; isSuccess = ucMgr.amdUserAccount(userRegistration1.getUserId(), (userRegistration1.getPlainTextPassword().Length > 0 ? userRegistration1.getHashedPassword() : ""), userRegistration1.getChineseName(), userRegistration1.getEnglishName(), userRegistration1.getRegNo(), false, ref statusMsg); if (isSuccess) { MessageBox.Show(statusMsg, "", MessageBoxButtons.OK, MessageBoxIcon.Information); Login.user.ChineseName = userRegistration1.getChineseName(); Login.user.EnglishName = userRegistration1.getEnglishName(); Login.user.RegNo = userRegistration1.getRegNo(); if (userRegistration1.getPlainTextPassword().Length > 0) { Login.user.HashedPw = userRegistration1.getHashedPassword(); } button_amdUser_reset_Click(sender, e); } else { MessageBox.Show(statusMsg, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } userRegistration1.Enabled = true; }
private void Doctor_MainMenu_FormClosing(object sender, FormClosingEventArgs e) { UserClinicMgr ucMgr = new UserClinicMgr(); String statusMsg = ""; bool isSuccess; isSuccess = ucMgr.logout(ref statusMsg); if (isSuccess) { MessageBox.Show(statusMsg, "", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(statusMsg, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void reset() { UserClinicMgr ucMgr = new UserClinicMgr(); textBox_userId.ReadOnly = false; textBox_userId.Clear(); textBox_chiName.Clear(); textBox_engName.Clear(); textBox_regNo.Clear(); textBox_password.Clear(); textBox_cmfPassword.Clear(); ucMgr.setUserPermissibleClinicCombo(comboBox_clinic); comboBox_clinic.SelectedIndex = 0; ucMgr.setUserPermissibleRoleCombo(comboBox_role); comboBox_role.SelectedIndex = 0; checkBox_isSuspended.Enabled = true; checkBox_isSuspended.Checked = false; }
private void button_updateClinic_Click(object sender, EventArgs e) { if (input_validation()) { UserClinicMgr ucMgr = new UserClinicMgr(); String statusMsg = ""; bool isSuccess; isSuccess = ucMgr.updateClinic(clinicRegistration1.getClinicId(), clinicRegistration1.getChineseName(), clinicRegistration1.getEnglishName(), clinicRegistration1.getAddr(), clinicRegistration1.getPhoneNo(), clinicRegistration1.getIsSuspended(), ref statusMsg); if (isSuccess) { MessageBox.Show(statusMsg, "", MessageBoxButtons.OK, MessageBoxIcon.Information); button_reset_Click(sender, e); } else { MessageBox.Show(statusMsg, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }