Пример #1
0
        public VehicleModel GetVehicleDetail(IList <FilterModel> filters, FilterJoin filterJoin)
        {
            var request = new RestRequest("/api/Vehicle/VehicleDetail", Method.POST);

            request.AddQueryParameter("filterJoin", filterJoin.ToString());
            request.AddJsonBody(filters);

            var response = RestClient.Execute(request);

            if (response.StatusCode != HttpStatusCode.OK)
            {
                throw CreateException(response);
            }

            return(JsonConvert.DeserializeObject <VehicleModel>(response.Content));
        }
Пример #2
0
        public PaginationListModel <VehicleTestBookingModel> GetBookingsPaginatedList(IList <FilterModel> filters, FilterJoin filterJoin, bool asc, string orderPropertyName, int pageIndex, int pageSize)
        {
            var request = new RestRequest("/api/Vehicle/BookingsPaginationList", Method.POST);

            request.AddQueryParameter("filterJoin", filterJoin.ToString());
            request.AddQueryParameter("asc", asc.ToString());
            request.AddQueryParameter("orderPropertyName", orderPropertyName);
            request.AddQueryParameter("pageIndex", pageIndex.ToString());
            request.AddQueryParameter("pageSize", pageSize.ToString());
            request.AddJsonBody(filters);

            var response = RestClient.Execute(request);

            if (response.StatusCode != HttpStatusCode.OK)
            {
                throw CreateException(response);
            }

            return(JsonConvert.DeserializeObject <PaginationListModel <VehicleTestBookingModel> >(response.Content));
        }
Пример #3
0
        public PaginationListModel <PaymentTerminalModel> GetPaginatedList(IList <FilterModel> filters, FilterJoin filterJoin, bool asc, string orderPropertyName, int pageIndex, int pageSize)
        {
            var request = new RestRequest("/api/Payment/Terminal/PaginatedList", Method.POST);

            request.AddQueryParameter("filterJoin", filterJoin.ToString());
            request.AddQueryParameter("asc", asc.ToString());
            request.AddQueryParameter("orderPropertyName", orderPropertyName);
            request.AddQueryParameter("pageIndex", pageIndex.ToString());
            request.AddQueryParameter("pageSize", pageSize.ToString());
            request.RequestFormat  = DataFormat.Json;
            request.JsonSerializer = new RestSharpJsonNetSerializer();
            request.AddBody(filters);

            var response = RestClient.Execute(request);

            if (response.StatusCode != HttpStatusCode.OK)
            {
                throw CreateException(response);
            }

            return(JsonConvert.DeserializeObject <PaginationListModel <PaymentTerminalModel> >(response.Content));
        }