public JsonResult Add(string date, string description) { EventViewModel model = new EventViewModel(); model.Add(new Models.Event() { Date = DateTime.Parse(date), Description = description }); return(new JsonResult(new { })); }
public IActionResult Added(string description, string time) { EventViewModel model = new EventViewModel(); if (time != null) { time = HomeController.CurrentDate.ToString("yyyy-MM-dd") + 'T' + time; model.Add(new Models.Event() { Date = DateTime.Parse(time), Description = description }); } else { model.Add(new Models.Event() { Date = HomeController.CurrentDate, Description = description }); } return(Redirect("/Home/Day/?date=" + HomeController.CurrentDate.ToString("yyyy-MM-dd"))); }