Пример #1
0
 public ActionResult AddParentContactLog(AddParentContactLogVM model)
 {
     if (!ModelState.IsValid)
     {
         return(PartialView("AddParentContactLog", model));
     }
     service.SaveParentContactLog(model);
     return(new HttpStatusCodeResult(HttpStatusCode.Created));
 }
Пример #2
0
        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);
        }
Пример #3
0
        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();
        }