Ejemplo n.º 1
0
 private void DomainService_Saved(IDomainService sender, SaveEventArgs <IDomain> e)
 {
     foreach (var entity in e.SavedEntities)
     {
         _distributedCache.RefreshDomainCache(entity);
     }
 }
 public _28_ServerErrorsDictionary(ILocalizationService localizationService, IDomainService domainService, ILogger logger)
 {
     this.localizationService = localizationService;
     this.domainService       = domainService;
     this.logger = logger;
     this.createDictionaryItems = false;
 }
Ejemplo n.º 3
0
 private void DomainService_Deleted(IDomainService sender, DeleteEventArgs <IDomain> e)
 {
     foreach (var entity in e.DeletedEntities)
     {
         _distributedCache.RemoveDomainCache(entity);
     }
 }
 public QuestionController(IQuestionService questionServ, ITestService testServ, IDomainService domainServ, ISubDomainService subDomainServ)
 {
     questionService  = questionServ;
     testService      = testServ;
     domainService    = domainServ;
     subDomainService = subDomainServ;
 }
Ejemplo n.º 5
0
        internal IFacadeUpdateResult <DomainData> SaveDomainMainMenu(object parentId, DomainMainMenuDto childDto)
        {
            ArgumentValidator.IsNotNull("parentId", parentId);
            ArgumentValidator.IsNotNull("childDto", childDto);

            FacadeUpdateResult <DomainData> result = new FacadeUpdateResult <DomainData>();
            IDomainService service     = UnitOfWork.GetService <IDomainService>();
            var            parentQuery = service.Retrieve(parentId);

            if (parentQuery.HasResult)
            {
                Domain         parent = parentQuery.ToBo <Domain>();
                DomainMainMenu child  = RetrieveOrNewDomainMainMenu(parent, childDto.Id);
                if (child != null)
                {
                    child.MainMenuId = childDto.MainMenuId;
                    child.Sort       = childDto.Sort;

                    var saveQuery = service.Save(parent);
                    result.Merge(saveQuery);
                    result.AttachResult(parent.RetrieveData <DomainData>());
                }
                else
                {
                    AddError(result.ValidationResult, "DomainMainMenuCannotBeFound");
                }
            }

            return(result);
        }
Ejemplo n.º 6
0
        public int CreateErrorNode(string documentTypeAlias, string nodeName, IDomainService domainService)
        {
            var docType   = contentTypeService.Get(documentTypeAlias);
            var languages = domainService.GetAll(false);

            try
            {
                IContent node = contentService.Create(nodeName, -1, documentTypeAlias);
                node.Name = nodeName;
                foreach (var language in languages)
                {
                    node.SetCultureName(nodeName, language.LanguageIsoCode);
                }

                contentService.Save(node);

                ConnectorContext.AuditService.Add(AuditType.New, -1, node.Id, "Error Content Node", $"Generic Error Node {nodeName} has been created");
                return(node.Id);
            }
            catch (Exception ex)
            {
                logger.Error(typeof(NodeHelper), ex.Message);
                logger.Error(typeof(NodeHelper), ex.StackTrace);
                throw;
            }
        }
 public CmsPortalManagerController(
     IPortalService portalService, IDomainService domainService, IAnalyticsAccountService analyticsAccountService)
 {
     this.portalService = portalService;
     this.domainService = domainService;
     this.analyticsAccountService = analyticsAccountService;
 }
 public AdvertiseController(IAdvertiseService advertise, IDomainService domain, IUserService user, ISubDomainService subDomain)
 {
     advertiseService = advertise;
     domainService    = domain;
     userService      = user;
     subDomainService = subDomain;
 }
 public DibsPageBuilder(IDomainService domainService, DibsMd5Computer dibsMd5Computer, IAbsoluteUrlService absoluteUrlService, ICallbackUrl callbackUrl)
 {
     _absoluteUrlService = absoluteUrlService;
     _callbackUrl        = callbackUrl;
     DomainService       = domainService;
     DibsMd5Computer     = dibsMd5Computer;
 }
