public ActionResult AddParentContactLog(AddParentContactLogVM model) { if (!ModelState.IsValid) { return(PartialView("AddParentContactLog", model)); } service.SaveParentContactLog(model); return(new HttpStatusCodeResult(HttpStatusCode.Created)); }
public AddParentContactLogVM CreateParentContactLogVM(int caseId) { var caseService = new Data.Services.CaseService(); var relationships = caseService.GetGuardianRelationships(); var model = new AddParentContactLogVM { CaseId = caseId, Relationships = relationships }; return(model); }
public void SaveParentContactLog(AddParentContactLogVM model) { var log = new StaffingLogParentContactLog { ContactDate = model.ContactDate, StaffingLogID = model.CaseId, Notes = model.Notes, DateCreated = DateTime.UtcNow, CreatedByUserID = AppService.Current.UserID, ContactMethodType = model.ContactMethodType, ContactMethodValue = model.ContactMethodValue, GuardianRelationshipID = model.GuardianRelationshipId, ContactedPersonName = model.ContactedPersonName }; Context.StaffingLogParentContactLog.Add(log); Context.SaveChanges(); }