Esempio n. 1
0
        public ControllerTestBase()
        {
            organizationServiceMockSetup = new Mock <IOrganizationService>();
            organizationService          = organizationServiceMockSetup.Object;
            channelServiceMockSetup      = new Mock <IChannelService>();
            channelService = channelServiceMockSetup.Object;
            serviceAndChannelServiceMockSetup = new Mock <IServiceAndChannelService>();
            //serviceAndChannelService = serviceAndChannelServiceMockSetup.Object;
            serviceServiceMockSetup = new Mock <IServiceService>();
            serviceService          = serviceServiceMockSetup.Object;
            commonServiceMockSetup  = new Mock <ICommonService>();
            commonService           = commonServiceMockSetup.Object;
            codeServiceMockSetup    = new Mock <ICodeService>();
            codeService             = codeServiceMockSetup.Object;
            gdServiceMockSetup      = new Mock <IGeneralDescriptionService>();
            gdService = gdServiceMockSetup.Object;

            userServiceMockSetup = new Mock <IUserOrganizationService>();
            userServiceMockSetup.Setup(u => u.GetAllUserOrganizations()).Returns(new List <Guid>()
            {
                Guid.NewGuid()
            });
            userService = userServiceMockSetup.Object;

            var settingsMock = new Mock <IOptions <AppSettings> >();

            settingsMock.Setup(s => s.Value).Returns(new AppSettings());
            settings = settingsMock.Object;
        }
Esempio n. 2
0
        /// <summary>
        /// Ctor - organization validator
        /// </summary>
        /// <param name="model">Organization model</param>
        /// <param name="codeService">Code service</param>
        /// <param name="organizationService">Organization service</param>
        /// <param name="commonService">Common service</param>
        /// <param name="newLanguages">Languages that should be validated within lists</param>
        /// <param name="availableLanguages">The languages that are available in main model and therefore need to be validated.</param>
        /// <param name="isCreateOperation">Indicates if organization is beeing inserted or updated.</param>
        /// <param name="versionNumber">Version number.</param>
        public OrganizationValidator(IVmOpenApiOrganizationInVersionBase model, ICodeService codeService, IOrganizationService organizationService, IList <string> newLanguages, IList <string> availableLanguages, ICommonService commonService, int versionNumber, bool isCreateOperation = false)
            : base(model, "Organization")
        {
            this.codeService = codeService;

            if (model == null)
            {
                throw new ArgumentNullException(PropertyName, $"{PropertyName} must be defined.");
            }

            name = new LocalizedListValidator(model.OrganizationNames, "OrganizationNames", newLanguages, new List <string>()
            {
                NameTypeEnum.Name.ToString()
            });
            municipality   = new MunicipalityCodeValidator(model.Municipality, codeService);
            addresses      = new AddressListValidator <V7VmOpenApiAddressWithForeignIn>(model.Addresses, codeService);
            organizationId = new OrganizationIdValidator(model.ParentOrganizationId, commonService, "ParentOrganizationId");
            oid            = new OidValidator(model.Oid, organizationService, isCreateOperation: isCreateOperation, organizationId: model.Id, sourceId: model.SourceId);
            phones         = new PhoneNumberListValidator <V4VmOpenApiPhone>(model.PhoneNumbers, codeService);
            status         = new PublishingStatusValidator(model.PublishingStatus, model.CurrentPublishingStatus);
            description    = new LocalizedListValidator(model.OrganizationDescriptions, "OrganizationDescriptions", newLanguages, new List <string>()
            {
                DescriptionTypeEnum.ShortDescription.ToString()
            }, availableLanguages);
            this.versionNumber = versionNumber;
        }
 public CodeViewModel(ICodeService codeService)
 {
     _codeService        = codeService;
     Code                = string.Empty;
     UseAttributeCommand = new RelayCommand(OnUseAttributeChange);
     MessengerInstance.Register <PageObjectChangedMessage>(this, OnPageObjectChanged);
 }
