public ActionResult GetSites(int TypeId = 0) { Hydro.HydroService theHydro = new Hydro.HydroService(); Hydro.Site[] theSites; if (TypeId > 0) { theSites = theHydro.GetSiteList(TypeId, true); } else { theSites = theHydro.GetSiteList(null, true); } ViewBag.Sites = theSites; return(View()); }
public JsonResult GetSites() { List <amurportal.Models.Site> theSites = new List <amurportal.Models.Site>(); Hydro.HydroService theHydro = new Hydro.HydroService(); Hydro.Site[] _sites = theHydro.GetSiteList(null, true); if (_sites != null) { foreach (var site in _sites) { amurportal.Models.Site _site = new amurportal.Models.Site(site); theSites.Add(_site); } } return(Json(theSites, JsonRequestBehavior.AllowGet)); }
public ActionResult GetSiteParams(int SiteId) { Hydro.HydroService theHydro = new Hydro.HydroService(); Hydro.Site[] _sites = theHydro.GetSiteList(null, true); if (_sites != null) { foreach (var site in _sites) { if (site.SiteId == SiteId) { Models.Site theSite = new Models.Site(site); return(View(theSite)); } } } return(View()); }