public ActionResult Create(CreateLateEnrollementModel _CreateLateEnrollementModel) { if (ModelState.IsValid) { _CreateLateEnrollementModel._requestForLateEnrolment.enrolementid = Guid.NewGuid(); db.requestForLateEnrolments.AddObject(_CreateLateEnrollementModel._requestForLateEnrolment); db.SaveChanges(); return RedirectToAction("Details/" + _CreateLateEnrollementModel._requestForLateEnrolment.enrolementid); } return View(_CreateLateEnrollementModel); }
// // GET: /LateEnrollment/Create /// <summary> /// Gets all data required for Date View /// </summary> /// <param name="id">IssueID</param> /// <returns></returns> public ActionResult Create(Guid id) { try { if (id != null) { requestForLateEnrolment requestForLateEnrolment = new requestForLateEnrolment() { issueid = id, date = DateTime.Now }; issue issue = db.issues.Single(i => i.issueid == id); student student = db.students.Include("program").Single(s => s.studentid == issue.studentid); CreateLateEnrollementModel Model = new CreateLateEnrollementModel() { _requestForLateEnrolment = requestForLateEnrolment, _student = student }; return View(Model); } else { return RedirectToAction("Index", "Issue"); } } catch (Exception) { return RedirectToAction("Index", "Issue"); } }