Esempio n. 4
0
 public MES202TaskDetailEditForm(MES_M202_Task_Detail taskDetail, IMES_M202_Task_DetailService TaskDetailService, ICodeService codeService)
 {
     InitializeComponent();
     this.tempData          = taskDetail;
     this.TaskDetailService = TaskDetailService;
     this.codeService       = codeService;
 }
Esempio n. 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServiceBaseController"/> class.
 /// </summary>
 /// <param name="serviceService">The service service.</param>
 /// <param name="commonService">The common service.</param>
 /// <param name="codeService">The code service.</param>
 /// <param name="settings">The settings.</param>
 /// <param name="generalDescriptionService">The general description service.</param>
 /// <param name="fintoService">The finto service.</param>
 /// <param name="serviceAndChannelService">The service and channel service.</param>
 /// <param name="channelService">The channel service.</param>
 /// <param name="userOrganizationService">The user organization service.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="versionNumber">Open api version.</param>
 public ServiceBaseController(
     IServiceService serviceService,
     ICommonService commonService,
     ICodeService codeService,
     IOptions <AppSettings> settings,
     IGeneralDescriptionService generalDescriptionService,
     IFintoService fintoService,
     IServiceAndChannelService serviceAndChannelService,
     IChannelService channelService,
     IUserOrganizationService userOrganizationService,
     ILogger logger,
     int versionNumber)
     : base(serviceAndChannelService, serviceService, channelService, userOrganizationService, settings, logger, versionNumber)
 {
     this.serviceService            = serviceService;
     this.generalDescriptionService = generalDescriptionService;
     this.serviceAndChannelService  = serviceAndChannelService;
     this.codeService             = codeService;
     this.fintoService            = fintoService;
     this.commonService           = commonService;
     this.channelService          = channelService;
     this.userOrganizationService = userOrganizationService;
     pageSize           = Settings.PageSize > 0 ? Settings.PageSize : 1000;
     this.versionNumber = versionNumber;
 }
Esempio n. 6
0
 public PublisherController(IProductService productService, IBlogService blogService,
                            IWebsiteAttributeService websiteAttributeService, IBlogCategoryService blogCategoryService,
                            IStaffService staffService, IProductAttributeMappingService productAttributeMappingService,
                            IProductRelationshipService productRelationshipService, IProductScheduleService productScheduleService,
                            IOrderService orderService, IOrderItemService orderItemService,
                            IOrderAttributeService orderAttributeService, IOrderAttributeMappingService orderAttributeMappingService,
                            IAdService adService, IAdMaterialMappingService adMaterialService, IMaterialService materialService, IDomainService domainService, ICodeService codeService)
 {
     this._productService                 = productService;
     this._blogService                    = blogService;
     this._websiteAttributeService        = websiteAttributeService;
     this._blogCategoryService            = blogCategoryService;
     this._staffService                   = staffService;
     this._productAttributeMappingService = productAttributeMappingService;
     this._productRelationshipService     = productRelationshipService;
     this._productScheduleService         = productScheduleService;
     this._orderService                   = orderService;
     this._orderAttributeService          = orderAttributeService;
     this._orderAttributeMappingService   = orderAttributeMappingService;
     this._adService = adService;
     this._adMaterialMappingService = adMaterialService;
     this._materialService          = materialService;
     this._domainService            = domainService;
     this._codeService = codeService;
 }
 public PolicyService(IPolicyRepository repository, ICustomerPolicyRepository customerPolicyRepository, ICodeService codeService, IMapper mapper)
 {
     _repository = repository;
     _customerPolicyRepository = customerPolicyRepository;
     _codeService = codeService;
     _mapper      = mapper;
 }
Esempio n. 8
0
 public UserController(IUserService userService, ICodeService codeService, IUserAndRuleService userAndRuleService, IRuleService ruleService, IProjectService projectService)
 {
     _userService = userService;
     _codeService = codeService;
     _userAndRuleService = userAndRuleService;
     _ruleService = ruleService;
     _projectService = projectService;
 }
