Beispiel #1
0
        public HttpResponseMessage GetDropdownValues(int accountId)
        {
            GetDropdownListResponse response = dropdownValuesService.GetAll(new GetDropdownListRequest()
            {
                AccountID = accountId, Limit = 10
            });

            return(Request.BuildResponse(response));
        }
Beispiel #2
0
        public ActionResult DropdownValuesViewRead([DataSourceRequest] DataSourceRequest request, string name)
        {
            GetDropdownListResponse response = dropdownValuesService.GetAll(new GetDropdownListRequest()
            {
                Query = name, Limit = request.PageSize, PageNumber = request.Page, AccountID = UserExtensions.ToAccountID(this.Identity)
            });

            return(Json(new DataSourceResult
            {
                Data = response.DropdownValuesViewModel,
                Total = response.TotalHits
            }, JsonRequestBehavior.AllowGet));
        }
        public GetDropdownListResponse GetAllByAccountID(string name, int?accountID)
        {
            GetDropdownListResponse response       = new GetDropdownListResponse();
            IEnumerable <Dropdown>  dropdownValues = dropdownRepository.FindAll(name, accountID);

            if (dropdownValues == null)
            {
                response.Exception = GetDropdownvaluesNotFoundException();
            }
            else
            {
                IEnumerable <DropdownViewModel> list = Mapper.Map <IEnumerable <Dropdown>, IEnumerable <DropdownViewModel> >(dropdownValues);
                response.DropdownValuesViewModel = list;
                response.TotalHits = dropdownValues.IsAny() ? dropdownValues.Select(s => s.TotalDropdownCount).FirstOrDefault() : 0;
            }
            return(response);
        }
        public GetDropdownListResponse GetAll(GetDropdownListRequest request)
        {
            GetDropdownListResponse response       = new GetDropdownListResponse();
            IEnumerable <Dropdown>  dropdownValues = dropdownRepository.FindAll(request.Query, request.Limit, request.PageNumber, request.AccountID);

            if (dropdownValues == null)
            {
                response.Exception = GetDropdownvaluesNotFoundException();
            }
            else
            {
                IEnumerable <DropdownViewModel> list = Mapper.Map <IEnumerable <Dropdown>, IEnumerable <DropdownViewModel> >(dropdownValues);
                response.DropdownValuesViewModel = list;
                response.TotalHits = dropdownRepository.FindAll(request.Query, request.AccountID).Count();
            }

            return(response);
        }