コード例 #1
0
        public PeLImpl()
        {
            //this.connectionString = Properties.Settings.Default.TablesConnectionString;
            //Console.WriteLine("Database path: " + this.connectionString);

            systemUserRepository = new SystemUserRepository();
        }
コード例 #2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public MapAppService(
     IMapRepository iMapRepository,
     IDicDataCodeRepository iDicDataCodeRepository,
     IMapReleationRepository iMapReleationRepository,
     ITagReleationRepository iTagReleationRepository,
     IMapMetaDataRepository iMapMetaDataRepository,
     IDataTagRepository iDataTagRepository,
     IDataTypeRepository iDataTypeRepository,
     ILayerContentRepository iLayerContentRepository,
     ILayerFieldRepository iLayerFieldRepository,
     ISystemUserRepository iSystemUserRepository,
     IOperateLogAppService iOperateLogAppService)
 {
     _IMapRepository          = iMapRepository;
     _IDicDataCodeRepository  = iDicDataCodeRepository;
     _IMapReleationRepository = iMapReleationRepository;
     _ITagReleationRepository = iTagReleationRepository;
     _IMapMetaDataRepository  = iMapMetaDataRepository;
     _IDataTagRepository      = iDataTagRepository;
     _IDataTypeRepository     = iDataTypeRepository;
     _ILayerContentRepository = iLayerContentRepository;
     _ILayerFieldRepository   = iLayerFieldRepository;
     _ISystemUserRepository   = iSystemUserRepository;
     _SystemUserApp           = new SystemUserAppService(_ISystemUserRepository);
     _IOperateLogAppService   = iOperateLogAppService;
 }
コード例 #3
0
 public SystemUserManager(ISystemUserRepository systemUserRepository, IMapper mapper, IEncrypService encrypService, IEmailService emailService)
 {
     _systemUserRepository = systemUserRepository;
     _mapper        = mapper;
     _encrypService = encrypService;
     _emailService  = emailService;
 }
コード例 #4
0
 public FlowChartPlanService(
     IFlowChartMasterRepository flowChartMasterRepository,
     IFlowChartDetailRepository flowChartDetailRepository,
     IFlowChartMgDataRepository flowChartMgDataRepository,
     IFlowChartIEMgDataRepository flowChartIEMgDataRepository,
     ISystemBUDRepository systemBUDRepository,
     ISystemProjectRepository systemProjectRepository,
     ISystemFunctionPlantRepository systemFunctionPlantRepository,
     ISystemUserRepository systemUserRepository,
     ISystemUserRoleRepository systemUserRoleRepository,
     IFlowChartPCMHRelationshipRepository flowChartPCMHRelationshipRepository,
     ISystemRoleRepository systemRoleRepository,
     ISystemUserOrgRepository systemUserOrgRepository,
     IProjectUsersGroupRepository projectUsersGroupRepository,
     ISystemOrgRepository systemOrgRepository,
     ISystemOrgBomRepository systemOrgBomRepository,
     IUnitOfWork unitOfWork)
 {
     this.systemRoleRepository                = systemRoleRepository;
     this.unitOfWork                          = unitOfWork;
     this.flowChartMasterRepository           = flowChartMasterRepository;
     this.flowChartDetailRepository           = flowChartDetailRepository;
     this.flowChartMgDataRepository           = flowChartMgDataRepository;
     this.flowChartIEMgDataRepository         = flowChartIEMgDataRepository;
     this.systemProjectRepository             = systemProjectRepository;
     this.systemBUDRepository                 = systemBUDRepository;
     this.systemFunctionPlantRepository       = systemFunctionPlantRepository;
     this.systemUserRepository                = systemUserRepository;
     this.systemUserRoleRepository            = systemUserRoleRepository;
     this.flowChartPCMHRelationshipRepository = flowChartPCMHRelationshipRepository;
     this.systemUserOrgRepository             = systemUserOrgRepository;
     this.projectUsersGroupRepository         = projectUsersGroupRepository;
     this.systemOrgRepository                 = systemOrgRepository;
     this.systemOrgBomRepository              = systemOrgBomRepository;
 }
