コード例 #1
0
        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"));
        }
コード例 #2
0
        public ActionResult Create(enContest enContest)
        {
            var objBLContest = new blContest(enContest);

            try
            {
                objBLContest.Create();
            }
            catch (Exception ex)
            {
                return(RedirectToAction("error", "misc"));
            }
            return(RedirectToAction("list"));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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"));
        }
コード例 #5
0
        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));
        }
コード例 #6
0
        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());
        }