// GET: Station public IActionResult Index() { log.Info(nameof(StationController.Index)); try { ViewData["AreaId"] = new SelectList(areaService.GetAreas(), "Id", "Name"); return(View(stationService.GetAll())); } catch (Exception e) { log.Error(e); return(BadRequest()); } }
public IActionResult Create() { log.Info(nameof(RoutesController.Create)); try { var stationNames = stationService.GetAll(); ViewData["StationId"] = new SelectList(stationNames, "Id", "Name"); return(View()); } catch (Exception e) { log.Error(e); throw; } }
public void LoadStations() { ObservableCollection <StationDTO> stations = new ObservableCollection <StationDTO>(); foreach (StationDTO station in stationService.GetAll().Data.ToList <StationDTO>()) { stations.Add(station); } Stations = stations; }
public IActionResult Get() { try { return(Ok(_stationService.GetAll().ToApiModels())); } catch (Exception ex) { ModelState.AddModelError("GetStation", ex.Message); return(BadRequest(ModelState)); } }
public IActionResult GetStations([FromQuery] int pageNumber = 1, [FromQuery] int pageSize = 10) { log.Info(nameof(StationsController.GetStations)); try { var stationPage = stationService .GetAll() .ToPage(pageNumber, pageSize); return(Ok(stationPage)); } catch (Exception e) { log.Error(e); return(BadRequest()); } }
public async Task <IActionResult> Get() { var models = _stationService.GetAll(); return(Ok(models)); }
public IHttpActionResult Station(HttpRequestMessage requestMessage) { return(Ok(_stationService.GetAll().FirstOrDefault())); }
public async Task <IEnumerable <Station> > GetAll([FromQuery] StationParameters stationParameters) { return(await _service.GetAll(stationParameters)); }
public ActionResult Index() { var d = _stationService.GetAll().FirstOrDefault().With(s => s.Name); return(View()); }