Ejemplo n.º 1
0
 public DirectSalesOrderController(
     IOrganizationService OrganizationService,
     IEditedPriceStatusService EditedPriceStatusService,
     IStoreService StoreService,
     IAppUserService AppUserService,
     IUnitOfMeasureService UnitOfMeasureService,
     IUnitOfMeasureGroupingService UnitOfMeasureGroupingService,
     IDirectSalesOrderService DirectSalesOrderService,
     IProductGroupingService ProductGroupingService,
     IProductTypeService ProductTypeService,
     IProductService ProductService,
     IRequestStateService RequestStateService,
     ISupplierService SupplierService,
     IStoreGroupingService StoreGroupingService,
     IStoreStatusService StoreStatusService,
     IStoreTypeService StoreTypeService,
     ITaxTypeService TaxTypeService,
     ICurrentContext CurrentContext
     , IHttpContextAccessor httpContextAccessor, DataContext _DataContext
     ) : base(httpContextAccessor, _DataContext)
 {
     this.OrganizationService          = OrganizationService;
     this.EditedPriceStatusService     = EditedPriceStatusService;
     this.StoreService                 = StoreService;
     this.AppUserService               = AppUserService;
     this.UnitOfMeasureService         = UnitOfMeasureService;
     this.UnitOfMeasureGroupingService = UnitOfMeasureGroupingService;
     this.DirectSalesOrderService      = DirectSalesOrderService;
     this.ProductGroupingService       = ProductGroupingService;
     this.ProductTypeService           = ProductTypeService;
     this.ProductService               = ProductService;
     this.RequestStateService          = RequestStateService;
     this.SupplierService              = SupplierService;
     this.StoreGroupingService         = StoreGroupingService;
     this.StoreStatusService           = StoreStatusService;
     this.StoreTypeService             = StoreTypeService;
     this.TaxTypeService               = TaxTypeService;
     this.CurrentContext               = CurrentContext;
 }
Ejemplo n.º 2
0
        protected async Task <List <long> > FilterProductGrouping(IProductGroupingService ProductGroupingService, ICurrentContext CurrentContext)
        {
            List <long> In    = null;
            List <long> NotIn = null;

            foreach (var currentFilter in CurrentContext.Filters)
            {
                List <FilterPermissionDefinition> FilterPermissionDefinitions = currentFilter.Value;
                foreach (FilterPermissionDefinition FilterPermissionDefinition in FilterPermissionDefinitions)
                {
                    if (FilterPermissionDefinition.Name == "ProductGroupingId")
                    {
                        if (FilterPermissionDefinition.IdFilter.Equal != null)
                        {
                            if (In == null)
                            {
                                In = new List <long>();
                            }
                            In.Add(FilterPermissionDefinition.IdFilter.Equal.Value);
                        }
                        if (FilterPermissionDefinition.IdFilter.In != null)
                        {
                            if (In == null)
                            {
                                In = new List <long>();
                            }
                            In.AddRange(FilterPermissionDefinition.IdFilter.In);
                        }

                        if (FilterPermissionDefinition.IdFilter.NotEqual != null)
                        {
                            if (NotIn == null)
                            {
                                NotIn = new List <long>();
                            }
                            NotIn.Add(FilterPermissionDefinition.IdFilter.NotEqual.Value);
                        }
                        if (FilterPermissionDefinition.IdFilter.NotIn != null)
                        {
                            if (NotIn == null)
                            {
                                NotIn = new List <long>();
                            }
                            NotIn.AddRange(FilterPermissionDefinition.IdFilter.NotIn);
                        }
                    }
                }
            }

            List <ProductGrouping> ProductGroupings = await ProductGroupingService.List(new ProductGroupingFilter
            {
                Id = new IdFilter {
                    In = In, NotIn = NotIn
                },
                Skip    = 0,
                Take    = int.MaxValue,
                Selects = ProductGroupingSelect.Id,
            });

            List <long> ProductGroupingIds = ProductGroupings.Select(a => a.Id).ToList();

            return(ProductGroupingIds);
        }