コード例 #5
0
ファイル: LoginChecker.cs プロジェクト: joaomajesus/Tarantino
		public bool IsValidUser(string emailAddress, string cleartextPassword, ISystemUserRepository repository)
		{
			string encryptedPassword = _encryptionEngine.Encrypt(cleartextPassword);
			bool isValidUser = repository.IsValidLogin(emailAddress, encryptedPassword);

			return isValidUser;
		}
コード例 #6
0
ファイル: CommonService.cs プロジェクト: HJ520134/PIS
 public CommonService(
     ISystemUserRepository systemUserRepository,
     ISystemRoleRepository systemRoleRepository,
     ISystemPlantRepository systemPlantRepository,
     ISystemOrgRepository systemOrgRepository,
     ISystemBUMRepository systemBUMRepository,
     ISystemBUDRepository systemBUDRepository,
     IFlowChartPCMHRelationshipRepository flowChartPCMHRelationshipRepository,
     ISystemOrgBomRepository systemOrgBomRepository,
     IProjectUsersGroupRepository projectUsersGroupRepository,
     ISystemUserOrgRepository systemUserOrgRepository,
     ISystemUserBusinessGroupRepository systemUserBusinessGroupRepository,
     ISystemProjectRepository systemProjectRepository,
     IFlowChartMasterRepository flowChartMasterRepository,
     IFlowChartMgDataRepository flowChartMgDataRepository,
     ISystemLocaleStringResourceRepository systemLocaleStringResourceRepository,
     IUnitOfWork unitOfWork)
 {
     this.systemUserRepository  = systemUserRepository;
     this.systemRoleRepository  = systemRoleRepository;
     this.systemPlantRepository = systemPlantRepository;
     this.systemOrgRepository   = systemOrgRepository;
     this.systemBUMRepository   = systemBUMRepository;
     this.systemBUDRepository   = systemBUDRepository;
     this.flowChartPCMHRelationshipRepository = flowChartPCMHRelationshipRepository;
     this.systemOrgBomRepository               = systemOrgBomRepository;
     this.projectUsersGroupRepository          = projectUsersGroupRepository;
     this.systemUserOrgRepository              = systemUserOrgRepository;
     this.systemUserBusinessGroupRepository    = systemUserBusinessGroupRepository;
     this.systemProjectRepository              = systemProjectRepository;
     this.flowChartMasterRepository            = flowChartMasterRepository;
     this.systemLocaleStringResourceRepository = systemLocaleStringResourceRepository;
     this.flowChartMgDataRepository            = flowChartMgDataRepository;
     this.unitOfWork = unitOfWork;
 }
コード例 #7
0
        public void Should_send_forgotten_password_email_when_email_address_exists()
        {
            MailMessage forgottenPasswordEmail = new MailMessage();

            MockRepository mocks = new MockRepository();
            ISystemUser    user  = mocks.CreateMock <ISystemUser>();
            IForgottenPasswordMailFactory mailFactory      = mocks.CreateMock <IForgottenPasswordMailFactory>();
            ISystemUserRepository         repository       = mocks.CreateMock <ISystemUserRepository>();
            IEncryptionEngine             encryptionEngine = mocks.CreateMock <IEncryptionEngine>();
            IMailSender sender = mocks.CreateMock <IMailSender>();

            using (mocks.Record())
            {
                Expect.Call(repository.GetByEmailAddress("*****@*****.**")).Return(user);
                Expect.Call(user.Password).Return("encryptedPassword");
                Expect.Call(encryptionEngine.Decrypt("encryptedPassword")).Return("clearTextPassword");

                Expect.Call(mailFactory.CreateEmail("*****@*****.**", "clearTextPassword")).Return(forgottenPasswordEmail);

                sender.SendMail(forgottenPasswordEmail);
            }

            using (mocks.Playback())
            {
                IForgottenPasswordMailer mailer = new ForgottenPasswordMailer(encryptionEngine, mailFactory, sender);
                bool emailWasSent = mailer.SendForgottenPasswordEmail("*****@*****.**", repository);
                Assert.That(emailWasSent);
            }

            mocks.VerifyAll();
        }