Esempio n. 9
0
 public CreateUrlMappingCommandHandler(IUrlMappingRepository urlMappingRepository, ICodeService codeService, IDateTime dateProvider)
 {
     // TODO :: Check Fluent Validation with MediatR
     _validator            = new CreateUrlMappingCommandValidator();
     _urlMappingRepository = urlMappingRepository ?? throw new ArgumentNullException(nameof(urlMappingRepository));
     _codeService          = codeService ?? throw new ArgumentNullException(nameof(codeService));
     _dateProvider         = dateProvider ?? throw new ArgumentNullException(nameof(dateProvider));
 }
Esempio n. 10
0
 public CodeController(IEmployeeService employeeService, ICodeService codeService,
                       ICenterService centerService)
     : base(employeeService)
 {
     _codeService     = codeService;
     _employeeService = employeeService;
     _centerService   = centerService;
 }
Esempio n. 11
0
 public UserController(IUserService userService, ICodeService codeService, IUserAndRuleService userAndRuleService, IRuleService ruleService, IProjectService projectService)
 {
     _userService        = userService;
     _codeService        = codeService;
     _userAndRuleService = userAndRuleService;
     _ruleService        = ruleService;
     _projectService     = projectService;
 }
Esempio n. 12
0
 public PayableRepository(IOptionsSnapshot <AppSettings> settings, SettlementContext context, IPublisher publisher, IMediator mediator, ICodeService codeService)
 {
     _context     = context ?? throw new ArgumentNullException(nameof(context));
     _settings    = settings;
     _publisher   = publisher;
     _mediator    = mediator;
     _codeService = codeService;
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="generalDescriptionService">instance of IGeneralDescriptionService</param>
 /// <param name="codeService">instance of ICodeService</param>
 /// <param name="fintoService">instance of IFintoService</param>
 /// <param name="userOrganizationService">instance of IUserOrganizationService</param>
 /// <param name="logger">instance of ILogger</param>
 /// <param name="settings">instance of IOptions{AppSettings}</param>
 public V4GeneralDescriptionController(
     IGeneralDescriptionService generalDescriptionService,
     ICodeService codeService,
     IFintoService fintoService,
     IUserOrganizationService userOrganizationService,
     ILogger <V4GeneralDescriptionController> logger,
     IOptions <AppSettings> settings) : base(generalDescriptionService, codeService, settings, fintoService, logger, userOrganizationService, 4)
 {
 }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";

            var start = 0;
            var limit = 10;
            var sort  = string.Empty;
            var dir   = string.Empty;
            var query = string.Empty;

            if (!string.IsNullOrEmpty(context.Request["start"]))
            {
                start = int.Parse(context.Request["start"]);
            }

            if (!string.IsNullOrEmpty(context.Request["limit"]))
            {
                limit = int.Parse(context.Request["limit"]);
            }

            if (!string.IsNullOrEmpty(context.Request["sort"]))
            {
                sort = context.Request["sort"];
            }

            if (!string.IsNullOrEmpty(context.Request["dir"]))
            {
                dir = context.Request["dir"];
            }

            if (!string.IsNullOrEmpty(context.Request["query"]))
            {
                query = context.Request["query"];
            }

            IXMLogisticsFeeBranchService XMLogisticsFeeBranchService = IoC.Resolve <IXMLogisticsFeeBranchService>();
            ICodeService CodeService = IoC.Resolve <ICodeService>();

            var query1 = XMLogisticsFeeBranchService.GetXMLogisticsFeeBranchList();

            List <XMLogisticsFeeBranchNew> list = query1.OrderBy(a => a.ID).Skip(start).Take(limit).ToList();
            List <CodeList> codeList            = CodeService.GetCodeListAll();

            var data = from p in list
                       select new FinalData
            {
                ID              = p.ID,
                Project         = p.Project,
                Logistics       = codeList.Where(a => a.CodeID == p.LogisticsID).FirstOrDefault() == null?"": codeList.Where(a => a.CodeID == p.LogisticsID).FirstOrDefault().CodeName,
                ProductCategory = codeList.Where(a => a.CodeID == p.ProductCategoryID).FirstOrDefault() == null?"": codeList.Where(a => a.CodeID == p.ProductCategoryID).FirstOrDefault().CodeName,
                Fee             = p.Fee,
            };

            Paging <FinalData> pag = new Paging <FinalData>(data, query1.Count());

            context.Response.Write(string.Format("{{total:{1},'data':{0}}}", JsonConvert.SerializeObject(pag.Data), pag.TotalRecords));
        }
