public ActionResult SectionUpdate(int id) { SectionRequirementItem item = SectionRequirementDao.FindById(id); ViewBag.Item = item; return View(); }
public ActionResult SectionRequirementDelete(int id) { try { SectionRequirementDao.Delete(id); return Json(new { result = "success" }, JsonRequestBehavior.AllowGet); } catch (Exception ex) { return Json(new { result = "fail", message = ex.Message }, JsonRequestBehavior.AllowGet); } }
// // GET: /Result/ public ActionResult Index() { ResultService service = new ResultService(); service.CategoryRequirements = LectureCategoryRequirementDao.FindByAccountId(accountItem.Id); service.LectureDetails = LectureDetailDao.FindByAccountId(accountItem.Id); service.ScoreRequirement = ScoreRequirementDao.FindByAccountIdForCheck(accountItem.Id); service.SectionRequirement = SectionRequirementDao.FindByAccountIdForCheck(accountItem.Id); service.Sections = SectionDao.FindAll(); service.TypeRequirements = LectureTypeRequirementDao.FindByAccountId(accountItem.Id); ViewBag.Results = service.GetResults(); ViewBag.IsAllPassed = IsAllPassed(ViewBag.Results); return(View()); }
public ActionResult SectionUpdate(int id, int cutline) { SectionRequirementItem item = new SectionRequirementItem(); item.LectureTypeId = 2; item.Cutline = cutline; item.AccountId = accountItem.Id; item.Id = id; try { SectionRequirementDao.Update(item); return Json(new { result = "success" }, JsonRequestBehavior.AllowGet); } catch (Exception ex) { return Json(new { result = "fail", message = ex.Message }, JsonRequestBehavior.AllowGet); } }
public ActionResult SectionRegister(int cutline) { if (ExistSectionRequirement(accountItem.Id)) return Json(new { result = "fail", message = "이미 존재합니다." }, JsonRequestBehavior.AllowGet); SectionRequirementItem item = new SectionRequirementItem(); item.Cutline = cutline; item.AccountId = accountItem.Id; item.LectureTypeId = 2; try { SectionRequirementDao.Insert(item); return Json(new { result = "success" }, JsonRequestBehavior.AllowGet); } catch (Exception ex) { return Json(new { result = "fail", message = ex.Message }, JsonRequestBehavior.AllowGet); } }
private bool ExistSectionRequirement(int id) { SectionRequirementItem item = SectionRequirementDao.FindByAccountIdForCheck(id); return item != null; }
public ActionResult Section() { IList<SectionRequirementItem> list = SectionRequirementDao.FindByAccountId(accountItem.Id); ViewBag.list = list; return View(); }