private void Button_Click(object sender, RoutedEventArgs e)
        {
            LoginFactory factory = null;

            if (_loginControler.FindPatient(Username.Text, Password.Password) != null)
            {
                factory = new PatientLoginFactory(_loginControler.FindPatient(Username.Text, Password.Password));
            }
            else if (_loginControler.FindSecretary(Username.Text, Password.Password) != null)
            {
                factory = new SecretaryLoginFactory(_loginControler.FindSecretary(Username.Text, Password.Password));
            }
            else if (_loginControler.FindDoctor(Username.Text, Password.Password) != null)
            {
                factory = new DoctorLoginFactory(_loginControler.FindDoctor(Username.Text, Password.Password));
            }
            else if (_loginControler.FindManager(Username.Text, Password.Password) != null)
            {
                factory = new ManagerLoginFactory(_loginControler.FindManager(Username.Text, Password.Password));
            }

            if (factory != null)
            {
                ILoginer loginer = factory.GetLoginer();
                loginer.Login();
                this.Close();
                return;
            }

            MessageBox.Show("Neuspesno logovanje!");
        }
예제 #2
0
 public AccountController(ILoginer loginer)
 {
     _loginer = loginer;
 }