public ActionResult Create(AttendanceNote AttendanceNote) { AttendanceNote.callEnded = DateTime.Now; if (ModelState.IsValid) { db.AttendanceNotes.Add(AttendanceNote); db.SaveChanges(); return(RedirectToAction("Details", genericFunctions.TypeOfTipstaffRecord(AttendanceNote.tipstaffRecordID), new { id = AttendanceNote.tipstaffRecordID })); } ViewBag.AttendanceNoteCodes = db.AttendanceNoteCodes.Where(x => x.active == true).ToList(); return(View(AttendanceNote)); }
public ActionResult Create(int id) { AttendanceNote AttendanceNote = new AttendanceNote(DateTime.Now); ViewBag.AttendanceNoteCodes = db.AttendanceNoteCodes.Where(x => x.active == true).ToList(); AttendanceNote.tipstaffRecord = db.TipstaffRecord.Find(id); AttendanceNote.tipstaffRecordID = id; if (AttendanceNote.tipstaffRecord.caseStatus.sequence > 3) { TempData["UID"] = AttendanceNote.tipstaffRecord.UniqueRecordID; return(RedirectToAction("ClosedFile", "Error")); } return(View(AttendanceNote)); }