Esempio n. 15
0
 /// <summary>
 /// Ctor
 /// </summary>
 public V4OrganizationController(
     IOrganizationService organizationService,
     ICodeService codeService,
     IOptions <AppSettings> settings,
     ILogger <V4OrganizationController> logger,
     ICommonService commonService,
     IUserOrganizationService userService)
     : base(organizationService, codeService, settings, logger, commonService, userService, 4)
 {
 }
Esempio n. 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommonController"/> class.
 /// </summary>
 /// <param name="commonService">The common service.</param>
 /// <param name="codeService">The code service.</param>
 /// <param name="userOrganizationService">The user organization service</param>
 /// <param name="settings">The settings.</param>
 /// <param name="logger">The logger.</param>
 public CommonController(
     ICommonService commonService,
     ICodeService codeService,
     IUserOrganizationService userOrganizationService,
     IOptions <AppSettings> settings,
     ILogger <CommonController> logger) : base(userOrganizationService, settings, logger)
 {
     this.commonService = commonService;
     this.codeService   = codeService;
     pageSize           = Settings.PageSize > 0 ? Settings.PageSize : 1000;
 }
Esempio n. 17
0
        /// <summary>
        /// Ctor - service validator
        /// </summary>
        /// <param name="model">Service model</param>
        /// <param name="generalDescriptionService">General description service</param>
        /// <param name="codeService">Code service</param>
        /// <param name="fintoService">Finto item service</param>
        /// <param name="commonService">Common service</param>
        /// <param name="channelService">Channel service</param>
        /// <param name="newLanguages">Languages that should be validated within lists</param>
        /// <param name="userRole">User role</param>
        public ServiceValidator(
            IVmOpenApiServiceInVersionBase model,
            IGeneralDescriptionService generalDescriptionService,
            ICodeService codeService,
            IFintoService fintoService,
            ICommonService commonService,
            IChannelService channelService,
            IList <string> newLanguages,
            UserRoleEnum userRole
            ) : base(model, "Service")
        {
            this.generalDescriptionService = generalDescriptionService;

            if (model == null)
            {
                throw new ArgumentNullException(PropertyName, $"{PropertyName} must be defined.");
            }

            names = new LocalizedListValidator(model.ServiceNames, "ServiceNames", newLanguages, new List <string>()
            {
                NameTypeEnum.Name.ToString()
            });
            languages         = new LanguageListValidator(model.Languages, codeService);
            serviceClasses    = new ServiceClassListValidator(model.ServiceClasses, fintoService);
            ontologyTerms     = new OntologyTermListValidator(model.OntologyTerms, fintoService);
            targetGroups      = new TargetGroupListValidator(model.TargetGroups, fintoService);
            lifeEvents        = new LifeEventListValidator(model.LifeEvents, fintoService);
            industrialClasses = new IndustrialClassListValidator(model.IndustrialClasses, fintoService);
            organizations     = new OrganizationIdListValidator(model.OtherResponsibleOrganizations?.Select(o => o.ToString()).ToList(), commonService, "OtherResponsibleOrganizations");
            status            = new PublishingStatusValidator(model.PublishingStatus, model.CurrentPublishingStatus);
            areas             = new AreaAndTypeValidator(model.Areas, model.AreaType, codeService);
            var channelList = model.ServiceServiceChannels?.Count > 0 ? model.ServiceServiceChannels.Select(i => i.ChannelGuid).ToList() : new List <Guid>();

            channels = new ServiceChannelIdListValidator(channelList, channelService, userRole, "ServiceChannels");

            var availableOrganizations = new List <Guid>();

            if (!model.MainResponsibleOrganization.IsNullOrEmpty())
            {
                availableOrganizations.Add(model.MainResponsibleOrganization.ParseToGuidWithExeption());
            }
            if (model.OtherResponsibleOrganizations?.Count > 0)
            {
                availableOrganizations.AddRange(model.OtherResponsibleOrganizations);
            }
            serviceProducers = new ServiceProducerListValidator(model.ServiceProducers, availableOrganizations, commonService);

            mainOrganization = new OrganizationIdValidator(model.MainResponsibleOrganization, commonService, "MainResponsibleOrganization");

            generalDescriptionAttached = !string.IsNullOrEmpty(model.StatutoryServiceGeneralDescriptionId);
            this.newLanguages          = newLanguages;
        }
