public ActionResult SelectDay(string SelectedDate, int AdminID) { try { var dateStr = DateTime.Now.Year + "/" + SelectedDate; DateTime selectedDay = DateTime.Parse(dateStr); //no need for entire repository so... SummonersQuizDBEntities db = new SummonersQuizDBEntities(); //{ var record = db.SprintSchedules.First(r => r.AdminId == AdminID); record.AdminId = AdminID; record.SelectedDay = selectedDay; db.SaveChanges(); //} ViewBag.SuccessMsg = "Day selected"; } catch (Exception exc) { ViewBag.ErrorMsg = "System was unable to change day. Look for exceptions for more information."; errorsRepository errorsRep = new errorsRepository(); errorsRep.LogError(exc, "SelectDay", "HomeController"); } return View("Index"); }
public Repository() { this.db = new SummonersQuizDBEntities(); }