Example #1
0
 /// <summary>
 /// Method to show main form and hide login form
 /// </summary>
 public void ShowMainForm(UserDTO authenticatedUser)
 {
     if (authenticatedUser.NurseId > 0 || authenticatedUser.AdminId > 0)
     {
         if (authenticatedUser.IsActiveNurse || authenticatedUser.IsActiveAdmin)
         {
             this.Hide();
             if (mainTabbedForm == null)
             {
                 mainTabbedForm = new MainTabbedForm(this, authenticatedUser);
             }
             else
             {
                 mainTabbedForm.SetCurrentUser(authenticatedUser);
                 mainTabbedForm.MainTabbedForm_Load("LOGIN", EventArgs.Empty);
             }
             mainTabbedForm.Show();
         }
         else
         {
             MessageBox.Show("Your account is not activate " + Environment.NewLine + "Please activate your account.",
                             "Account Inactive", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     else
     {
         MessageBox.Show("Access denied" + Environment.NewLine + "You do not have permission to use this system.",
                         "Unauthorized", MessageBoxButtons.OK, MessageBoxIcon.Stop);
     }
 }
Example #2
0
 /// <summary>
 /// Method to set the current main form
 /// </summary>
 /// <param name="_mainForm"></param>
 public void SetMainTabbedForm(MainTabbedForm _mainTabbedForm)
 {
     this.mainTabbedForm = _mainTabbedForm;
 }