/// <summary>
        /// Method to handle the event raised by the interface instance when manager clicks sign out
        /// Records the sign out time, hides the manager view and then creates a new login presenter for the view to switch to
        /// </summary>
        /// <param name="sender">object that raised the event</param>
        /// <param name="e">arguments of the event</param>
        private void SignOut(object sender, EventArgs e)
        {
            _serviceRegistration.RecordEndTime(_staff);
            LoginPresenter presenter = new LoginPresenter(new LoginView(), new LoginService(), new RegistrationService());

            _view.Hide();
            presenter.Run();
        }
예제 #2
0
        /// <summary>
        /// registers signing out of the staff into db, hide current view, and run login presenter
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SignOut(object sender, EventArgs e)
        {
            //capture sign out of the staff
            _service.RecordEndTime(_staff);

            //stop the simulation running
            _centralDesk.DisableTimer();

            this.Hide();//hide current view

            //create and run login view presenter
            LoginPresenter presenter = new LoginPresenter(new LoginView(), new LoginService(), new RegistrationService());

            presenter.Run();
        }