Пример #1
0
 public BaseAdminModelFactory(IFacultyService facultyService,
                              ICountryService countryService,
                              IUserActivityService userActivityService,
                              IUserService userService,
                              IDateTimeHelper dateTimeHelper,
                              IEmailAccountService emailAccountService,
                              IProfessorService professorService,
                              IProvinceService provinceService,
                              IStaticCacheManager cacheManager,
                              IAcademicRankService academicRankService,
                              IResearchIssueService researchIssueService,
                              IAgencyService agencyService,
                              IResearcherService researcherService,
                              IEducationLevelService educationLevelService,
                              IStrategyGroupService strategyGroupService,
                              IFiscalScheduleService fiscalScheduleService,
                              ITitleService titleService,
                              IInstituteService instituteService)
 {
     this._facultyService        = facultyService;
     this._countryService        = countryService;
     this._userActivityService   = userActivityService;
     this._userService           = userService;
     this._dateTimeHelper        = dateTimeHelper;
     this._emailAccountService   = emailAccountService;
     this._professorService      = professorService;
     this._provinceService       = provinceService;
     this._cacheManager          = cacheManager;
     this._academicRankService   = academicRankService;
     this._researchIssueService  = researchIssueService;
     this._agencyService         = agencyService;
     this._researcherService     = researcherService;
     this._educationLevelService = educationLevelService;
     this._strategyGroupService  = strategyGroupService;
     this._fiscalScheduleService = fiscalScheduleService;
     this._titleService          = titleService;
     this._instituteService      = instituteService;
 }
Пример #2
0
        protected override ValidationResult IsValid(object value, ValidationContext validationContext)
        {
            if (value == null)
            {
                return(ValidationResult.Success);
            }

            int callOrPutStrategyId = int.Parse(value.ToString());
            int strategyId          = int.Parse(validationContext.ObjectType.GetProperty("Id").GetValue(validationContext.ObjectInstance, null).ToString());
            int?originalCallStrategyId;
            int?originalPutStrategyId;

            IStrategyGroupService strategyGroupService = ObjectFactory.GetInstance <IStrategyGroupService>();

            if (strategyId == 0)
            {
                originalCallStrategyId = null;
                originalPutStrategyId  = null;
            }
            else
            {
                StrategyGroup strategyGroup = strategyGroupService.GetById(strategyId);
                originalCallStrategyId = strategyGroup.CallStrategyId;
                originalPutStrategyId  = strategyGroup.PutStrategyId;
            }

            List <Strategy> notGroupedStrategies  = strategyGroupService.GetNotGroupedStrategies(originalCallStrategyId, originalPutStrategyId);
            List <int>      notGroupedStrategyIds = notGroupedStrategies.Select(m => m.Id).ToList();

            if (notGroupedStrategyIds.Contains(callOrPutStrategyId))
            {
                return(ValidationResult.Success);
            }

            string displayName = DisplayNameHelper.GetDisplayName(validationContext.DisplayName, validationContext);

            return(new ValidationResult(FormatErrorMessage(displayName)));
        }
Пример #3
0
 public StrategyGroupsController(StrategyGroupsOrchestrator orchestrator, IStrategyGroupService strategyGroupService)
 {
     _orchestrator         = orchestrator;
     _strategyGroupService = strategyGroupService;
 }
 public StrategyGroupsManagerController(IStrategyGroupService strategyGroupService)
 {
     _strategyGroupService = strategyGroupService;
 }
Пример #5
0
 public StrategyGroupsOrchestrator(IStrategyGroupService strategyGroupService)
 {
     _strategyGroupService = strategyGroupService;
 }