//DriverBus models internal Models.DriverBus.MapBustoDriverResp MapDriver(Models.DriverBus.MapBustoDriverReq req) { Models.DriverBus.MapBustoDriverResp rsp = new Models.DriverBus.MapBustoDriverResp(); ITDriver_Bus driverBus = _storage.MapDriver(req.nEntityId, req.nBusFK); rsp.apiError = new APIErrors(); //Added Entity if (driverBus != null && driverBus.n > 0) { rsp.apiError = ApiError_defs.ok; rsp.n = driverBus.n; } else { //rsp.apiError = ApiError_defs.err_Invalid_Request; driverBus = _storage.editBusDriver(_storage.getBusOfDriver(req.nEntityId), req.nEntityId, req.nBusFK, true); if (driverBus != null && driverBus.n > 0) { rsp.apiError = ApiError_defs.ok; rsp.apiError.sErrorMessage = "Another driver to Bus allocation needed to manipulate. Mapping Successful"; rsp.n = driverBus.n; } rsp.apiError.sErrorMessage = "Unable to map driver. Bus may be already assigned"; } return(rsp); }
public object MapDriver([FromBody] Models.DriverBus.MapBustoDriverReq req) { Bllfiles.BLL_Mapping bllentity = new Bllfiles.BLL_Mapping(); Models.DriverBus.MapBustoDriverResp resp = bllentity.MapDriver(req); return(resp); }