public ActionResult Details(DetailsProbationaryContractModel _model) { if (ModelState.IsValid) { try { Guid? id = _model._NewNote.formid; _model._NewNote.noteid = Guid.NewGuid(); _model._NewNote.employeeid = User.Identity.Name; _model._NewNote.dates = DateTime.Now; _model._NewNote.controller = "ProbationaryContract"; db.notes.AddObject(_model._NewNote); db.SaveChanges(); return RedirectToAction("Details", new { id = id }); } catch (Exception) { return RedirectToAction("Index", "Issue"); } } return View(_model); }
// // GET: /ProbationaryContract/Details/5 /// <summary> /// Get's single Entry by ID P.S. All of the Forms do... /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Details(Guid id) { try { if (id != null) { probationaryContractPlan probationarycontractplan = db.probationaryContractPlans.Single(p => p.advisementid == id); issue issue = db.issues.Single(i => i.issueid == probationarycontractplan.issueid); student student = db.students.Include("program").Single(s => s.studentid == issue.studentid); DetailsProbationaryContractModel Model = new DetailsProbationaryContractModel() { _probationaryContractPlan = probationarycontractplan, _student = student, _note = db.notes.Include("employee").Where(note => note.formid == id).OrderByDescending(f => f.dates), _employee = db.employees.Single(e => e.employeeid == User.Identity.Name), _date = DateTime.Now }; return View(Model); } else { return RedirectToAction("Index", "Issue"); } } catch (Exception) { return RedirectToAction("Index", "Issue"); } }