Esempio n. 18
0
 /// <summary>
 /// ServiceChannelController constructor.
 /// </summary>
 public V4ServiceChannelController(
     IChannelService channelService,
     IOrganizationService organizationService,
     ICodeService codeService,
     IServiceService serviceService,
     IOptions <AppSettings> settings,
     IFintoService fintoService,
     ILogger <V4ServiceChannelController> logger,
     ICommonService commonService,
     IUserOrganizationService userOrganizationService)
     : base(channelService, organizationService, codeService, serviceService, settings, logger, commonService, 4, userOrganizationService)
 {
 }
Esempio n. 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="V7ServiceController"/> class.
 /// </summary>
 /// <param name="serviceService">The service service.</param>
 /// <param name="commonService">The common service.</param>
 /// <param name="codeService">The code service.</param>
 /// <param name="settings">The settings.</param>
 /// <param name="generalDescriptionService">The general description service.</param>
 /// <param name="fintoService">The finto service.</param>
 /// <param name="serviceAndChannelService">The service and channel service.</param>
 /// <param name="channelService">The channel service.</param>
 /// <param name="userOrganizationService">The user organization service.</param>
 /// <param name="logger">The logger.</param>
 public V7ServiceController(
     IServiceService serviceService,
     ICommonService commonService,
     ICodeService codeService,
     IOptions <AppSettings> settings,
     IGeneralDescriptionService generalDescriptionService,
     IFintoService fintoService,
     IServiceAndChannelService serviceAndChannelService,
     IChannelService channelService,
     IUserOrganizationService userOrganizationService,
     ILogger <V7ServiceController> logger)
     : base(serviceService, commonService, codeService, settings, generalDescriptionService, fintoService, serviceAndChannelService, channelService, userOrganizationService, logger, 7)
 {
 }
Esempio n. 20
0
 public DataHandler(
     IOptions <AppSettings> settings,
     IOrganizationService organizationService,
     IChannelService channelService,
     IServiceService serviceService,
     ICodeService codeService,
     ILogger <DataHandler> logger)
 {
     this.settings            = settings.Value;
     this.organizationService = organizationService;
     this.channelService      = channelService;
     this.serviceService      = serviceService;
     this.codeService         = codeService;
     this.logger = logger;
 }
