public JsonResult Event() { string id = (string)this.RouteData.Values["id"]; EventViewModel model = new EventViewModel(); Event ev = model.Get(id); String data = JsonSerializer.Serialize(ev); return(new JsonResult(new { status = "success", data = data })); }
public IActionResult Delete(string Id) { EventViewModel model = new EventViewModel(); string date = model.Get(Id).Date.ToString("yyyy'-'MM'-'dd"); if (model.Remove(Id)) { return(Redirect("/Home/Day/?date=" + date)); } else { return(Redirect("/Shared/Error")); } }