Пример #1
0
        //***********************SEARCH*************************************
        public virtual ResponseModel <TVm> GeneralSearch(PagingDataType status, BaseRequestModel <TEntity> requestModel)
        {
            int count;
            ResponseModel <TVm> response;

            switch (status)
            {
            case PagingDataType.All:
                count          = Repository.GetAll().Where(requestModel.GetExpression()).Count();
                response       = GetAll(requestModel);
                response.Count = count;
                return(response);

            case PagingDataType.Active:
                count          = Repository.GetAllActive().Where(requestModel.GetExpression()).Count();
                response       = GetAllActive(requestModel);
                response.Count = count;
                return(response);

            case PagingDataType.Inactive:
                count          = Repository.GetAllInactive().Where(requestModel.GetExpression()).Count();
                response       = GetAllInactive(requestModel);
                response.Count = count;
                return(response);

            default:
                throw new ArgumentOutOfRangeException(nameof(status), status, null);
            }
        }
Пример #2
0
        //==================
        //Paging Block Start
        //==================
        public virtual IHttpActionResult Get(PagingDataType status, string request)
        {
            var requestModel = JsonConvert.DeserializeObject <TRm>(request);

            var responseModel = Service.GetAllAsTenant(requestModel);

            return(Ok(responseModel));
        }
Пример #3
0
        public IHttpActionResult GetTenantPayment(PagingDataType status, string request)
        {
            var requestModel = JsonConvert.DeserializeObject <SubscriptionPaymentRequestModel>(request);

            var responseModel = _service.GetAllAsTenant(requestModel);

            return(Ok(responseModel));
        }
Пример #4
0
        public virtual ResponseModel <TVm> SearchAsTenant(PagingDataType status, HaveTenantIdRequestModelBase <TEntity> requestModel)
        {
            var count    = Repository.GetAllAsTenant().Where(requestModel.GetExpression()).Count();
            var response = GetAllAsTenant(requestModel);

            response.Count = count;

            return(response);
        }
Пример #5
0
        public override IHttpActionResult Get(SearchType type, PagingDataType status, string request)
        {
            var isSystemAdminUser = User.IsInRole(StaticRoles.SystemAdmin.Name);
            var entities          = isSystemAdminUser
                ? Service.Search(status, JsonConvert.DeserializeObject <SubscriptionPaymentRequestModel>(request))
                : Service.SearchAsTenant(status, JsonConvert.DeserializeObject <SubscriptionPaymentRequestModel>(request));

            return(Ok(entities));
        }
        public override IHttpActionResult Get(PagingDataType status, string request)
        {
            var requestModel = JsonConvert.DeserializeObject <CompanyRequestModel>(request);

            var isSystemAdminUser = User.IsInRole(StaticRoles.SystemAdmin.Name);

            var responseModel = isSystemAdminUser
                ? _service.GetAll(requestModel)
                : _service.GetAllAsTenant(requestModel);

            return(Ok(responseModel));
        }
Пример #7
0
        //**************PAGING START**********************************************
        public virtual IHttpActionResult Get(PagingDataType status, string request)
        {
            var requestModel = JsonConvert.DeserializeObject <TRm>(request);

            switch (status)
            {
            case PagingDataType.All:
                return(Ok(Service.GetAll(requestModel)));

            case PagingDataType.Active:
                return(Ok(Service.GetAllActive(requestModel)));

            case PagingDataType.Inactive:
                return(Ok(Service.GetAllInactive(requestModel)));

            default:
                throw new ArgumentOutOfRangeException(nameof(status), status, null);
            }
        }
Пример #8
0
        public virtual IHttpActionResult Get(SearchType type, PagingDataType status, string request)
        {
            switch (type)
            {
            case SearchType.General:
                var entities = Service.GeneralSearch(status, JsonConvert.DeserializeObject <TRm>(request));
                return(Ok(entities));

            case SearchType.Precise:
                return(Ok());

            case SearchType.Filter:
                return(Ok());

            case SearchType.Complex:
                return(Ok());

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
Пример #9
0
        public virtual IHttpActionResult Get(SearchType type, PagingDataType status, string request)
        {
            var entities = Service.SearchAsTenant(status, JsonConvert.DeserializeObject <TRm>(request));

            return(Ok(entities));
        }