Esempio n. 21
0
        /// <summary>
        /// Contructor
        /// </summary>
        /// <param name="generalDescriptionService"></param>
        /// <param name="codeService"></param>
        /// <param name="settings"></param>
        /// <param name="fintoService"></param>
        /// <param name="logger"></param>
        /// <param name="userOrganizationService"></param>
        /// <param name="versionNumber"></param>
        public GeneralDescriptionBaseController(
            IGeneralDescriptionService generalDescriptionService,
            ICodeService codeService,
            IOptions <AppSettings> settings,
            IFintoService fintoService,
            ILogger logger,
            IUserOrganizationService userOrganizationService,
            int versionNumber) : base(userOrganizationService, settings, logger)
        {
            this.generalDescriptionService = generalDescriptionService;
            pageSize           = Settings.PageSize > 0 ? Settings.PageSize : 1000;
            this.versionNumber = versionNumber;

            this.codeService  = codeService;
            this.fintoService = fintoService;
        }
 public CodeController(IRepository <Code> codeRepository,
                       ICodeService codeService,
                       ILocalizationService localizationService,
                       IPermissionService permissionService,
                       HttpContextBase httpContext,
                       IWorkContext workContext,
                       IDbContext dbContext)
 {
     this._codeRepository      = codeRepository;
     this._localizationService = localizationService;
     this._codeService         = codeService;
     this._permissionService   = permissionService;
     this._httpContext         = httpContext;
     this._workContext         = workContext;
     this._dbContext           = dbContext;
 }
        public CodeController() {

            codeService = ObjectContext.Create<CodeService>();

            List<String> rootNs = MvcConfig.Instance.RootNamespace;
            foreach (String ns in rootNs) {

                String topLayoutStr = strUtil.Join( ns, "LayoutController", "." );
                Type topLayoutType = null;
                ObjectContext.Instance.TypeList.TryGetValue( topLayoutStr, out topLayoutType );
                if (topLayoutType != null) {
                    HideLayout( topLayoutType );
                }
            }

        }
Esempio n. 24
0
        //private readonly IEmailSender _emailSender;

        public RegisterModel(
            UserManager <ACMUser> userManager,
            SignInManager <ACMUser> signInManager,
            ILogger <RegisterModel> logger,
            ICodeService codeService,
            IIPService iPService
            //IEmailSender emailSender
            )
        {
            _userManager     = userManager;
            _signInManager   = signInManager;
            _logger          = logger;
            this.codeService = codeService;
            this.iPService   = iPService;
            // _emailSender = emailSender;
        }
        public CodeController()
        {
            codeService = ObjectContext.Create <CodeService>();

            List <String> rootNs = MvcConfig.Instance.RootNamespace;

            foreach (String ns in rootNs)
            {
                String topLayoutStr  = strUtil.Join(ns, "LayoutController", ".");
                Type   topLayoutType = null;
                ObjectContext.Instance.TypeList.TryGetValue(topLayoutStr, out topLayoutType);
                if (topLayoutType != null)
                {
                    HideLayout(topLayoutType);
                }
            }
        }
Esempio n. 26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OrganizationBaseController"/> class.
 /// </summary>
 /// <param name="organizationService">The organization service.</param>
 /// <param name="codeService">The code service.</param>
 /// <param name="settings">The settings.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="versionNumber">The version number.</param>
 /// <param name="commonService">The Common service.</param>
 /// <param name="userService">The user info service.</param>
 public OrganizationBaseController(
     IOrganizationService organizationService,
     ICodeService codeService,
     IOptions <AppSettings> settings,
     ILogger logger,
     ICommonService commonService,
     IUserOrganizationService userService,
     int versionNumber)
     : base(userService, settings, logger)
 {
     pageSize                 = Settings.PageSize > 0 ? Settings.PageSize : 1000;
     this.versionNumber       = versionNumber;
     this.organizationService = organizationService;
     this.codeService         = codeService;
     this.commonService       = commonService;
     this.userService         = userService;
 }
Esempio n. 27
0
 public AdminService(IUnitOfWork unitOfWork, IAllotFlowService allotFlowService, IProjectAllotFlowSurveyService projectAllotFlowSurveyService,
                     IHouseService houseService, ISysRoleMenuFunctionService functionService, IPhotoService photoService,
                     IProjectService projectService, IBuildingService buildingService, ICityService cityService,
                     IUserInfoService userService, ICodeService codeService, ITempletService templetService)
 {
     this._allotFlowService = allotFlowService;
     this._unitOfWork       = unitOfWork;
     this._houseService     = houseService;
     this._functionService  = functionService;
     this._projectAllotFlowSurveyService = projectAllotFlowSurveyService;
     this._photoService    = photoService;
     this._projectService  = projectService;
     this._buildingService = buildingService;
     this._cityService     = cityService;
     this._userService     = userService;
     this._codeService     = codeService;
     this._templetService  = templetService;
 }
 public AuthenticateService(
     IConfiguration configuration,
     UserRepository userRepository,
     CryptoHelper cryptoHelper,
     ITokenService tokenService,
     TokenRepository tokenRepository,
     CodeRepository codeRepository,
     ICodeService codeService
     )
 {
     _userRepository  = userRepository;
     _cryptoHelper    = cryptoHelper;
     _tokenService    = tokenService;
     _tokenRepository = tokenRepository;
     _codeRepository  = codeRepository;
     _codeService     = codeService;
     _secretKey       = configuration["AppSettings:Secret"];
 }
