public bool UpdateFamilyMembers(MemberFamilyMetaData family) { _entities.MemberFamilyMetaDatas.Add(family); var inserted = _entities.SaveChanges(); return(inserted > 0); }
public ActionResult UpdateFamily(FamilyMembers members) { try { var family = new MemberFamilyMetaData { Name = members.Name, Sex = int.Parse(members.Gender), DateOfBirth = members.DateOfBirth, Relationship = members.Relationship, MemberId = members.MemberId }; var updated = _memberRepository.UpdateFamilyMembers(family); if (updated) { return(Redirect("View/" + members.MemberId)); } return(Redirect("Error")); } catch (Exception e) { return(Redirect("Error")); } }