コード例 #8
0
        public async Task LoginWhenEncrypServiceThrowShouldReturnFailOperationResult()
        {
            ISystemUserRepository systemUserRepository = Substitute.For <ISystemUserRepository>();
            IUserService          userService          = Substitute.For <IUserService>();
            IEncrypService        encrypService        = Substitute.For <IEncrypService>();

            SystemUser userResult = new SystemUser {
                Active = true
            };

            systemUserRepository.FindAsync(Arg.Any <Expression <Func <SystemUser, bool> > >()).Returns(userResult);

            encrypService.EncrypText(Arg.Any <string>()).Throws(new Exception());

            AuthenticationManager authenticationManager = new AuthenticationManager(systemUserRepository, userService, encrypService);

            AuthenticationRequest authenticationRequest = new AuthenticationRequest
            {
                Username = "******",
                Password = "******"
            };

            IOperationResult <AuthenticationViewModel> actual = await authenticationManager.Login(authenticationRequest);

            Assert.IsFalse(actual.Success);
            Assert.AreEqual("Ha ocurrido un error en la autenticación del usuario", actual.Message);
        }
コード例 #9
0
 public SystemUserLogic(ISystemUserRepository systemUserRepository,
                        ICurrentTimeProvider currentTimeProvider)
     : base(systemUserRepository)
 {
     _systemUserRepository = systemUserRepository;
     _currentTimeProvider  = currentTimeProvider;
 }
コード例 #10
0
ファイル: LoginChecker.cs プロジェクト: mhinze/Tarantino
        public bool IsValidUser(string emailAddress, string cleartextPassword, ISystemUserRepository repository)
        {
            string encryptedPassword = _encryptionEngine.Encrypt(cleartextPassword);
            bool   isValidUser       = repository.IsValidLogin(emailAddress, encryptedPassword);

            return(isValidUser);
        }
コード例 #11
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public OperateLogAppService(IOperateLogRepository iOperateLogRepository,
                             ISystemUserRepository iSystemUserRepository,
                             IAreaAppService iAreaAppService)
 {
     _IOperateLogRepository = iOperateLogRepository;
     _ISystemUserRepository = iSystemUserRepository;
     _IAreaAppService       = iAreaAppService;
 }
コード例 #12
0
        public SystemProfileAppService(ISystemProfileRepository systemProfileRepository, ISystemUserRepository systemUserRepository, IMapper mapper)
        {
            _systemProfileRepository = systemProfileRepository;

            _systemUserRepository = systemUserRepository;

            _mapper = mapper;
        }
コード例 #13
0
 public SystemPermissionLogic(IRepository <SystemPermission, Guid> repository, ISystemPermissionDapperRepository systemPermissionDapperRepository, ISystemMenuButtonDapperRepository systemMenuButtonDapperRepository, ISystemMenuRepository menuRepository, ISystemUserRepository userRepository, ISystemPermissionUserRepository permissionUserRepository, IMemoryCache cache) : base(repository)
 {
     _systemPermissionDapperRepository = systemPermissionDapperRepository;
     _systemMenuButtonDapperRepository = systemMenuButtonDapperRepository;
     _menuRepository           = menuRepository;
     _userRepository           = userRepository;
     _permissionUserRepository = permissionUserRepository;
     _cache = cache;
 }
コード例 #14
0
        public SystemUserLogic(ISystemUserRepository systemUserRepository,
                               ICacheManager cacheManager,
                               IUnitOfWorkFactory unitOfWorkFactory,
                               ITimeSource timeSource)
        {
            _systemUserRepository = systemUserRepository;
            _cacheManager         = cacheManager;
            _unitOfWorkFactory    = unitOfWorkFactory;

            _timeSource = timeSource;
        }
コード例 #15
0
 public PlayBoard_SettingService(IUnitOfWork unitOfWork, IPlayBoard_SettingRepository settingRepository
                                 , ISystemUserOrgRepository systemUserOrgRepository, ISystemUserRepository systemUserRepository
                                 , IPlayBoard_ViewRepository playBoardViewRepository, IPlayBoard_PlayTimeRepository playBoardPlayTimeRepository) : base(settingRepository)
 {
     this.unitOfWork                  = unitOfWork;
     this.settingRepository           = settingRepository;
     this.systemUserOrgRepository     = systemUserOrgRepository;
     this.systemUserRepository        = systemUserRepository;
     this.playBoardViewRepository     = playBoardViewRepository;
     this.playBoardPlayTimeRepository = playBoardPlayTimeRepository;
 }
