Esempio n. 1
0
 private void CloseCurrentOpenView(frmBaseView currentViewOpenToClose)
 {
     if (currentViewOpenToClose != null)
     {
         currentViewOpenToClose.Close();
     }
 }
Esempio n. 2
0
        private void OpenLoginView()
        {
            loginController = new LoginController(this, new frmLogin());

            //register the handler for logged on event
            loginController.LoggedIn += this.OnLoggedIn;
            AddToContainer(loginController, MIDDLE);
            currentViewOpened = null;
            selectedPatient   = null;
            currentUser       = null;
        }
Esempio n. 3
0
        private void AddToContainer(ControllerBase thisController, int level)
        {
            switch (level)
            {
            case MIDDLE:
                thisController.mainForm.pMiddle.Controls.Add(thisController.thisView);
                currentViewOpened = thisController.thisView;
                thisController.Show();
                break;

            case TOP:
                thisController.mainForm.pTop.Controls.Add(thisController.thisView);
                thisController.Show();
                break;

            case RIGHT:
                thisController.mainForm.pRight.Controls.Add(thisController.thisView);
                pRight.Visible = true;
                thisController.Show();
                break;
            }
        }
Esempio n. 4
0
        private void setUserViewByType(int userType)
        {
            switch (userType)
            {
            case (int)UserType.Administrator:

                adminLoggedInViewController = new AdminLoggedInViewController(this, new frmAdminMenuSelectView());
                //currentAdmin = eClinicalsController.GetAdminByID(currentUser.ContactID);
                CloseCurrentOpenView(currentViewOpened);
                currentViewOpened = adminLoggedInViewController.thisView;
                AddToContainer(adminLoggedInViewController, MIDDLE);
                adminLoggedInViewController.frmAdminMenuSelectView.btnGenerateReport.Click += new EventHandler(btnGenerateReport_Click);
                setNotification(2000, "Important notice", "eClinicals Login status: Admin", ToolTipIcon.Info, NoticeType.Administrator);
                Status("Admin View Open", Color.Yellow);
                break;

            case (int)UserType.Nurse:
                currentNurse = eClinicalsController.GetNurseByID(currentUser.ContactID);
                nurseLoggedInViewController = new NurseLoggedInViewController(this, new frmNurseMenuSelectView());
                CloseCurrentOpenView(currentViewOpened);
                currentViewOpened = nurseLoggedInViewController.thisView;
                AddToContainer(nurseLoggedInViewController, MIDDLE);
                nurseLoggedInViewController.frmNurseMenuSelectView.btnFindPatientRecord.Click += new EventHandler(btnFindPatientRecord_Click);
                nurseLoggedInViewController.frmNurseMenuSelectView.btnRegisterAPatient.Click  += new EventHandler(btnRegisterAPatient_Click);
                setNotification(2000, "Important notice", "eClinicals Login status: Nurse", ToolTipIcon.Info, NoticeType.Nurse);

                Status("Nurses View Open", Color.Yellow);
                break;

            case (int)UserType.Doctor:
                MessageBox.Show("There is no view for user type : Doctor");
                Status("There is no view for user type : Doctor", Color.Red);
                break;

            default:
                break;
            }
        }