public static void PopulateSeoCodes <T>(this ISocioEconomicObjectiveRepository socioEconomicObjectiveRepository, IResearchCodesViewModel vm, NameValueCollection form) where T : ClassificationBase, new()
        {
            var socioEconomicObjective = socioEconomicObjectiveRepository.GetSocioEconomicObjective(vm.SocioEconomicObjectiveCode);

            if (socioEconomicObjective == null)
            {
                throw new Exception("Socio economic objective code not found, please ensure code is correct")
                      {
                          Source = "SocioEconomicObjectiveCode"
                      };
            }

            if (vm.SocioEconomicObjectives == null)
            {
                vm.SocioEconomicObjectives = new List <ClassificationBase> {
                    new T {
                        Code = socioEconomicObjective
                    }
                };
            }
            else if (!vm.SocioEconomicObjectives.Any(o => o.Code.Id == socioEconomicObjective.Id))
            {
                vm.SocioEconomicObjectives.Add(new T {
                    Code = socioEconomicObjective
                });
                vm.SocioEconomicObjectives = vm.SocioEconomicObjectives.OrderBy(o => o.Code.Id).ToList();
            }
        }
 protected ProjectBaseController(ICurtinUserService lookupService, IProjectRepository projectRepository, IFieldOfResearchRepository fieldOfResearchRepository, ISocioEconomicObjectiveRepository socioEconomicObjectiveRepository) 
     : base(lookupService)
 {
     ProjectRepository = projectRepository;
     FieldOfResearchRepository = fieldOfResearchRepository;
     SocioEconomicObjectiveRepository = socioEconomicObjectiveRepository;
 }
 protected ProjectBaseController(ICurtinUserService lookupService, IProjectRepository projectRepository, IFieldOfResearchRepository fieldOfResearchRepository, ISocioEconomicObjectiveRepository socioEconomicObjectiveRepository)
     : base(lookupService)
 {
     ProjectRepository                = projectRepository;
     FieldOfResearchRepository        = fieldOfResearchRepository;
     SocioEconomicObjectiveRepository = socioEconomicObjectiveRepository;
 }
 public void Setup()
 {
     _autoSubstitute = AutoSubstituteContainer.Create();
     _fieldOfResearchRepository = _autoSubstitute.Resolve<IFieldOfResearchRepository>();
     _socioEconomicObjectiveRepository = _autoSubstitute.Resolve<ISocioEconomicObjectiveRepository>();
     _controller = _autoSubstitute.GetController<AjaxController>();
     _lookupService = _autoSubstitute.Resolve<ICurtinUserService>();
     _dataCollectionRepository = _autoSubstitute.Resolve<IDataCollectionRepository>();
 }
 public void Setup()
 {
     _autoSubstitute                   = AutoSubstituteContainer.Create();
     _fieldOfResearchRepository        = _autoSubstitute.Resolve <IFieldOfResearchRepository>();
     _socioEconomicObjectiveRepository = _autoSubstitute.Resolve <ISocioEconomicObjectiveRepository>();
     _controller               = _autoSubstitute.GetController <AjaxController>();
     _lookupService            = _autoSubstitute.Resolve <ICurtinUserService>();
     _dataCollectionRepository = _autoSubstitute.Resolve <IDataCollectionRepository>();
 }
 protected DataCollectionBaseController(ICurtinUserService lookupService, IDataCollectionRepository dataCollectionRepository,
                                        IProjectRepository projectRepository, IFieldOfResearchRepository fieldOfResearchRepository,
                                        ISocioEconomicObjectiveRepository socioEconomicObjectiveRepository, IDataCollectionHashCodeRepository hashCodeRepository, IBus bus)
     : base(lookupService)
 {
     this.DataCollectionRepository         = dataCollectionRepository;
     this.ProjectRepository                = projectRepository;
     this.FieldOfResearchRepository        = fieldOfResearchRepository;
     this.SocioEconomicObjectiveRepository = socioEconomicObjectiveRepository;
     this.HashCodeRepository               = hashCodeRepository;
     this.Bus = bus;
 }
 public void SetUp()
 {
     _autoSubstitute = AutoSubstituteContainer.Create();
     _controller = _autoSubstitute.GetController<DataCollectionController>();
     _projectRepository = _autoSubstitute.Resolve<IProjectRepository>();
     _dataCollectionRepository = _autoSubstitute.Resolve<IDataCollectionRepository>();
     _context = _autoSubstitute.Resolve<ControllerContext>();
     _form = _context.HttpContext.Request.Form;
     _lookup = _autoSubstitute.Resolve<ICurtinUserService>();
     _fieldOfResearchRepository = _autoSubstitute.Resolve<IFieldOfResearchRepository>();
     _socioEconomicObjectiveRepository = _autoSubstitute.Resolve<ISocioEconomicObjectiveRepository>();
     _bus = _autoSubstitute.Resolve<IBus>();
 }
        public void SetUp()
        {
            _autoSubstitute = AutoSubstituteContainer.Create();
            _controller = _autoSubstitute.GetController<ProjectController>();
            _dmpController = _autoSubstitute.GetController<DmpController>();
            _projectRepository = _autoSubstitute.Resolve<IProjectRepository>();
            _context = _autoSubstitute.Resolve<ControllerContext>();
            _form = _context.HttpContext.Request.Form;
            _lookup = _autoSubstitute.Resolve<ICurtinUserService>();
            _fieldOfResearchRepository = _autoSubstitute.Resolve<IFieldOfResearchRepository>();
            _socioEconomicObjectiveRepository = _autoSubstitute.Resolve<ISocioEconomicObjectiveRepository>();

            var appSettings = _autoSubstitute.Resolve<IAppSettingsService>();
            var dependencyResolver = _autoSubstitute.Resolve<IDependencyResolver>();
            DependencyResolver.SetResolver(dependencyResolver);
            dependencyResolver.GetService<IAppSettingsService>().Returns(appSettings);
        }
        public void SetUp()
        {
            _autoSubstitute    = AutoSubstituteContainer.Create();
            _controller        = _autoSubstitute.GetController <ProjectController>();
            _dmpController     = _autoSubstitute.GetController <DmpController>();
            _projectRepository = _autoSubstitute.Resolve <IProjectRepository>();
            _context           = _autoSubstitute.Resolve <ControllerContext>();
            _form   = _context.HttpContext.Request.Form;
            _lookup = _autoSubstitute.Resolve <ICurtinUserService>();
            _fieldOfResearchRepository        = _autoSubstitute.Resolve <IFieldOfResearchRepository>();
            _socioEconomicObjectiveRepository = _autoSubstitute.Resolve <ISocioEconomicObjectiveRepository>();

            var appSettings        = _autoSubstitute.Resolve <IAppSettingsService>();
            var dependencyResolver = _autoSubstitute.Resolve <IDependencyResolver>();

            DependencyResolver.SetResolver(dependencyResolver);
            dependencyResolver.GetService <IAppSettingsService>().Returns(appSettings);
        }
 public DataDepositController(ICurtinUserService lookupService, IProjectRepository projectRepository, IFieldOfResearchRepository fieldOfResearchRepository, ISocioEconomicObjectiveRepository socioEconomicObjectiveRepository)
     : base(lookupService, projectRepository, fieldOfResearchRepository, socioEconomicObjectiveRepository)
 {
 }
