internal Models.busLocationModel.UpdateBusLocationResp UpdateBusLocation(Models.busLocationModel.UpdateBusLocationReq req)
        {
            Models.busLocationModel.UpdateBusLocationResp rsp = new Models.busLocationModel.UpdateBusLocationResp();
            rsp.apiError = new APIErrors();
            rsp.apiError = ApiError_defs.err_Invalid_Request;
            ITBusLocation prevLocn = _storage.getLocationByBus(req.nBusFK);

            if (prevLocn != null && prevLocn.n > 0)
            {
                ITBusLocation busL = _storage.UpdateBusLocation(prevLocn, req.rLat, req.rLong, req.bStatus);
                if (busL != null && busL.n > 0)
                {
                    // rsp.n = iUser.n;   //Use if needed
                    rsp.n        = busL.n;
                    rsp.apiError = ApiError_defs.ok;
                }
                else
                {
                    rsp.apiError.sErrorMessage = "Couldent update the current location of the bus";
                }
            }
            else
            {
                rsp.apiError.sErrorMessage = "Couldent found the previous location of the bus";
            }
            return(rsp);
        }
Ejemplo n.º 2
0
 public object UpdateBusLocation([FromBody] Models.busLocationModel.UpdateBusLocationReq req)
 {
     Bllfiles.BLL_BusLocation bgrv = new Bllfiles.BLL_BusLocation();
     Models.busLocationModel.UpdateBusLocationResp resp = bgrv.UpdateBusLocation(req);
     return(resp);
 }