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