コード例 #16
0
 public SystemPermissionLogic(
     ISystemPermissionRepository systemPermissionRepository,
     ISystemMenuRepository menuRepository,
     ISystemUserRepository userRepository, ISystemPermissionUserRepository permissionUserRepository, ISystemMenuButtonRepository buttonRepository, IMemoryCache cache) : base(systemPermissionRepository)
 {
     _systemPermissionRepository    = systemPermissionRepository;
     this._menuRepository           = menuRepository;
     this._userRepository           = userRepository;
     this._permissionUserRepository = permissionUserRepository;
     this._buttonRepository         = buttonRepository;
     this._cache = cache;
 }
コード例 #17
0
        public async Task GetDashBoarDataWhenActiveUsersQuantityFailShouldReturnOperationResultFail()
        {
            ISystemUserRepository systemUserRepository = Substitute.For <ISystemUserRepository>();

            systemUserRepository.CountAsync(Arg.Any <Expression <Func <SystemUser, bool> > >()).Throws(new Exception());

            DashBoardManager dashBoardManager = new DashBoardManager(systemUserRepository);

            IOperationResult <DashBoardViewModel> actual = await dashBoardManager.GetDashBoarData();

            Assert.IsFalse(actual.Success);
            Assert.AreEqual("Ha ocurrido un error al cargar los datos del tablero", actual.Message);
        }
コード例 #18
0
        public async Task LoginWhenModelIsNullShouldReturnFailOperationResult()
        {
            ISystemUserRepository systemUserRepository = Substitute.For <ISystemUserRepository>();
            IUserService          userService          = Substitute.For <IUserService>();
            IEncrypService        encrypService        = Substitute.For <IEncrypService>();

            AuthenticationManager authenticationManager = new AuthenticationManager(systemUserRepository, userService, encrypService);

            IOperationResult <AuthenticationViewModel> actual = await authenticationManager.Login(null);

            Assert.IsFalse(actual.Success);
            Assert.AreEqual("La autenticacion no puede estar nula", actual.Message);
        }
コード例 #19
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="repository"></param>
 /// <param name="logger"></param>
 public SystemUserService(ISystemUserRepository repository,
                          IMenuRepository menuRepository,
                          IRepository <int, ActionRole> actionRoleRepository,
                          IRepository <int, ActionPermissions> actionRepository,
                          IRepository <int, ControllerPermissions> controllerRepository,
                          ILogger <SystemUserService> logger) : base(repository, logger: logger)
 {
     this._actionRoleRepository = actionRoleRepository;
     this._controllerRepository = controllerRepository;
     this._menuRepository       = menuRepository;
     this._systemUserRepository = repository as ISystemUserRepository;
     this._actionRepository     = actionRepository;
 }
コード例 #20
0
 public SystemService(
     ISystemFunctionRepository systemFunctionRepository,
     ISystemUserRepository systemUserRepository,
     ISystemBUMRepository systemBUMRepository,
     ISystemPlantRepository systemPlantRepository,
     IUnitOfWork unitOfWork)
 {
     this.systemFunctionRepository = systemFunctionRepository;
     this.systemUserRepository     = systemUserRepository;
     this.systemBUMRepository      = systemBUMRepository;
     this.systemPlantRepository    = systemPlantRepository;
     this.unitOfWork = unitOfWork;
 }
コード例 #21
0
		public bool SendForgottenPasswordEmail(string recipientEmailAddress, ISystemUserRepository repository)
		{
			ISystemUser matchingUser = repository.GetByEmailAddress(recipientEmailAddress);

			bool sendEmail = (matchingUser != null);

			if (sendEmail)
			{
				string clearTextPassword = _encryptionEngine.Decrypt(matchingUser.Password);
				MailMessage mail = _mailFactory.CreateEmail(recipientEmailAddress, clearTextPassword);
				_mailSender.SendMail(mail);
			}

			return sendEmail;
		}
コード例 #22
0
        public bool SendForgottenPasswordEmail(string recipientEmailAddress, ISystemUserRepository repository)
        {
            ISystemUser matchingUser = repository.GetByEmailAddress(recipientEmailAddress);

            bool sendEmail = (matchingUser != null);

            if (sendEmail)
            {
                string      clearTextPassword = _encryptionEngine.Decrypt(matchingUser.Password);
                MailMessage mail = _mailFactory.CreateEmail(recipientEmailAddress, clearTextPassword);
                _mailSender.SendMail(mail);
            }

            return(sendEmail);
        }