Exemplo n.º 11
0
 public ApprovalController(ICurtinUserService lookupService, IDataCollectionRepository dataCollectionRepository,
                           IProjectRepository projectRepository, IFieldOfResearchRepository fieldOfResearchRepository,
                           ISocioEconomicObjectiveRepository socioEconomicObjectiveRepository, IDataCollectionHashCodeRepository hashCodeRepository, IBus bus)
     : base(lookupService, dataCollectionRepository, projectRepository, fieldOfResearchRepository, socioEconomicObjectiveRepository, hashCodeRepository, bus)
 {
 }
Exemplo n.º 12
0
 public DataDepositController(ICurtinUserService lookupService, IProjectRepository projectRepository, IFieldOfResearchRepository fieldOfResearchRepository, ISocioEconomicObjectiveRepository socioEconomicObjectiveRepository)
     : base(lookupService, projectRepository, fieldOfResearchRepository, socioEconomicObjectiveRepository)
 {
 }
Exemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the AjaxController class.
 /// </summary>
 /// <param name="fieldOfResearchRepository"></param>
 /// <param name="socioEconomicObjectiveRepository"></param>
 /// <param name="lookupService"></param>
 public AjaxController(IFieldOfResearchRepository fieldOfResearchRepository, ISocioEconomicObjectiveRepository socioEconomicObjectiveRepository, IDataCollectionRepository dataCollectionRepository, ICurtinUserService lookupService) : base(lookupService)
 {
     _fieldOfResearchRepository        = fieldOfResearchRepository;
     _socioEconomicObjectiveRepository = socioEconomicObjectiveRepository;
     _dataCollectionRepository         = dataCollectionRepository;
 }
 public override void Setup()
 {
     base.Setup();
     _repository = new SocioEconomicObjectiveRepository(CreateSession());
 }
 public override void Setup()
 {
     base.Setup();
     _repository = new SocioEconomicObjectiveRepository(CreateSession());
 }