Esempio n. 29
0
        /// <summary>
        /// Ctor - channel validator
        /// </summary>
        /// <param name="model"></param>
        /// <param name="propertyName">Property name</param>
        /// <param name="commonService">Common service</param>
        /// <param name="codeService">Code service</param>
        /// <param name="serviceService">Service service</param>
        public ServiceChannelValidator(TModel model, string propertyName, ICommonService commonService, ICodeService codeService, IServiceService serviceService)
            : base(model, propertyName)
        {
            if (model == null)
            {
                throw new ArgumentNullException(PropertyName, $"{PropertyName} must be defined.");
            }

            this.codeService   = codeService;
            requiredLanguages  = new List <string>();
            availableLanguages = new List <string>();

            hours          = new ServiceHourListValidator <V4VmOpenApiServiceHour>(model.ServiceHours);
            organizationId = new OrganizationIdValidator(model.OrganizationId, commonService);
            languages      = new LanguageListValidator(model.Languages, codeService);
            phones         = new PhoneNumberListValidator <V4VmOpenApiPhone>(model.SupportPhones, codeService); // Support phone property is not required so no need to check language items (required/available languages)
            areas          = new AreaAndTypeValidator(model.Areas, model.AreaType, codeService);
            services       = new ServiceIdListValidator(model.ServiceChannelServices.ToList(), serviceService, "Services");
        }
 /// <summary>
 /// ServiceChannelController constructor.
 /// </summary>
 public ServiceChannelBaseController(
     IChannelService channelService,
     IOrganizationService organizationService,
     ICodeService codeService,
     IServiceService serviceService,
     IOptions <AppSettings> settings,
     ILogger logger,
     ICommonService commonService,
     int versionNumber,
     IUserOrganizationService userOrganizationService)
     : base(userOrganizationService, settings, logger)
 {
     this.channelService      = channelService;
     this.organizationService = organizationService;
     this.codeService         = codeService;
     this.serviceService      = serviceService;
     pageSize           = Settings.PageSize > 0 ? Settings.PageSize : 1000;
     this.versionNumber = versionNumber;
     this.commonService = commonService;
 }
Esempio n. 31
0
        public ValidatorTestBase()
        {
            codeServiceMockSetup = new Mock <ICodeService>();
            codeService          = codeServiceMockSetup.Object;

            commonServiceMockSetup = new Mock <ICommonService>();
            commonService          = commonServiceMockSetup.Object;

            generalDescriptionServiceMockSetup = new Mock <IGeneralDescriptionService>();
            generalDescriptionService          = generalDescriptionServiceMockSetup.Object;

            fintoServiceMockSetup = new Mock <IFintoService>();
            fintoService          = fintoServiceMockSetup.Object;

            channelServiceMockSetup = new Mock <IChannelService>();
            channelService          = channelServiceMockSetup.Object;

            serviceServiceMockSetup = new Mock <IServiceService>();
            serviceService          = serviceServiceMockSetup.Object;

            controller = new TestController();
        }
Esempio n. 32
0
 public CodeController(ICodeService codeService)
 {
     this.codeService = codeService;
 }
 public CodeController(IUnitOfWork inDb, ICodeService inService)
 {
     service = inService;
     service.InitialiseIValidationDictionary(new ModelStateWrapper(this.ModelState));
     db = inDb;
 }
Esempio n. 34
0
 public SysController(ICodeService codeServices)
 {
     _codeServices = codeServices;
 }
Esempio n. 35
0
 public CodeController(ICodeService codeService)
 {
     _codeService = codeService;
 }