public dynamic GetPendingCars(DateTime fromDate, DateTime ToDate)
        {
            VehicleStatusRepository repo = new VehicleStatusRepository();
            var vehicle = repo.GetPendingCars(fromDate, ToDate);

            return(vehicle);
        }
        public dynamic GetRemainingVehicles(DateTime fromDate, DateTime ToDate)
        {
            VehicleStatusRepository repo = new VehicleStatusRepository();
            var expenses = repo.GetRemainingVehicles(fromDate, ToDate);

            return(expenses);
        }
        public dynamic GetSoldVehiclesInYard(DateTime fromDate, DateTime ToDate)
        {
            VehicleStatusRepository repo = new VehicleStatusRepository();
            var expenses = repo.GetSoldVehiclesInYard(fromDate, ToDate);

            return(expenses);
        }
Beispiel #4
0
        public HttpResponseMessage VehiclStatus1()
        {
            var requestParams = Request.Content.ReadAsStringAsync().Result;



            bool inRide = false;

            requestParams = UnescapeCodes(requestParams);

            List <string> splitedParam = requestParams.Trim().Split(',').ToList();


            if (splitedParam.Count > 0)
            {
                using (VehicleStatusRepository vsRepo = new VehicleStatusRepository())
                {
                    inRide = vsRepo.UpdateCordinates(splitedParam[0], decimal.Parse(splitedParam[1]), splitedParam[4], splitedParam[3]);

                    if (inRide)
                    {
                        int?currentTripId = 0;
                        using (TripRepository tRepo = new TripRepository())
                        {
                            currentTripId = tRepo.GetLastVehicalOpenTrip(splitedParam[0]);
                        }
                        if (currentTripId != null)
                        {
                            using (TripCoordinatesRepository tripCorrRepo = new TripCoordinatesRepository())
                            {
                                tripCorrRepo.AddUpdate(new DomainModel.TripCoordinates()
                                {
                                    DateTime = DateTime.Now,
                                    TripId   = currentTripId.Value,
                                    LatV     = splitedParam[3],
                                    LongV    = splitedParam[4],
                                });
                            }
                        }
                    }
                }
            }

            //var vs = new TempRepository().AddUpdate(new DomainModel.TempStatus()
            //{
            //    CreatedDate = DateTime.Now,
            //    DataStr =" sss   >>> " + sss
            //});



            string result = inRide ? "onn" : "off";
            var    resp   = new HttpResponseMessage(HttpStatusCode.OK);

            resp.Content = new StringContent(result, System.Text.Encoding.UTF8, "text/plain");
            return(resp);

            //return "on";
        }
Beispiel #5
0
 public IHttpActionResult GetById(string vId)
 {
     using (VehicleStatusRepository vehiclesRepo = new VehicleStatusRepository())
     {
         RequestResponse returnData = vehiclesRepo.GetByIdService(int.Parse(vId));
         return(Ok(returnData));
     }
     // return Ok(new { IsDone = true, Messages = areaModel.farLeft.lat });
 }