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);
         }
     }
 }
        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);
            }
        }
Exemplo n.º 3
0
        private void but_userDetails_Click(object sender, EventArgs e)
        {
            DialogResult result = Dialog_UpdateUser.Show(Common.loggedUser, false);

            displayResponseFromDialogResult(result);
        }