private string frameMailBody(Entity_Staff staffObj)
        {
            string mailBody = Labels.NEW_USER_MAIL_BODY;

            mailBody = Utility.replaceKeyword(mailBody, Constant.RECOVERY_STAFF_NAME, Common.loggedUser.staffName + "/" + staffObj.staffName);
            mailBody = Utility.replaceKeyword(mailBody, Constant.RECOVERY_STAFF_ID, staffObj.staffId.ToString());
            mailBody = Utility.replaceKeyword(mailBody, Constant.RECOVERY_STAFF_PWD, Utility.generateTempUserPassword(staffObj));

            return(mailBody);
        }
 private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (!listView1.CheckBoxes)
     {
         Entity_Staff stafObj = listView1.SelectedItems[0].Tag as Entity_Staff;
         DialogResult result  = Dialog_UpdateUser.Show(stafObj, true);
         if (result == DialogResult.Yes)
         {
             homeForm.but_manageUsers_sidePanel.PerformClick();
             Dialog_MyMessageBox.Show(Constant.UPDATE_SUCCESS, 1, UiColors.MESSAGE_SUCCESS);
         }
         else if (result == DialogResult.Retry)
         {
             Dialog_MyMessageBox.Show(Constant.EXCEPTION, 1, UiColors.MESSAGE_ERROR);
         }
     }
 }
Example #3
0
        private void startBackgroundThread(bool dialogRequired, bool addNewUser, Entity_Staff userObj)
        {
            if (!backgroundWorker1.IsBusy)
            {
                if (dialogRequired)
                {
                    myProgressDialog = new DIalog_ProgressBar();
                    this.Opacity     = 0.8;
                    myProgressDialog.Show();
                }

                var objectMap = new Dictionary <string, Object>();
                objectMap.Add("staffObj", userObj);
                objectMap.Add("operation", addNewUser);

                backgroundWorker1.RunWorkerAsync(objectMap);
            }
        }
        private void pic_addUser_Click(object sender, EventArgs e)
        {
            var          newUser = new Entity_Staff();
            DialogResult result  = Dialog_UpdateUser.Show(newUser);

            if (result == DialogResult.Yes)
            {
                homeForm.but_manageUsers_sidePanel.PerformClick();
                Dialog_MyMessageBox.Show(Constant.USER_ADDED_SUCCESS +
                                         "\nUserID: " + newUser.staffId + " ;; Password: " + Utility.generateTempUserPassword(newUser), 1, UiColors.MESSAGE_SUCCESS);

                //if (!backgroundWorker1.IsBusy)
                //    backgroundWorker1.RunWorkerAsync(newUser);
            }
            else if (result == DialogResult.Retry)
            {
                Dialog_MyMessageBox.Show(Constant.USER_ADDED_FAILED, 1, UiColors.MESSAGE_ERROR);
            }
        }
Example #5
0
        public static DialogResult Show(Entity_Staff user)
        {
            dialogUser = new Dialog_UpdateUser();
            Placement_Application.Components.Resolution res = new Placement_Application.Components.Resolution();
            res.ResizeForm(dialogUser, 580, 1050);
            dialogUser.StartPosition = FormStartPosition.CenterParent;

            dialogUser.Opacity = Common.dialogOpacity;
            isNewUser          = true;
            currentUser        = user;

            dialogUser.label_studentId.Text = Labels.ADD_USER;
            dialogUser.but_update.Text      = Labels.ADD;

            dialogUser.textBox_userName.Focus();
            dialogUser.ShowDialog();

            return(result);
        }
Example #6
0
        public static DialogResult Show(Entity_Staff user, bool forOtherUser)
        {
            dialogUser = new Dialog_UpdateUser();
            Placement_Application.Components.Resolution res = new Placement_Application.Components.Resolution();
            res.ResizeForm(dialogUser, Common.dialog_height, Common.dialog_width);

            dialogUser.Opacity = Common.dialogOpacity;
            currentUser        = user;
            isNewUser          = false;
            isAdminRequest     = forOtherUser;

            dialogUser.textBox_userName.Text = currentUser.staffName;
            dialogUser.textBox_email.Text    = currentUser.email;
            dialogUser.textBox_contact.Text  = currentUser.phone;

            dialogUser.textBox_userName.Focus();
            dialogUser.ShowDialog();

            return(result);
        }
Example #7
0
 public bool updateStaffDetails(Entity_Staff staffObj)
 {
     Utility.logFile(Constant.METHOD_ENTER + Utility.getCurrentMethodName(1) + "(StaffManagerImpl)", null, Constant.LOGTYPE_INFO);
     return(persistence.update(staffObj));
 }
Example #8
0
 public bool addNewUser(Entity_Staff newUser)
 {
     Utility.logFile(Constant.METHOD_ENTER + Utility.getCurrentMethodName(1) + "(StaffManagerImpl)", null, Constant.LOGTYPE_INFO);
     newUser.password = Utility.getMD5Value(Utility.generateTempUserPassword(newUser));
     return(persistence.save(newUser));
 }