コード例 #23
0
        public async Task GetDashBoarDataWhenAllSuccessShouldReturnOperationResultSuccess()
        {
            ISystemUserRepository systemUserRepository = Substitute.For <ISystemUserRepository>();

            systemUserRepository.CountAsync().Returns(1);
            systemUserRepository.CountAsync(Arg.Any <Expression <Func <SystemUser, bool> > >()).Returns(2);

            DashBoardManager dashBoardManager = new DashBoardManager(systemUserRepository);

            IOperationResult <DashBoardViewModel> actual = await dashBoardManager.GetDashBoarData();

            Assert.IsTrue(actual.Success);
            Assert.AreEqual(actual.Entity.RegisteredUsersQuantity, 1);
            Assert.AreEqual(actual.Entity.ActiveUsersQuantity, 2);
        }
コード例 #24
0
        public void SetUp()
        {
            systemUserRepository = Substitute.For <ISystemUserRepository>();
            mapper        = Substitute.For <IMapper>();
            encrypService = Substitute.For <IEncrypService>();
            emailService  = Substitute.For <IEmailService>();

            systemUserCreateViewModel = new SystemUserCreateViewModel
            {
                Name     = "nombre prueba",
                Email    = "correo prueba",
                Lastname = "apellido prueba",
                Username = "******",
                Password = "******"
            };
        }
コード例 #25
0
ファイル: LoginService.cs プロジェクト: joaomajesus/Tarantino
		public string Login(string emailAddress, string password, bool rememberMe, ISystemUserRepository repository)
		{
			string userFeedback = null;

			bool isValidLogin = _loginChecker.IsValidUser(emailAddress, password, repository);

			if (isValidLogin)
			{
				_authenticationService.RedirectFromLoginPage(emailAddress, rememberMe);
			}
			else
			{
				userFeedback = "Invalid e-mail address/password: Please try again";
			}

			return userFeedback;
		}
コード例 #26
0
ファイル: LoginService.cs プロジェクト: mhinze/Tarantino
        public string Login(string emailAddress, string password, bool rememberMe, ISystemUserRepository repository)
        {
            string userFeedback = null;

            bool isValidLogin = _loginChecker.IsValidUser(emailAddress, password, repository);

            if (isValidLogin)
            {
                _authenticationService.RedirectFromLoginPage(emailAddress, rememberMe);
            }
            else
            {
                userFeedback = "Invalid e-mail address/password: Please try again";
            }

            return(userFeedback);
        }