Ejemplo n.º 10
0
 /// <summary>Creates Auth controller</summary>
 /// <param name="membershipService">Membership Service injection</param>
 /// <param name="mapper">Mapper injection</param>
 /// <param name="dataService">Common Data Service</param>
 /// <param name="domainservice">Domain service</param>
 public AuthController(IMembershipService membershipService, IMappingEngine mapper, ICommonDataService dataService, IDomainService domainservice)
 {
     this.membershipService = membershipService;
     this.mapper            = mapper;
     this.dataService       = dataService;
     this.domainservice     = domainservice;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WebFrameworkController"/> class.
 /// </summary>
 /// <param name="domainService">
 /// The domain service.
 /// </param>
 /// <param name="clientAssetTypeService"> </param>
 /// <param name="pageService">
 /// The page service.
 /// </param>
 /// <param name="pageTemplateService">
 /// The page template service.
 /// </param>
 /// <param name="pageTemplateZoneMapService">
 /// The page template zone map service.
 /// </param>
 /// <param name="pageZoneService">
 /// The page zone service.
 /// </param>
 /// <param name="partService">
 /// The part service.
 /// </param>
 /// <param name="partTypeService">
 /// The part type service.
 /// </param>
 /// <param name="seoDecoratorService">
 /// The seo decorator service.
 /// </param>
 /// <param name="userService">
 /// The user service.
 /// </param>
 /// <param name="clientAssetConfigService"> </param>
 /// <param name="clientAssetService"> </param>
 /// <param name="partContainerService"> </param>
 public WebFrameworkController(
     IDomainService domainService,
     IClientAssetConfigService clientAssetConfigService,
     IClientAssetService clientAssetService,
     IClientAssetTypeService clientAssetTypeService,
     IPageService pageService,
     IPageTemplateService pageTemplateService,
     IPageTemplateZoneMapService pageTemplateZoneMapService,
     IPageZoneService pageZoneService,
     IPartService partService,
     IPartTypeService partTypeService,
     ISeoDecoratorService seoDecoratorService,
     IUserService userService,
     IPartContainerService partContainerService)
 {
     this.modelBinder = new WebFrameworkServiceBinder(
         domainService,
         clientAssetConfigService,
         clientAssetService,
         clientAssetTypeService,
         pageService,
         pageTemplateService,
         pageTemplateZoneMapService,
         pageZoneService,
         partService,
         partTypeService,
         seoDecoratorService,
         userService,
         partContainerService);
 }
 public WebFrameworkServiceBinder(
     IDomainService domainService,
     IClientAssetConfigService clientAssetConfigService,
     IClientAssetService clientAssetService,
     IClientAssetTypeService clientAssetTypeService,
     IPageService pageService,
     IPageTemplateService pageTemplateService,
     IPageTemplateZoneMapService pageTemplateZoneMapService,
     IPageZoneService pageZoneService,
     IPartService partService,
     IPartTypeService partTypeService,
     ISeoDecoratorService seoDecoratorService,
     IUserService userService,
     IPartContainerService partContainerService)
 {
     this.domainService = domainService;
     this.clientAssetConfigService = clientAssetConfigService;
     this.clientAssetService = clientAssetService;
     this.clientAssetTypeService = clientAssetTypeService;
     this.pageService = pageService;
     this.pageTemplateService = pageTemplateService;
     this.pageTemplateZoneMapService = pageTemplateZoneMapService;
     this.pageZoneService = pageZoneService;
     this.partService = partService;
     this.partTypeService = partTypeService;
     this.seoDecoratorService = seoDecoratorService;
     this.userService = userService;
     this.partContainerService = partContainerService;
 }
Ejemplo n.º 13
0
        /// <summary>
        /// Creates a partial service context with only some services (for tests).
        /// </summary>
        /// <remarks>
        /// <para>Using a true constructor for this confuses DI containers.</para>
        /// </remarks>
        public static ServiceContext CreatePartial(
            IContentService contentService         = null,
            IMediaService mediaService             = null,
            IContentTypeService contentTypeService = null,
            IMediaTypeService mediaTypeService     = null,
            IDataTypeService dataTypeService       = null,
            IFileService fileService = null,
            ILocalizationService localizationService = null,
            IPackagingService packagingService       = null,
            IEntityService entityService             = null,
            IRelationService relationService         = null,
            IMemberGroupService memberGroupService   = null,
            IMemberTypeService memberTypeService     = null,
            IMemberService memberService             = null,
            IUserService userService            = null,
            ISectionService sectionService      = null,
            IApplicationTreeService treeService = null,
            ITagService tagService = null,
            INotificationService notificationService   = null,
            ILocalizedTextService localizedTextService = null,
            IAuditService auditService                           = null,
            IDomainService domainService                         = null,
            IMacroService macroService                           = null,
            IPublicAccessService publicAccessService             = null,
            IExternalLoginService externalLoginService           = null,
            IServerRegistrationService serverRegistrationService = null,
            IRedirectUrlService redirectUrlService               = null,
            IConsentService consentService                       = null)
        {
            Lazy <T> Lazy <T>(T service) => service == null ? null : new Lazy <T>(() => service);

            return(new ServiceContext(
                       Lazy(publicAccessService),
                       Lazy(domainService),
                       Lazy(auditService),
                       Lazy(localizedTextService),
                       Lazy(tagService),
                       Lazy(contentService),
                       Lazy(userService),
                       Lazy(memberService),
                       Lazy(mediaService),
                       Lazy(contentTypeService),
                       Lazy(mediaTypeService),
                       Lazy(dataTypeService),
                       Lazy(fileService),
                       Lazy(localizationService),
                       Lazy(packagingService),
                       Lazy(serverRegistrationService),
                       Lazy(entityService),
                       Lazy(relationService),
                       Lazy(treeService),
                       Lazy(sectionService),
                       Lazy(macroService),
                       Lazy(memberTypeService),
                       Lazy(memberGroupService),
                       Lazy(notificationService),
                       Lazy(externalLoginService),
                       Lazy(redirectUrlService),
                       Lazy(consentService)));
        }
Ejemplo n.º 14
0
 public UserController(IGraphTokenService graphTokenService, IUserService azureAdUserService, IHttpClientFactory httpClientFactory, IMapper mapper, IGroupService groupService, ISecretService secretService, IDomainService domainService)
     : base(graphTokenService, httpClientFactory, secretService)
 {
     _azureAdUserService = azureAdUserService;
     _domainService      = domainService;
     _mapper             = mapper;
 }
Ejemplo n.º 15
0
 public ContentCacheRefresher(AppCaches appCaches, IPublishedSnapshotService publishedSnapshotService, IdkMap idkMap, IDomainService domainService)
     : base(appCaches)
 {
     _publishedSnapshotService = publishedSnapshotService;
     _idkMap        = idkMap;
     _domainService = domainService;
 }
Ejemplo n.º 16
0
        internal IFacadeUpdateResult <DomainData> DeleteDomainSetupMenu(object parentId, object childId)
        {
            ArgumentValidator.IsNotNull("parentId", parentId);
            ArgumentValidator.IsNotNull("childId", childId);

            FacadeUpdateResult <DomainData> result = new FacadeUpdateResult <DomainData>();
            IDomainService service = UnitOfWork.GetService <IDomainService>();
            var            query   = service.Retrieve(parentId);

            if (query.HasResult)
            {
                Domain          parent = query.ToBo <Domain>();
                DomainSetupMenu child  = parent.DomainSetupMenus.SingleOrDefault(o => object.Equals(o.Id, childId));
                if (child != null)
                {
                    parent.DomainSetupMenus.Remove(child);
                    var saveQuery = parent.Save();
                    result.Merge(saveQuery);
                    result.AttachResult(parent.RetrieveData <DomainData>());
                }
                else
                {
                    AddError(result.ValidationResult, "DomainSetupMenuCannotBeFound");
                }
            }
            else
            {
                AddError(result.ValidationResult, "DomainCannotBeFound");
            }

            return(result);
        }
 public _04_RenantePhase2Milestone6DictionaryMigration(ILocalizationService localizationService, IDomainService domainService, ILogger logger)
 {
     this.localizationService = localizationService;
     this.domainService       = domainService;
     this.logger = logger;
     this.createDictionaryItems = false;
 }
Ejemplo n.º 18
0
 public _11_BettingHistoryPageIntegration(ILocalizationService localizationService, IDomainService domainService, IFileService fileService, ILogger logger, IContentTypeService contentTypeService)
 {
     this.localizationService = localizationService;
     this.domainService       = domainService;
     this.logger             = logger;
     this.contentTypeService = contentTypeService;
     this.fileService        = fileService;
 }
Ejemplo n.º 19
0
 public DomainInforController(IDomainInforService domainInforService
                     , IDomainService domainService
                     , ITabNameService tabNameService)
 {
     _domainInforService = domainInforService;
     _domainService = domainService;
     _tabNameService = tabNameService;
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Initializes a new instance based on the specified dependencies.
 /// </summary>
 /// <param name="logger"></param>
 /// <param name="scopeProvider"></param>
 /// <param name="domains"></param>
 /// <param name="contentService"></param>
 /// <param name="umbracoContextAccessor"></param>
 public RedirectsServiceDependencies(ILogger <RedirectsService> logger, IScopeProvider scopeProvider, IDomainService domains, IContentService contentService, IUmbracoContextAccessor umbracoContextAccessor)
 {
     Logger                 = logger;
     ScopeProvider          = scopeProvider;
     Domains                = domains;
     ContentService         = contentService;
     UmbracoContextAccessor = umbracoContextAccessor;
 }
Ejemplo n.º 21
0
 public _06_Phase2Milestone7(ILocalizationService localizationService, IDomainService domainService, ILogger logger, IContentTypeService contentTypeService)
 {
     this.localizationService = localizationService;
     this.domainService       = domainService;
     this.logger                = logger;
     this.contentTypeService    = contentTypeService;
     this.createDictionaryItems = false;
 }
Ejemplo n.º 22
0
 public ErrorPagesComponent(IUmbracoContextFactory contextFactory, IDomainService domainService, ILocalizationService localizationService, ILogger logger, IVariationContextAccessor variationContextAccessor)
 {
     _contextFactory      = contextFactory;
     _domainService       = domainService;
     _localizationService = localizationService;
     _logger = logger;
     _variationContextAccessor = variationContextAccessor;
 }
Ejemplo n.º 23
0
 public FormElementService(IDomainService domainService, IElementRepository <FormElementSettings> elementRepository, IEmailService emailService, IPageService pageService, ITenantService tenantService)
 {
     _domainService     = domainService;
     _elementRepository = elementRepository;
     _emailService      = emailService;
     _pageService       = pageService;
     _tenantService     = tenantService;
 }
Ejemplo n.º 24
0
 /// <summary>
 /// Initializes a new instance based on the specified <paramref name="dependencies"/>.
 /// </summary>
 /// <param name="dependencies">An instance of <see cref="RedirectsServiceDependencies"/>.</param>
 public RedirectsService(RedirectsServiceDependencies dependencies)
 {
     _logger                 = dependencies.Logger;
     _scopeProvider          = dependencies.ScopeProvider;
     _domains                = dependencies.Domains;
     _contentService         = dependencies.ContentService;
     _umbracoContextAccessor = dependencies.UmbracoContextAccessor;
 }
Ejemplo n.º 25
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="T1"></typeparam>
 /// <typeparam name="T2"></typeparam>
 /// <typeparam name="T3"></typeparam>
 /// <typeparam name="T4"></typeparam>
 /// <param name="domainService">领域服务。</param>
 /// <param name="domainContext">领域上下文。</param>
 /// <param name="method">领域方法。</param>
 /// <returns></returns>
 public static Task ExecuteAsync <T1, T2, T3, T4>(this IDomainService domainService, IDomainContext domainContext, Func <T1, T2, T3, T4, Task> method)
 {
     if (domainService == null)
     {
         throw new ArgumentNullException(nameof(domainService));
     }
     return(domainService.ExecuteAsync(domainContext, method.GetMethodInfo()));
 }
Ejemplo n.º 26
0
 public QaController(IQaService qa, ISubDomainService subDomain, IDomainService domain, IQuestionService question, IAnswerService answer)
 {
     qaService        = qa;
     subDomainService = subDomain;
     domainService    = domain;
     questionService  = question;
     answerService    = answer;
 }
 public _26_InPlayGamePageReconfiguration(ILocalizationService localizationService, IDomainService domainService, IFileService fileService, ILogger logger, IContentTypeService contentTypeService)
 {
     this.localizationService = localizationService;
     this.domainService       = domainService;
     this.logger             = logger;
     this.contentTypeService = contentTypeService;
     this.fileService        = fileService;
 }
Ejemplo n.º 28
0
 public _23_ErrorPageDocumentType(IContentTypeService contentTypeService, IDataTypeService dataTypeService, IFileService fileService, IDomainService domainService, ILogger logger)
 {
     this.contentTypeService = contentTypeService;
     this.dataTypeService    = dataTypeService;
     this.domainService      = domainService;
     this.fileService        = fileService;
     this.logger             = logger;
 }
Ejemplo n.º 29
0
 public ErrorPageService(IUmbracoContextFactory contextFactory, IDomainService domainService, ILogger logger, Uri originalRequest = null)
 {
     _contextFactory   = contextFactory;
     _domainService    = domainService;
     _logger           = logger;
     _contextReference = _contextFactory.EnsureUmbracoContext();
     _originalRequest  = originalRequest ?? _contextReference.UmbracoContext.HttpContext.Request.Url;
 }
 /// <summary>
 /// Returns the Umbraco page id to use as the Not Found page based on the configured 404 pages and the current request
 /// </summary>
 /// <param name="error404Collection"></param>
 /// <param name="requestServerName">
 /// The server name attached to the request, normally would be the source of HttpContext.Current.Request.ServerVariables["SERVER_NAME"]
 /// </param>
 /// <param name="entityService"></param>
 /// <param name="publishedContentQuery"></param>
 /// <param name="domainService"></param>
 /// <returns></returns>
 internal static int?GetCurrentNotFoundPageId(
     IContentErrorPage[] error404Collection,
     string requestServerName,
     IEntityService entityService,
     ITypedPublishedContentQuery publishedContentQuery,
     IDomainService domainService)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 31
0
        static Program()
        {
            var container = new UnityContainer();

            Bootstrapper.Configure(container);

            domainService = container.Resolve <DomainService>();
            rentService   = container.Resolve <RentService>();
        }
Ejemplo n.º 32
0
 public _40_GenericInfoPageDocumentType(ILocalizationService localizationService, IDomainService domainService, IFileService fileService, ILogger logger, IContentTypeService contentTypeService, IDataTypeService dataTypeService)
 {
     this.localizationService = localizationService;
     this.domainService       = domainService;
     this.logger             = logger;
     this.contentTypeService = contentTypeService;
     this.fileService        = fileService;
     this.dataTypeService    = dataTypeService;
 }
 public _08_SportsPageIntegration(ILocalizationService localizationService, IDomainService domainService, IFileService fileService, ILogger logger, IContentTypeService contentTypeService)
 {
     this.localizationService = localizationService;
     this.domainService       = domainService;
     this.logger                = logger;
     this.contentTypeService    = contentTypeService;
     this.fileService           = fileService;
     this.createDictionaryItems = false;
 }
 public CreateCompanyConsumer(
     ICreateCompanyWorkflow createCompanyWorkflowBuilder,
     IWorkflowCompanyActivityService workflowCompanyActivityService,
     IDomainService domainService)
 {
     _createCompanyWorkflowBuilder   = createCompanyWorkflowBuilder;
     _workflowCompanyActivityService = workflowCompanyActivityService;
     _domainService = domainService;
 }
        public ExtendedCatalogContext(
            IDomainService domainService,
            IRepository<ProductCatalogGroup> productCatalogGroupRepository,
            IRepository<ProductCatalog> productCatalogRepository,
            IRepository<PriceGroup> priceGroupRerpository
            )
            : base(domainService, productCatalogGroupRepository, productCatalogRepository, priceGroupRerpository)
        {

        }
Ejemplo n.º 36
0
 public ProductServiceImp(IRepositoryContext context,
     IProductRepository productRepository, 
     ICategoryRepository categoryRepository, 
     IProductCategorizationRepository productCategorizationRepository,
     IDomainService domainService) :base(context)
 {
     _categoryRepository = categoryRepository;
     _productRepository = productRepository;
     _productCategorizationRepository = productCategorizationRepository;
     _domainService = domainService;
 }
Ejemplo n.º 37
0
 public ProductServiceImp(
     IProductRepository productRepository,
     ICategoryRepository categoryRepository,
     IProductCategorizationRepository productCategorizationRepository,
     IDomainService domainService)
 {
     _categoryRepository = categoryRepository;
     _productRepository = productRepository;
     _productCategorizationRepository = productCategorizationRepository;
     _domainService = domainService;
 }
Ejemplo n.º 38
0
 public PostService(IRepositoryContext repositoryContext,
                    ITopicRepository topicRepository,
                    IUserRepository userRepository,
                    IPostRepository postRepository,
                    IDomainService domainService) : base(repositoryContext)
 {
     this.topicRepository = topicRepository;
     this.userRepository = userRepository;
     this.postRepository = postRepository;
     this.domainService = domainService;
 }
 public WebCoreServiceBinder(
     IPageService pageService,
     ISeoDecoratorService seoDecoratorService,
     ISeoRouteValueService seoRouteValueService,
     IDomainService domainService)
 {
     this.pageService = pageService;
     this.seoDecoratorService = seoDecoratorService;
     this.seoRouteValueService = seoRouteValueService;
     this.domainService = domainService;
 }
Ejemplo n.º 40
0
 /// <summary>
 /// 初始化一个<c>ProductServiceImpl</c>类型的实例。
 /// </summary>
 /// <param name="context">用来初始化<c>ProductServiceImpl</c>类型的仓储上下文实例。</param>
 /// <param name="laptopRepository">“笔记本电脑”仓储实例。</param>
 public ProductServiceImpl(IRepositoryContext context,
     ICategoryRepository categoryRepository,
     IProductRepository productRepository,
     ICategorizationRepository categorizationRepository,
     IDomainService domainService)
     : base(context)
 {
     this.categoryRepository = categoryRepository;
     this.productRepository = productRepository;
     this.categorizationRepository = categorizationRepository;
     this.domainService = domainService;
 }
Ejemplo n.º 41
0
 public UserServiceImp(
     IUserRepository userRepository,
     IShoppingCartRepository shoppingCartRepository,
     IDomainService domainService,
     IRoleRepository roleRepository,
     IUserRoleRepository userRoleRepository)
 {
     _userRepository = userRepository;
     _shoppingCartRepository = shoppingCartRepository;
     _domainService = domainService;
     _roleRepository = roleRepository;
     _userRoleRepository = userRoleRepository;
 }
Ejemplo n.º 42
0
 public UserServiceImp(IRepositoryContext repositoryContext,
     IUserRepository userRepository,
     IShoppingCartRepository shoppingCartRepository,
     IDomainService domainService,
     IRoleRepository roleRepository,
     IUserRoleRepository userRoleRepository)
     : base(repositoryContext)
 {
     _userRepository = userRepository;
     _shoppingCartRepository = shoppingCartRepository;
     _domainService = domainService;
     _roleRepository = roleRepository;
     _userRoleRepository = userRoleRepository;
 }
Ejemplo n.º 43
0
 /// <summary>
 /// 初始化一个<c>OrderServiceImpl</c>类型的实例。
 /// </summary>
 /// <param name="context">用来初始化<c>OrderServiceImpl</c>类型的仓储上下文实例。</param>
 /// <param name="shoppingCartRepository">“购物篮”仓储实例。</param>
 /// <param name="shoppingCartItemRepository">“购物篮项目”仓储实例。</param>
 /// <param name="productRepository">“笔记本电脑”仓储实例。</param>
 /// <param name="customerRepository">“客户”仓储实例。</param>
 /// <param name="salesOrderRepository">“销售订单”仓储实例。</param>
 public OrderServiceImpl(IRepositoryContext context,
     IShoppingCartRepository shoppingCartRepository,
     IShoppingCartItemRepository shoppingCartItemRepository,
     IProductRepository productRepository,
     IUserRepository customerRepository,
     ISalesOrderRepository salesOrderRepository,
     IDomainService domainService)
     : base(context)
 {
     this.shoppingCartRepository = shoppingCartRepository;
     this.shoppingCartItemRepository = shoppingCartItemRepository;
     this.productRepository = productRepository;
     this.userRepository = customerRepository;
     this.salesOrderRepository = salesOrderRepository;
     this.domainService = domainService;
 }
Ejemplo n.º 44
0
 /// <summary>
 /// 初始化一个新的<c>UserServiceImpl</c>实例。
 /// </summary>
 /// <param name="context"></param>
 /// <param name="userRepository"></param>
 /// <param name="userRoleRepository"></param>
 /// <param name="roleRepository"></param>
 /// <param name="shoppingCartRepository"></param>
 /// <param name="salesOrderRepository"></param>
 /// <param name="domainService"></param>
 public UserServiceImpl(IRepositoryContext context,
     IUserRepository userRepository,
     IUserRoleRepository userRoleRepository,
     IRoleRepository roleRepository,
     IShoppingCartRepository shoppingCartRepository,
     ISalesOrderRepository salesOrderRepository,
     IDomainService domainService)
     : base(context)
 {
     this.userRepository = userRepository;
     this.userRoleRepository = userRoleRepository;
     this.roleRepository = roleRepository;
     this.shoppingCartRepository = shoppingCartRepository;
     this.salesOrderRepository = salesOrderRepository;
     this.domainService = domainService;
 }
Ejemplo n.º 45
0
 public OrderServiceImp(IUserRepository userRepository,
     IShoppingCartRepository shoppingCartRepository,
     IProductRepository productRepository,
     IShoppingCartItemRepository shoppingCartItemRepository,
     IDomainService domainService,
     IOrderRepository orderRepository,
     IEventBus eventBus)
 {
     _userRepository = userRepository;
     _shoppingCartRepository = shoppingCartRepository;
     _productRepository = productRepository;
     _shoppingCartItemRepository = shoppingCartItemRepository;
     _domainService = domainService;
     _orderRepository = orderRepository;
     _eventBus = eventBus;
 }
 /// <summary>
 /// 初始化一个<c>OrderServiceImpl</c>类型的实例。
 /// </summary>
 /// <param name="context">用来初始化<c>OrderServiceImpl</c>类型的仓储上下文实例。</param>
 /// <param name="shoppingCartRepository">“购物篮”仓储实例。</param>
 /// <param name="shoppingCartItemRepository">“购物篮项目”仓储实例。</param>
 /// <param name="productRepository">“笔记本电脑”仓储实例。</param>
 /// <param name="customerRepository">“客户”仓储实例。</param>
 /// <param name="salesOrderRepository">“销售订单”仓储实例。</param>
 /// <param name="domainService">领域服务实例</param>
 /// <param name="bus">事件总线实例</param>
 public OrderServiceImpl(IRepositoryContext context,
     IShoppingCartRepository shoppingCartRepository,
     IShoppingCartItemRepository shoppingCartItemRepository,
     IProductRepository productRepository,
     IUserRepository customerRepository,
     ISalesOrderRepository salesOrderRepository,
     IDomainService domainService,
     IEventBus bus)
     : base(context)
 {
     _shoppingCartRepository = shoppingCartRepository;
     _shoppingCartItemRepository = shoppingCartItemRepository;
     _productRepository = productRepository;
     _userRepository = customerRepository;
     _salesOrderRepository = salesOrderRepository;
     _domainService = domainService;
     _bus = bus;
 }
Ejemplo n.º 47
0
        /// <summary>
        /// 初始化一个<c>OrderServiceImpl</c>类型的实例。
        /// </summary>
        /// <param name="context">用来初始化<c>OrderServiceImpl</c>类型的仓储上下文实例。</param>
        /// <param name="shoppingCartRepository">“购物篮”仓储实例。</param>
        /// <param name="shoppingCartItemRepository">“购物篮项目”仓储实例。</param>
        /// <param name="productRepository">“笔记本电脑”仓储实例。</param>
        /// <param name="customerRepository">“客户”仓储实例。</param>
        /// <param name="salesOrderRepository">“销售订单”仓储实例。</param>
        public OrderServiceImpl(IRepositoryContext context,
            IShoppingCartRepository shoppingCartRepository,
            IShoppingCartItemRepository shoppingCartItemRepository,
            IProductRepository productRepository,
            IUserRepository customerRepository,
            ISalesOrderRepository salesOrderRepository,
            IDomainService domainService,
            IDomainEventHandler<OrderDispatchedEvent>[] orderDispatchedDomainEventHandlers)
            :base(context)
        {
            this.shoppingCartRepository = shoppingCartRepository;
            this.shoppingCartItemRepository = shoppingCartItemRepository;
            this.productRepository = productRepository;
            this.userRepository = customerRepository;
            this.salesOrderRepository = salesOrderRepository;
            this.domainService = domainService;
            this.orderDispatchedDomainEventHandlers.AddRange(orderDispatchedDomainEventHandlers);

            foreach (var handler in this.orderDispatchedDomainEventHandlers)
                DomainEventAggregator.Subscribe<OrderDispatchedEvent>(handler);
            DomainEventAggregator.Subscribe<OrderConfirmedEvent>(orderConfirmedEventHandlerAction);
            DomainEventAggregator.Subscribe<OrderConfirmedEvent>(orderConfirmedEventHandlerAction2);
        }
Ejemplo n.º 48
0
        /// <summary>
        /// Строки 2.1.1 - 2.1.4
        /// </summary>
        /// <param name="servAppealCitsSource"></param>
        /// <param name="servAppealCitsRealityObject"></param>
        /// <param name="zonalByMuIdDict"></param>
        /// <returns></returns>
        private Dictionary<int, Dictionary<string, int>> GetAppealCitsForRevenueForDict(
            IDomainService<AppealCitsSource> servAppealCitsSource,
            IDomainService<AppealCitsRealityObject> servAppealCitsRealityObject)
        {
            var codesRevenueForm = new[] { "9", "1", "12", "13", "19", "10", "5" };

            return servAppealCitsSource.GetAll()
                .Join(
                    servAppealCitsRealityObject.GetAll(),
                    x => x.AppealCits.Id,
                    y => y.AppealCits.Id,
                    (a, b) => new { AppealCitSource = a, appealRealObj = b })
                .Join(
                    this.Container.Resolve<IDomainService<ZonalInspectionMunicipality>>().GetAll(),
                    x => x.appealRealObj.RealityObject.Municipality.Id,
                    y => y.Municipality.Id,
                    (c, d) => new { c.AppealCitSource, c.appealRealObj, ZonalInspectionMunicipality = d })
                .WhereIf(this.municipalityIds.Length > 0, x => this.municipalityIds.Contains(x.appealRealObj.RealityObject.Municipality.Id))
                .Where(x => x.AppealCitSource.AppealCits.DateFrom >= this.dateStart && x.AppealCitSource.AppealCits.DateFrom <= this.dateEnd)
                .Where(x => codesRevenueForm.Contains(x.AppealCitSource.RevenueForm.Code))
                .Where(x => (x.AppealCitSource.AppealCits.ZonalInspection.ShortName != "ГЖИРТ" && x.ZonalInspectionMunicipality.ZonalInspection.ShortName != "ГЖИРТ")
                    || x.ZonalInspectionMunicipality.ZonalInspection.ShortName == "ГЖИРТ")

                .Select(x => new
                {
                    x.AppealCitSource.RevenueForm.Code,
                    AppealCitsId = x.AppealCitSource.AppealCits.Id,
                    zjiId = x.ZonalInspectionMunicipality.ZonalInspection.Id,
                    x.AppealCitSource.AppealCits.DocumentNumber
                })
                .AsEnumerable()
                .GroupBy(x => x.zjiId)
                .ToDictionary(x => x.Key, x => x.GroupBy(y => y.Code).ToDictionary(y => y.Key, y => y.Select(z => z.AppealCitsId).Distinct().Count()));
        }
Ejemplo n.º 49
0
 /// <summary>
 /// Строка 2.1  Всего поступило обращений с начала года
 /// </summary>
 /// <param name="service"></param>
 /// <param name="servAppealCitsRealityObject"></param>
 /// <param name="zonalByMuIdDict"></param>
 /// <returns></returns>
 private Dictionary<int, int> GetAppealCitsForZonalInspDict(
     IDomainService<AppealCits> service,
     IDomainService<AppealCitsRealityObject> servAppealCitsRealityObject,
     Dictionary<int, int> zonalByMuIdDict)
 {
     return service.GetAll()
         .Join(servAppealCitsRealityObject.GetAll(), x => x.Id, y => y.AppealCits.Id, (a, b) => new { AppealCit = a, AppealRealObj = b })
         .WhereIf(this.municipalityIds.Length > 0, x => this.municipalityIds.Contains(x.AppealRealObj.RealityObject.Municipality.Id))
         .Where(x => x.AppealCit.DateFrom >= this.dateStart && x.AppealCit.DateFrom <= this.dateEnd)
         .Where(x => x.AppealCit.ZonalInspection.ShortName != "ГЖИРТ")
         .Select(x => new { AppealCitsId = x.AppealCit.Id, MunicipalityId = x.AppealRealObj.RealityObject.Municipality.Id })
         .AsEnumerable()
         .GroupBy(x => zonalByMuIdDict.ContainsKey(x.MunicipalityId) ? zonalByMuIdDict[x.MunicipalityId] : -1)
         .ToDictionary(x => x.Key, x => x.Select(y => y.AppealCitsId).Distinct().Count());
 }
Ejemplo n.º 50
0
 /// <summary>
 /// 4.2 оформлено протоколов по ст. 19.5
 /// </summary>
 /// <param name="servBaseStatementAppealCits">
 /// </param>
 /// <param name="servAppealCitsRealityObject">
 /// </param>
 /// <param name="servProtocol">
 /// </param>
 /// <returns>
 /// </returns>
 private Dictionary<int, int> GetCountProtocol195First(
     IDomainService<InspectionAppealCits> servBaseStatementAppealCits,
     IDomainService<AppealCitsRealityObject> servAppealCitsRealityObject,
     IDomainService<Protocol> servProtocol,
     Dictionary<int, int> zonalByMuIdDict)
 {
     return servBaseStatementAppealCits.GetAll()
        .Join(
            servAppealCitsRealityObject.GetAll(),
            x => x.AppealCits.Id,
            y => y.AppealCits.Id,
            (a, b) => new { baseApp = a, appByRealObj = b })
        .WhereIf(this.municipalityIds.Length > 0, y => this.municipalityIds.Contains(y.appByRealObj.RealityObject.Municipality.Id))
        .Where(x => x.baseApp.AppealCits.ZonalInspection != null
             && x.baseApp.AppealCits.DateFrom != null && x.baseApp.AppealCits.DateFrom >= this.dateStart && x.baseApp.AppealCits.DateFrom <= this.dateEnd)
         .Where(y => servProtocol.GetAll().Any(x => x.Inspection.Id == y.baseApp.Inspection.Id))
         .Select(y =>
             new
             {
                 BaseStatementId = y.baseApp.Inspection.Id,
                 CountProtocol = Container.Resolve<IDomainService<ProtocolArticleLaw>>().GetAll()
                 .Count(x => x.Protocol.Inspection.Id == y.baseApp.Inspection.Id
                     && x.Protocol.Stage.Parent.TypeStage == TypeStage.DisposalPrescription
                     && (x.ArticleLaw.Code == "1" || x.ArticleLaw.Code == "7")),
                 muId = y.appByRealObj.RealityObject.Municipality.Id
             })
            .AsEnumerable()
            .GroupBy(x => zonalByMuIdDict.ContainsKey(x.muId) ? zonalByMuIdDict[x.muId] : -1)
            .ToDictionary(x => x.Key, x => x.Distinct(y => y.BaseStatementId).Select(y => y.CountProtocol).Sum());
 }
Ejemplo n.º 51
0
        /// <summary>
        /// 使用反射把返回结果的值修改到当前对象上。
        /// </summary>
        /// <param name="res"></param>
        private void ReadOutput(IDomainService res)
        {
            foreach (var contractType in this.GetContractType())
            {
                var properties = contractType.GetProperties();
                foreach (var property in properties)
                {
                    if (ServiceHelper.IsOutput(property))
                    {
                        var value = property.GetValue(res, null);

                        try
                        {
                            property.SetValue(this, value, null);
                        }
                        catch { }
                    }
                }
            }
        }
Ejemplo n.º 52
0
 /// <summary>
 /// 3 Рассмотрено с выездом на место
 /// </summary>
 /// <param name="servBaseStatementAppealCits">
 /// </param>
 /// <param name="servAppealCitsRealityObject">
 /// </param>
 /// <param name="servDisposal">
 /// </param>
 /// <param name="servActCheck">
 /// </param>
 /// <param name="zonalByMuIdDict"></param>
 /// <returns>
 /// </returns>
 private Dictionary<int, int> GetNotPlannedExit(
     IDomainService<InspectionAppealCits> servBaseStatementAppealCits,
     IDomainService<AppealCitsRealityObject> servAppealCitsRealityObject,
     IDomainService<Disposal> servDisposal,
     IDomainService<ActCheck> servActCheck,
     Dictionary<int, int> zonalByMuIdDict)
 {
     return servBaseStatementAppealCits.GetAll()
         .Join(
             servAppealCitsRealityObject.GetAll(),
             x => x.AppealCits.Id,
             y => y.AppealCits.Id,
             (a, b) => new { baseApp = a, appByRealObj = b })
         .WhereIf(this.municipalityIds.Length > 0, y => this.municipalityIds.Contains(y.appByRealObj.RealityObject.Municipality.Id))
         .Where(x => x.baseApp.AppealCits.DateFrom != null && x.baseApp.AppealCits.DateFrom >= this.dateStart && x.baseApp.AppealCits.DateFrom <= this.dateEnd)
         .Where(x => x.baseApp.AppealCits.ZonalInspection != null && x.baseApp.AppealCits.DateFrom != null)
         .Where(x => x.baseApp.AppealCits.SuretyResolve != null && (x.baseApp.AppealCits.SuretyResolve.Code == "1" || x.baseApp.AppealCits.SuretyResolve.Code == "2"))
         .Where(y => servDisposal.GetAll().Any(x => x.Inspection.Id == y.baseApp.Inspection.Id && x.KindCheck != null && x.KindCheck.Code == TypeCheck.NotPlannedExit))
         .Where(y => servActCheck.GetAll().Any(x => x.Inspection.Id == y.baseApp.Inspection.Id))
         .Select(x => new { AppealCitsId = x.baseApp.AppealCits.Id, muId = x.appByRealObj.RealityObject.Municipality.Id })
         .AsEnumerable()
         .GroupBy(x => zonalByMuIdDict.ContainsKey(x.muId) ? zonalByMuIdDict[x.muId] : -1)
         .ToDictionary(x => x.Key, x => x.Select(y => y.AppealCitsId).Distinct().Count());
 }
Ejemplo n.º 53
0
        /// <summary>
        /// 4.8- снято с контроля (решено положительно) 
        /// Количество документов "Предписание", у которых есть зависимые акты обследования, у которых в поле "Наличие нарушений" стоит значение "Нарушения не выявлены"
        /// </summary>
        /// <param name="servBaseStatementAppealCits">
        /// The serv Base Statement Appeal Cits.
        /// </param>
        /// <param name="servAppealCitsRealityObject">
        /// The serv Appeal Cits Reality Object.
        /// </param>
        /// <param name="zonalByMuIdDict"></param>
        /// <returns>
        /// </returns>
        private Dictionary<int, int> GetRemovedFromControl(
            IDomainService<InspectionAppealCits> servBaseStatementAppealCits,
            IDomainService<AppealCitsRealityObject> servAppealCitsRealityObject,
            Dictionary<int, int> zonalByMuIdDict)
        {
            // Берем все предписания и протоколы с постановлением у обращений со статусом закрыто
            var close = servBaseStatementAppealCits.GetAll()
               .Join(
                   servAppealCitsRealityObject.GetAll(),
                   x => x.AppealCits.Id,
                   y => y.AppealCits.Id,
                   (a, b) => new { baseApp = a, appByRealObj = b })
               .WhereIf(this.municipalityIds.Length > 0, y => this.municipalityIds.Contains(y.appByRealObj.RealityObject.Municipality.Id))
               .Where(x => x.baseApp.AppealCits.ZonalInspection != null && x.baseApp.AppealCits.DateFrom != null)
                 .Where(x => x.baseApp.AppealCits.DateFrom >= this.dateStart && x.baseApp.AppealCits.DateFrom <= this.dateEnd)
                 .Where(x => x.baseApp.AppealCits.State.Code == "Закрыто")
                 .Select(y =>
                    new
                    {
                        BaseStatementId = y.baseApp.Inspection.Id,
                        StateCode = y.baseApp.AppealCits.State.Code,
                        Count = Container.Resolve<IDomainService<Prescription>>().GetAll().Count(x => x.Inspection.Id == y.baseApp.Inspection.Id)
                        + Container.Resolve<IDomainService<DocumentGjiChildren>>().GetAll().Count(x => x.Parent.Inspection.Id == y.baseApp.Inspection.Id
                            && x.Parent.TypeDocumentGji == TypeDocumentGji.Protocol && x.Children.TypeDocumentGji == TypeDocumentGji.Resolution),
                        muId = y.appByRealObj.RealityObject.Municipality.Id
                    })
                 .ToList();

            var baseStatementId = close.Select(x => x.BaseStatementId).ToArray();

            // Берем все предписания и протоколы с постановлением у не закрытых обращений
            var inWork = servBaseStatementAppealCits.GetAll()
               .Join(
                   servAppealCitsRealityObject.GetAll(),
                   x => x.AppealCits.Id,
                   y => y.AppealCits.Id,
                   (a, b) => new { baseApp = a, appByRealObj = b })
               .WhereIf(this.municipalityIds.Length > 0, y => this.municipalityIds.Contains(y.appByRealObj.RealityObject.Municipality.Id))
               .Where(x => x.baseApp.AppealCits.ZonalInspection != null && x.baseApp.AppealCits.DateFrom != null)
                .Where(x => x.baseApp.AppealCits.DateFrom >= this.dateStart && x.baseApp.AppealCits.DateFrom <= this.dateEnd)
                .Where(x => x.baseApp.AppealCits.State.Code != "Закрыто")
                .Select(y =>
                   new
                   {
                       BaseStatementId = y.baseApp.Inspection.Id,
                       StateCode = y.baseApp.AppealCits.State.Code,
                       Count = Container.Resolve<IDomainService<ActRemoval>>().GetAll()
                       .Count(x => x.Inspection.Id == y.baseApp.Inspection.Id && x.TypeRemoval == YesNoNotSet.Yes)
                       + Container.Resolve<IDomainService<DocumentGjiChildren>>().GetAll().Count(x => x.Parent.Inspection.Id == y.baseApp.Inspection.Id
                           && x.Parent.TypeDocumentGji == TypeDocumentGji.Protocol && x.Children.TypeDocumentGji == TypeDocumentGji.Resolution),
                       muId = y.appByRealObj.RealityObject.Municipality.Id
                   })
               .AsEnumerable()
               .Where(x => !baseStatementId.Contains(x.BaseStatementId)) // исключим из них те которые в закрытых Обращениях уже есть
               .ToList();

            close.AddRange(inWork);
            return close.GroupBy(x => zonalByMuIdDict.ContainsKey(x.muId) ? zonalByMuIdDict[x.muId] : -1).ToDictionary(x => x.Key, x => x.Distinct(y => y.BaseStatementId).Select(y => y.Count).Sum());
        }
Ejemplo n.º 54
0
 internal PhoneBuilder(IDomainService domainService, IPhoneRepository phoneRepository)
 {
     _domainService = domainService;
     _phoneRepository = phoneRepository;
 }
Ejemplo n.º 55
0
 internal AccessDeviceBuilder(IDomainService domainService, IAccessDeviceRepository accessDeviceRepository)
 {
     _domainService = domainService;
     _accessDeviceRepository = accessDeviceRepository;
 }
Ejemplo n.º 56
0
 public HomeController(ICategoryService categoryService, IDomainService domainService, IDomainInforService domainInforService)
 {
     _domainInforService = domainInforService;
     _categoryService = categoryService;
     _domainService = domainService;
 }
Ejemplo n.º 57
0
        /// <summary>
        /// 2.2 Данные по ГЖИРТ с разбивкой по районам ЗЖИ
        /// </summary>
        /// <param name="zonalInspectionDict"></param>
        /// <param name="servAppealCitsSource"></param>
        /// <param name="servAppealCitsRealityObject"></param>
        /// <returns></returns>
        private Dictionary<int, int> GetAppealCitsForInspRt(Dictionary<int, ZonalInspectionProxy> zonalInspectionDict, IDomainService<AppealCitsSource> servAppealCitsSource, IDomainService<AppealCitsRealityObject> servAppealCitsRealityObject)
        {
            var appealCitsForInspectionRtDict = new Dictionary<int, int>();
            foreach (var zonalInspection in zonalInspectionDict)
            {
                var zonalInspMunicipality = zonalInspection.Value.MunicipalityIds;
                var appealCitsCount = servAppealCitsSource.GetAll()
                     .Where(y => servAppealCitsRealityObject.GetAll()
                                 .Any(x => x.AppealCits.Id == y.AppealCits.Id && zonalInspMunicipality.Contains(x.RealityObject.Municipality.Id)))
                                 .Where(x => x.AppealCits.DateFrom != null && x.AppealCits.DateFrom >= this.dateStart && x.AppealCits.DateFrom <= this.dateEnd)
                                 .Where(x => x.AppealCits.ZonalInspection.ShortName == "ГЖИРТ")
                                 .Select(x => new { AppealCitsId = x.AppealCits.Id })
                                 .AsEnumerable()
                                 .Distinct()
                                 .Count();

                appealCitsForInspectionRtDict.Add(zonalInspection.Key, appealCitsCount);
            }

            return appealCitsForInspectionRtDict;
        }
Ejemplo n.º 58
0
 // ReSharper disable once UnusedMember.Global
 internal Location(IDomainService domainService)
 {
     _domainService = domainService;
 }
Ejemplo n.º 59
0
        private Dictionary<int, Dictionary<int, int>> GetTakeOnControl(
            IDomainService<InspectionAppealCits> servBaseStatementAppealCits,
            IDomainService<AppealCitsRealityObject> servAppealCitsRealityObject,
            Dictionary<int, int> zonalByMuIdDict)
        {
            var date = dateStart.AddYears(-4);

            // В поле «Резолюция» значение: проверить с выходом на место или проверить с выходом на место (по согласованию с прокуратурой) 1.1. Нет Распоряжения.
            var takenOnControl = servBaseStatementAppealCits.GetAll()
                .Join(
                servAppealCitsRealityObject.GetAll(),
                x => x.AppealCits.Id,
                y => y.AppealCits.Id,
                (a, b) => new { baseAppeal = a, appealRealObj = b })
                .WhereIf(this.municipalityIds.Length > 0, y => this.municipalityIds.Contains(y.appealRealObj.RealityObject.Municipality.Id))
                .Where(x => x.baseAppeal.AppealCits.ZonalInspection != null
                      && x.baseAppeal.AppealCits.DateFrom != null &&
                      x.baseAppeal.AppealCits.DateFrom >= date && (x.baseAppeal.AppealCits.SuretyResolve.Code == "1" || x.baseAppeal.AppealCits.SuretyResolve.Code == "2"))
                  .Where(y => !this.Container.Resolve<IDomainService<DocumentGji>>().GetAll().Any(x => x.Inspection.Id == y.baseAppeal.Inspection.Id && x.TypeDocumentGji == TypeDocumentGji.Disposal))
                  .Select(x => new
                  {
                      AppealCitsId = x.baseAppeal.AppealCits.Id,
                      x.baseAppeal.AppealCits.DateFrom,
                      muId = x.appealRealObj.RealityObject.Municipality.Id
                  })
                  .ToList();

            // Есть Распоряжение.
            // У проверки есть нарушения у которых не проставлена "Дата факт. исполнения"
            takenOnControl.AddRange(servBaseStatementAppealCits.GetAll()
                .Join(
                servAppealCitsRealityObject.GetAll(),
                x => x.AppealCits.Id,
                y => y.AppealCits.Id,
                (a, b) => new { baseAppeal = a, appealRealObj = b })
                .WhereIf(this.municipalityIds.Length > 0, y => this.municipalityIds.Contains(y.appealRealObj.RealityObject.Municipality.Id))
                .Where(x => x.baseAppeal.AppealCits.ZonalInspection != null && x.baseAppeal.AppealCits.DateFrom != null
                    && x.baseAppeal.AppealCits.DateFrom != null && x.baseAppeal.AppealCits.DateFrom >= date
                    && (x.baseAppeal.AppealCits.SuretyResolve.Code == "1" || x.baseAppeal.AppealCits.SuretyResolve.Code == "2"))
                .Where(y => this.Container.Resolve<IDomainService<InspectionGjiViol>>().GetAll().Any(x => x.Inspection.Id == y.baseAppeal.Inspection.Id && x.DateFactRemoval == null))
                .Select(x => new
                {
                    AppealCitsId = x.baseAppeal.AppealCits.Id,
                    x.baseAppeal.AppealCits.DateFrom,
                    muId = x.appealRealObj.RealityObject.Municipality.Id
                })
                .ToList());

            // 1.3. Есть распоряжение. И есть Акт, у которого в поле "нарушения выявлено" стоит "не задано"
            takenOnControl.AddRange(servBaseStatementAppealCits.GetAll()
                .Join(
                servAppealCitsRealityObject.GetAll(),
                x => x.AppealCits.Id,
                y => y.AppealCits.Id,
                (a, b) => new { baseAppeal = a, appealRealObj = b })
                .WhereIf(this.municipalityIds.Length > 0, y => this.municipalityIds.Contains(y.appealRealObj.RealityObject.Municipality.Id))
                .Where(x => x.baseAppeal.AppealCits.ZonalInspection != null
                             && x.baseAppeal.AppealCits.DateFrom != null && x.baseAppeal.AppealCits.DateFrom >= date
                             && (x.baseAppeal.AppealCits.SuretyResolve.Code == "1" || x.baseAppeal.AppealCits.SuretyResolve.Code == "2"))
                .Where(y => this.Container.Resolve<IDomainService<ActCheckRealityObject>>().GetAll()
                .Any(x => x.ActCheck.Inspection.Id == y.baseAppeal.Inspection.Id && x.HaveViolation == YesNoNotSet.NotSet))
                .Select(x => new
                {
                    AppealCitsId = x.baseAppeal.AppealCits.Id,
                    x.baseAppeal.AppealCits.DateFrom,
                    muId = x.appealRealObj.RealityObject.Municipality.Id
                })
                .ToList());

            // Пункт 2 условия В поле «Резолюция» значение: Дать отчет без выхода на место или Перенаправить в подведомственную организацию.
            // Во вкладке «Ответы» нет записей со значением в поле «Номер».
            takenOnControl.AddRange(servBaseStatementAppealCits.GetAll()
                .Join(
                servAppealCitsRealityObject.GetAll(),
                x => x.AppealCits.Id,
                y => y.AppealCits.Id,
                (a, b) => new { baseAppeal = a, appealRealObj = b })
                .WhereIf(this.municipalityIds.Length > 0, y => this.municipalityIds.Contains(y.appealRealObj.RealityObject.Municipality.Id))
                .Where(x => x.baseAppeal.AppealCits.ZonalInspection != null
                    && x.baseAppeal.AppealCits.DateFrom != null && x.baseAppeal.AppealCits.DateFrom >= date
                                               && (x.baseAppeal.AppealCits.SuretyResolve.Code == "3" || x.baseAppeal.AppealCits.SuretyResolve.Code == "4"))
                .Where(y => this.Container.Resolve<IDomainService<AppealCitsAnswer>>().GetAll().All(x => x.AppealCits.Id == y.baseAppeal.AppealCits.Id && x.DocumentNumber == null))
                .Select(x => new
                {
                    AppealCitsId = x.baseAppeal.AppealCits.Id,
                    x.baseAppeal.AppealCits.DateFrom,
                    muId = x.appealRealObj.RealityObject.Municipality.Id
                })
                .ToList());

            return takenOnControl.Distinct(x => x.AppealCitsId).GroupBy(x => zonalByMuIdDict.ContainsKey(x.muId) ? zonalByMuIdDict[x.muId] : -1 )
                                 .ToDictionary(
                                     x => x.Key,
                                     x =>
                                     x.GroupBy(y => y.DateFrom.Value.Year)
                                      .ToDictionary(y => y.Key, y => y.Count()));
        }
Ejemplo n.º 60
0
 internal Phone(IDomainService domainService)
 {
     _domainService = domainService;
 }