public ActionResult Edit(HealthUnit healthUnit) { if (ModelState.IsValid) { _healthUnityRepository.Update(healthUnit); return(RedirectToAction("Index")); } SetViewBag(); return(View(healthUnit)); }
public JsonResult GetPins() { List <Pin> pins = new List <Pin>(); HttpResponseMessage response = client.GetAsync("/api/action/datastore_search?resource_id=ecf0e670-2968-4a01-b256-69f64e3e9ca2").Result; if (response.IsSuccessStatusCode) { HealthUnit unit = new HealthUnit(); unit = response.Content.ReadAsAsync <HealthUnit>().Result; foreach (var item in unit.Result.Records) { pins.Add(new Pin(item)); } } return(Json(pins, JsonRequestBehavior.AllowGet)); }