コード例 #27
0
 public FlowChartMasterService(
     IFlowChartMasterRepository flowChartMasterRepository,
     IFlowChartDetailRepository flowChartDetailRepository,
     IFlowChartMgDataRepository flowChartMgDataRepository,
     ISystemBUDRepository systemBUDRepository,
     ISystemProjectRepository systemProjectRepository,
     ISystemFunctionPlantRepository systemFunctionPlantRepository,
     ISystemUserRepository systemUserRepository,
     ISystemUserRoleRepository systemUserRoleRepository,
     IFlowChartPCMHRelationshipRepository flowChartPCMHRelationshipRepository,
     ISystemRoleRepository systemRoleRepository,
     ISystemUserOrgRepository systemUserOrgRepository,
     IProjectUsersGroupRepository projectUsersGroupRepository,
     ISystemOrgRepository systemOrgRepository,
     ISystemOrgBomRepository systemOrgBomRepository,
     IQualityAssuranceMgDataRepository qualityAssuranceMgDataRepository,
     IQualityAssuranceInputMasterRepository qualityAssuranceInputMasterRepository,
     IQualityAssurance_OQC_InputMasterRepository oQC_InputMasterRepository,
     IQualityAssuranceInputMasterHistoryRepository qualityAssuranceInputMasterHistoryRepository,
     IOQCInputMasterHistoryRepository oQCInputMasterHistoryRepository,
     IExceptionTypeWithFlowchartRepository exceptionTypeWithFlowchartRepository,
     IUnitOfWork unitOfWork)
 {
     this.systemRoleRepository                         = systemRoleRepository;
     this.unitOfWork                                   = unitOfWork;
     this.flowChartMasterRepository                    = flowChartMasterRepository;
     this.flowChartDetailRepository                    = flowChartDetailRepository;
     this.flowChartMgDataRepository                    = flowChartMgDataRepository;
     this.systemProjectRepository                      = systemProjectRepository;
     this.systemBUDRepository                          = systemBUDRepository;
     this.systemFunctionPlantRepository                = systemFunctionPlantRepository;
     this.systemUserRepository                         = systemUserRepository;
     this.systemUserRoleRepository                     = systemUserRoleRepository;
     this.flowChartPCMHRelationshipRepository          = flowChartPCMHRelationshipRepository;
     this.systemUserOrgRepository                      = systemUserOrgRepository;
     this.projectUsersGroupRepository                  = projectUsersGroupRepository;
     this.systemOrgRepository                          = systemOrgRepository;
     this.systemOrgBomRepository                       = systemOrgBomRepository;
     this.qualityAssuranceMgDataRepository             = qualityAssuranceMgDataRepository;
     this.qualityAssuranceInputMasterRepository        = qualityAssuranceInputMasterRepository;
     this.oQC_InputMasterRepository                    = oQC_InputMasterRepository;
     this.qualityAssuranceInputMasterHistoryRepository = qualityAssuranceInputMasterHistoryRepository;
     this.oQCInputMasterHistoryRepository              = oQCInputMasterHistoryRepository;
     this.exceptionTypeWithFlowchartRepository         = exceptionTypeWithFlowchartRepository;
 }
コード例 #28
0
		public string SendEmailTo(string emailAddress, ISystemUserRepository repository)
		{
			if (string.IsNullOrEmpty(emailAddress))
			{
				return "Please enter the e-mail address to send your password to";
			}

			bool emailSent = _mailer.SendForgottenPasswordEmail(emailAddress, repository);

			if (emailSent)
			{
				return string.Format("Your password has been e-mailed to {0}", emailAddress);
			}
			else
			{
				return string.Format("We could not find a user with the e-mail address {0}", emailAddress);
			}
		}
コード例 #29
0
        public string SendEmailTo(string emailAddress, ISystemUserRepository repository)
        {
            if (string.IsNullOrEmpty(emailAddress))
            {
                return("Please enter the e-mail address to send your password to");
            }

            bool emailSent = _mailer.SendForgottenPasswordEmail(emailAddress, repository);

            if (emailSent)
            {
                return(string.Format("Your password has been e-mailed to {0}", emailAddress));
            }
            else
            {
                return(string.Format("We could not find a user with the e-mail address {0}", emailAddress));
            }
        }
コード例 #30
0
        public void Should_not_send_forgotten_password_email_when_email_address_does_not_exist()
        {
            MockRepository        mocks      = new MockRepository();
            ISystemUserRepository repository = mocks.CreateMock <ISystemUserRepository>();

            using (mocks.Record())
            {
                Expect.Call(repository.GetByEmailAddress("*****@*****.**")).Return(null);
            }

            using (mocks.Playback())
            {
                IForgottenPasswordMailer mailer = new ForgottenPasswordMailer(null, null, null);
                bool emailWasSent = mailer.SendForgottenPasswordEmail("*****@*****.**", repository);
                Assert.That(emailWasSent, Is.False);
            }

            mocks.VerifyAll();
        }
コード例 #31
0
        public async Task LoginWhenPasswordIsNullOrEmptyShouldReturnFailOperationResult(string password)
        {
            ISystemUserRepository systemUserRepository = Substitute.For <ISystemUserRepository>();
            IUserService          userService          = Substitute.For <IUserService>();
            IEncrypService        encrypService        = Substitute.For <IEncrypService>();

            AuthenticationManager authenticationManager = new AuthenticationManager(systemUserRepository, userService, encrypService);

            AuthenticationRequest authenticationRequest = new AuthenticationRequest
            {
                Username = "******",
                Password = password
            };

            IOperationResult <AuthenticationViewModel> actual = await authenticationManager.Login(authenticationRequest);

            Assert.IsFalse(actual.Success);
            Assert.AreEqual("La contraseña del usuario es requerida", actual.Message);
        }
