コード例 #1
0
        public IHttpActionResult Post([FromBody] CarInventoryModel newCarType)
        {
            BOLCarInventory RetrievedCarInventory = GetCarInventoryFilter.RetrieveCarInventory(newCarType);
            BOLCarInventory add = RentCarsInVehicleInventory.AddCarTo_db(RetrievedCarInventory);

            return(Ok(add));
        }
コード例 #2
0
        public IHttpActionResult Put([FromBody] List <CarInventoryModel> Car)
        {
            BOLCarInventory RetrievedCarInventory0 = GetCarInventoryFilter.RetrieveCarInventory(Car[0]);
            BOLCarInventory RetrievedCarInventory1 = GetCarInventoryFilter.RetrieveCarInventory(Car[1]);

            RentCarsInVehicleInventory.UpDataTo_db(RetrievedCarInventory0, RetrievedCarInventory1);
            return(Ok());
        }
コード例 #3
0
        public IHttpActionResult GetFilteredCars(string Company, string Gear, string Model, string openText, DateTime?Year)
        {
            var baseUrl = Request.RequestUri.GetLeftPart(UriPartial.Authority);

            List <BOLCarInventory> value = RentCarsInVehicleInventory.GetCarFrom_db();

            foreach (var item in value)
            {
                item.VehiclePic = baseUrl + @"/image/" + item.VehiclePic;
            }
            List <CarInventoryModel> carList = GetCarInventoryFilter.ListRetrieveFilteredCarInventory(value, Company, Gear, Model, openText, Year);

            return(Ok(carList));
        }
コード例 #4
0
        // GET: api/CarInventory
        public IHttpActionResult Get(int from, int to)
        {
            var baseUrl = Request.RequestUri.GetLeftPart(UriPartial.Authority);

            List <BOLCarInventory> value = RentCarsInVehicleInventory.GetCarFrom_db();

            foreach (var item in value)
            {
                item.VehiclePic = baseUrl + @"/image/" + item.VehiclePic;
            }
            List <CarInventoryModel> carList = GetCarInventoryFilter.ListRetrieveCarInventory(value, from, to);

            return(Ok(carList));
        }
コード例 #5
0
        public IHttpActionResult Get(int carNumber)
        {
            var baseUrl = Request.RequestUri.GetLeftPart(UriPartial.Authority);

            BOLCarInventory value = RentCarsInVehicleInventory.GetCarFrom_db(carNumber);

            if (value != null)
            {
                value.VehiclePic = baseUrl + @"/image/" + value.VehiclePic;

                CarInventoryModel carList = GetCarInventoryFilter.ReturnCarInventory(value);
                return(Ok(carList));
            }
            return(null);
        }
コード例 #6
0
        public IHttpActionResult Get(string orderlist)
        {
            var               baseUrl   = Request.RequestUri.GetLeftPart(UriPartial.Authority);
            JObject           json      = JObject.Parse(orderlist);
            List <OrderModel> orderList = new List <OrderModel>();

            foreach (var item in json)
            {
                orderList = new JavaScriptSerializer().Deserialize <List <OrderModel> >(item.Value.ToString());
            }
            List <BOLOrder> convertedOrderList = GetOrdersFilter.RetrievelistOrder(orderList);

            List <BOLCarInventory> value = RentCarsInVehicleInventory.GetCarFrom_db(convertedOrderList);

            foreach (var item in value)
            {
                item.VehiclePic = baseUrl + @"/image/" + item.VehiclePic;
            }


            List <CarInventoryModel> carList = GetCarInventoryFilter.ListRetrieveCarInventory1(value, convertedOrderList);

            return(Ok(carList));
        }