public ActionResult Update(int id, enContest enContest_) { var objENContest = new enContest() { ID = id }; var objBLContest = new blContest(objENContest); try { objBLContest.Read(); } catch { RedirectToAction("error", "misc"); } enContest_.InsertedOn = objENContest.InsertedOn; objBLContest = new blContest(enContest_); try { objBLContest.Update(); } catch { RedirectToAction("error", "misc"); } return(RedirectToAction("List")); }
public ActionResult Create(enContest enContest) { var objBLContest = new blContest(enContest); try { objBLContest.Create(); } catch (Exception ex) { return(RedirectToAction("error", "misc")); } return(RedirectToAction("list")); }
public ActionResult List() { var objENContest = new enContest(); var objBLContest = new blContest(objENContest); List <enContest> listOfContests = new List <enContest>(); try { listOfContests = objBLContest.ReadAll(); } catch (Exception ex) { return(View("error", "misc")); } return(View(listOfContests)); }
public ActionResult Delete(int id) { var objENContest = new enContest() { ID = id }; var objBLContest = new blContest(objENContest); try { objBLContest.Delete(); } catch { return(RedirectToAction("error", "misc")); } return(RedirectToAction("list")); }
public ActionResult Update(int id) { var objENContest = new enContest() { ID = id }; var objBLContest = new blContest(objENContest); List <enContest> listOfContests = new List <enContest>(); try { objBLContest.Read(); } catch { RedirectToAction("error", "misc"); } return(View("create", objENContest)); }
public ActionResult Login() { if (TempData["forgetPassword"] != null) { ViewBag.VerificationMessage = TempData["forgetPassword"].ToString(); } var objENContest = new enContest() { GetByDate = true }; var objBLContest = new blContest(objENContest); try { objENContest = objBLContest.ReadAll().FirstOrDefault(); } catch (Exception ex) { } ViewBag.Contest = objENContest; return(View()); }