コード例 #32
0
 public MaterialManageService(//IMaterialApplyRepository materialApplyRepository,
     IMaterialInfoRepository materialInfoRepository,
     ISystemUserRepository systemUserRepository,
     IEquipmentInfoRepository equipmentInfoRepository, IUnitOfWork unitOfWork,
     IEnumerationRepository enumerationRepository, IEQP_PowerOnRepository eqp_PowerOnRepository, IEQP_MaterialRepository eqp_MaterialRepository, IEQP_TypeRepository eqp_TypeRepository, ISystemFunctionPlantRepository systemFunctionPlantRepository, ISystemOrgBomRepository systemOrgBomRepository, IEQPForecastPowerOnRepository eQPForecastPowerOnRepository, ISystemOrgRepository systemOrgRepository)
 {
     // this.materialApplyRepository = materialApplyRepository;
     this.materialInfoRepository  = materialInfoRepository;
     this.systemUserRepository    = systemUserRepository;
     this.equipmentInfoRepository = equipmentInfoRepository;
     this.unitOfWork                    = unitOfWork;
     this.enumerationRepository         = enumerationRepository;
     this.eqp_PowerOnRepository         = eqp_PowerOnRepository;
     this.eqp_MaterialRepository        = eqp_MaterialRepository;
     this.eqp_TypeRepository            = eqp_TypeRepository;
     this.systemFunctionPlantRepository = systemFunctionPlantRepository;
     this.systemOrgBomRepository        = systemOrgBomRepository;
     this.eQPForecastPowerOnRepository  = eQPForecastPowerOnRepository;
     this.systemOrgRepository           = systemOrgRepository;
 }
コード例 #33
0
        public void Correctly_attempts_to_send_email_and_provide_feedback_when_email_cannot_be_sent()
        {
            MockRepository           mocks      = new MockRepository();
            IForgottenPasswordMailer mailer     = mocks.CreateMock <IForgottenPasswordMailer>();
            ISystemUserRepository    repository = mocks.CreateMock <ISystemUserRepository>();

            using (mocks.Record())
            {
                Expect.Call(mailer.SendForgottenPasswordEmail("*****@*****.**", repository)).Return(false);
            }

            using (mocks.Playback())
            {
                IForgottenPasswordService service = new ForgottenPasswordService(mailer);
                string userFeedback = service.SendEmailTo("*****@*****.**", repository);

                Assert.That(userFeedback, Is.EqualTo("We could not find a user with the e-mail address [email protected]"));
            }

            mocks.VerifyAll();
        }
コード例 #34
0
        public async Task LoginWhenUserNotFoundOrPasswordIsIncorrectShouldReturnFailOperationResult()
        {
            ISystemUserRepository systemUserRepository = Substitute.For <ISystemUserRepository>();
            IUserService          userService          = Substitute.For <IUserService>();
            IEncrypService        encrypService        = Substitute.For <IEncrypService>();

            systemUserRepository.FindAsync(Arg.Any <Expression <Func <SystemUser, bool> > >()).Returns(default(SystemUser));

            AuthenticationManager authenticationManager = new AuthenticationManager(systemUserRepository, userService, encrypService);

            AuthenticationRequest authenticationRequest = new AuthenticationRequest
            {
                Username = "******",
                Password = "******"
            };

            IOperationResult <AuthenticationViewModel> actual = await authenticationManager.Login(authenticationRequest);

            Assert.IsFalse(actual.Success);
            Assert.AreEqual("Usuario o contraseña incorrecto", actual.Message);
        }
コード例 #35
0
        protected override void ResolveReferences(UnityContainer container)
        {
            base.ResolveReferences(container);

            this.AppUserRepository = container.Resolve<IAppUserRepository>();
            this.SystemUserRepository = container.Resolve<ISystemUserRepository>();
        }
コード例 #36
0
		public SystemUserContextManager(IWebContext webContext, ISystemUserRepository repository)
		{
			_webContext = webContext;
			_repository = repository;
		}
コード例 #37
0
ファイル: BLLUser.cs プロジェクト: kamiken/KSG-Mobile
 public BLLUser()
 {
     repSystemUser = new SystemUserRepository(DatabaseFactory);
 }