示例#1
0
        internal Models.Stud_BusModel.GetBusStudResp GetBus2stud(Models.Stud_BusModel.GetBusStudReq req)
        {
            Models.Stud_BusModel.GetBusStudResp rsp = new Models.Stud_BusModel.GetBusStudResp();
            ITStud_Bus studBus = _storage.GetBus2stud(req.nEntityId);

            rsp.apiError = new APIErrors();
            rsp.apiError = ApiError_defs.err_Invalid_Request;
            ITStops stop;

            //Added Entity
            if (studBus != null && studBus.n > 0)
            {
                rsp.apiError    = ApiError_defs.ok;
                rsp.nBusFKdown  = studBus.nBusFKdown;
                rsp.nBusFKup    = studBus.nBusFKup;
                rsp.nRecordId   = studBus.n;
                rsp.nStopUp     = studBus.nStopUp;
                stop            = _storage.getStopById(studBus.nStopUp);
                rsp.upLatLong   = stop.rStopLat + "|" + stop.rStopLong;
                stop            = _storage.getStopById(studBus.nStopDown);
                rsp.downLatLong = stop.rStopLat + "|" + stop.rStopLong;
                rsp.nStopDown   = studBus.nStopDown;
            }
            else
            {
                rsp.apiError.sErrorMessage = "Unable to map bus to student";
            }
            return(rsp);
        }
示例#2
0
 public object GetBusStud([FromBody] Models.Stud_BusModel.GetBusStudReq req)
 {
     Bllfiles.BLL_Mapping bllentity           = new Bllfiles.BLL_Mapping();
     Models.Stud_BusModel.GetBusStudResp resp = bllentity.GetBus2stud(req);
     return(resp);
 }