Example #1
0
        public IActionResult GetDistributors()
        {
            var distributorFromRepo = _distributor.GetDistributors();
            var distributor         = Mapper.Map <IEnumerable <DistributorDto> >(distributorFromRepo);

            return(Ok(distributor));
        }
        public IList <Distributor> GetDistributors()
        {
            ExecutePermissionValidator epv = new ExecutePermissionValidator();

            epv.ClassType     = typeof(PriceList);
            epv.KeyIdentifier = Config.SeePriceLists;

            bool  CanSeeAll    = PermissionManager.Check(epv);
            IList priceListIds = null;

            if (!CanSeeAll)
            {
                priceListIds = PermissionManager.GetPermissionIdentifiers(typeof(PriceList), PermissionAction.Create);
            }

            epv               = new ExecutePermissionValidator();
            epv.ClassType     = typeof(Distributor);
            epv.KeyIdentifier = Config.DistributorInactiveStatus;
            bool isActive = PermissionManager.Check(epv);
            int  totalRecords;

            return(repository.GetDistributors(string.Empty, null, null, null, DistributorStatus.Active, new GridState(new List <int>(), 0, 0, "Name", true, false, DateTime.Now, null), out totalRecords, null, null, null, priceListIds, isActive));
        }