public async Task <string> AddBbTbReturn([FromBody] ReturnVehicle returnVehicle)
        {
            if (ModelState.IsValid)
            {
                var headers        = new Dictionary <string, string>();
                var tokenGenerated = HttpContext.Session.GetHmacToken();
                headers.Add("X-Hmac", tokenGenerated);
                headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
                string queryStr = _queryCreater.GetQueryStringFromObject(returnVehicle);
                var    response = await HttpClientRequestFactory.Get("http://proxy.mansis.co.za:18443/SlimProxyBoot.php?" + queryStr, headers);

                var data = response.Content.ReadAsStringAsync().Result;
                return(data.ToString());
            }
            else
            {
                throw new Exception("Model state is not valid");
            }
        }
Esempio n. 2
0
 public void AddNewOrderToHistory()
 {
     ReturnVehicle.AddOrderToHistory();
 }//add order to ordesr history
Esempio n. 3
0
 public List <RentCarRentedCar> GetRentedCarByLicNum([FromBody] CarParams paramsCar)
 {
     return(ReturnVehicle.GetRentedCarsByLisnumber(paramsCar.LicenceNumber));
 }//search rented car by license numiber from reted cars list
Esempio n. 4
0
 public void UpdateRentedStatus([FromBody] RentCarNewVehiclesDB updateCar)
 {
     ReturnVehicle.UpdateRentedCarStatus(updateCar);
 }//set car status to "not avaliable" when car is rented
Esempio n. 5
0
 public IEnumerable <RentCarRentedCar> GetRentedCars()
 {
     return(ReturnVehicle.GetRentedCarslist());
 }//Get rented cars list