Exemplo n.º 1
0
 public Handler(LoginStudentService loginStudentService, LoginTeacherService loginTeacherService, TestStudentService testService, TestTeacherService testTeacherService)
 {
     LoginStudentService = loginStudentService;
     LoginTeacherService = loginTeacherService;
     TestStudentService  = testService;
     TestTeacherService  = testTeacherService;
 }
Exemplo n.º 2
0
 public override async Task HandlerRequest(Command command, Client client)
 {
     if (command.UserCommand == UserCommandServer.NoCommand && command.AdminCommand == AdminCommandServer.SignUp)
     {
         Command sendCommand = new Command();
         if (await LoginTeacherService.AddNewUserAsync(new RegistrationViewModel()
         {
             FullName = command.Teacher.FullName, Login = command.Teacher.Login, Password = command.Teacher.Password, Subject = command.Teacher.Subject
         }))
         {
             sendCommand.IsSignIn = true;
             sendCommand.Id       = LoginTeacherService.CurrentUser.Id;
         }
         else
         {
             sendCommand.IsSignIn = false;
         }
         client.SendCommand(sendCommand);
     }
     else if (Successor != null)
     {
         await Successor.HandlerRequest(command, client);
     }
 }
Exemplo n.º 3
0
 public SignUpTeacherHandler(LoginStudentService loginStudentService, LoginTeacherService loginTeacherService, TestStudentService testService, TestTeacherService testTeacherService)
     : base(loginStudentService, loginTeacherService, testService, testTeacherService)
 {
 }
Exemplo n.º 4
0
 public GetListTestsHandler(LoginStudentService loginStudentService, LoginTeacherService loginTeacherService, TestStudentService testService, TestTeacherService testTeacherService)
     : base(loginStudentService, loginTeacherService, testService, testTeacherService)
 {
 }