Example #1
0
 public AuthorizationService(IPasswordGenerator passwordGenerator,
                             MySQLUserRepository mySQLUserRepository)
 {
     this.passwordGenerator   = passwordGenerator ?? throw new ArgumentNullException(nameof(passwordGenerator));
     this.mySQLUserRepository =
         mySQLUserRepository ?? throw new ArgumentNullException(nameof(mySQLUserRepository));
 }
Example #2
0
 public UsersDialog()
 {
     this.Build();
     usersModel = new UsersModel();
     usersModel.UsersUpdated += UsersModel_UsersUpdated;
     mySQLUserRepository      = new MySQLUserRepository(new MySQLProvider(new GtkRunOperationService(), new GtkQuestionDialogsInteractive()), new GtkInteractiveService());
     ConfigureDlg();
 }
Example #3
0
 public AuthorizationService(IPasswordGenerator passwordGenerator,
                             MySQLUserRepository mySQLUserRepository,
                             IEmailParametersProvider emailParametersProvider)
 {
     _passwordGenerator   = passwordGenerator ?? throw new ArgumentNullException(nameof(passwordGenerator));
     _mySQLUserRepository =
         mySQLUserRepository ?? throw new ArgumentNullException(nameof(mySQLUserRepository));
     _emailParametersProvider = emailParametersProvider ?? throw new ArgumentNullException(nameof(emailParametersProvider));
 }
Example #4
0
 public UsersDialog(IInteractiveService interactiveService)
 {
     this.interactiveService = interactiveService ?? throw new ArgumentNullException(nameof(interactiveService));
     this.Build();
     usersModel = new UsersModel();
     usersModel.UsersUpdated += UsersModel_UsersUpdated;
     mySQLUserRepository      = new MySQLUserRepository(new MySQLProvider(new GtkRunOperationService(), new GtkQuestionDialogsInteractive()), new GtkInteractiveService());
     ConfigureDlg();
 }
Example #5
0
        public UserDialog()
        {
            this.Build();

            mySQLUserRepository = new MySQLUserRepository(new MySQLProvider(new GtkRunOperationService(), new GtkQuestionDialogsInteractive()), new GtkInteractiveService());

            User = new UserBase();

            ConfigureDlg();
        }
Example #6
0
        public UserDialog(int userId, IInteractiveService interactiveService)
        {
            this.interactiveService = interactiveService ?? throw new ArgumentNullException(nameof(interactiveService));
            this.Build();

            mySQLUserRepository = new MySQLUserRepository(new MySQLProvider(new GtkRunOperationService(), new GtkQuestionDialogsInteractive()), new GtkInteractiveService());

            User = mySQLUserRepository.GetUser(userId);

            ConfigureDlg();
        }
Example #7
0
        public EmployeeDlg(int id)
        {
            this.Build();
            logger.Info("Загрузка информации о сотруднике...");
            UoWGeneric          = UnitOfWorkFactory.CreateForRoot <Employee>(id);
            mySQLUserRepository = new MySQLUserRepository(new MySQLProvider(new GtkRunOperationService(), new GtkQuestionDialogsInteractive()), new GtkInteractiveService());

            this.authorizationService = new AuthorizationService(
                new PasswordGenerator(),
                new MySQLUserRepository(
                    new MySQLProvider(new GtkRunOperationService(), new GtkQuestionDialogsInteractive()),
                    new GtkInteractiveService()));

            ConfigureDlg();
        }
Example #8
0
        public EmployeeDlg()
        {
            this.Build();
            UoWGeneric                = UnitOfWorkFactory.CreateWithNewRoot <Employee>();
            mySQLUserRepository       = new MySQLUserRepository(new MySQLProvider(new GtkRunOperationService(), new GtkQuestionDialogsInteractive()), new GtkInteractiveService());
            this.authorizationService = new AuthorizationService(
                new PasswordGenerator(),
                new MySQLUserRepository(
                    new MySQLProvider(new GtkRunOperationService(), new GtkQuestionDialogsInteractive()),
                    new GtkInteractiveService()));


            TabName = "Новый сотрудник";
            ConfigureDlg();
        }
Example #9
0
        public EmployeeDlg(IUnitOfWorkGeneric <Employee> uow)
        {
            this.Build();
            UoWGeneric = uow;
            if (!ServicesConfig.CommonServices.CurrentPermissionService.ValidatePresetPermission("can_change_trainee_to_driver"))
            {
                hiddenCategory.Add(EmployeeCategory.driver);
                hiddenCategory.Add(EmployeeCategory.forwarder);
            }
            mySQLUserRepository       = new MySQLUserRepository(new MySQLProvider(new GtkRunOperationService(), new GtkQuestionDialogsInteractive()), new GtkInteractiveService());
            this.authorizationService = new AuthorizationService(
                new PasswordGenerator(),
                new MySQLUserRepository(
                    new MySQLProvider(new GtkRunOperationService(), new GtkQuestionDialogsInteractive()),
                    new GtkInteractiveService()));

            ConfigureDlg();
        }