public void Update(mp_family_history family_History) { var old = _context.mp_family_history.FirstOrDefault(e => e.id == family_History.id); family_History.created_at = old.created_at; _context.Entry(old).CurrentValues.SetValues(family_History); _context.SaveChanges(); }
public string FamilyHistory(mp_family_history history, IFormCollection collections) { if (ModelState.IsValid) { var profile = _profileService.GetByUserId(Guid.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier))); history.created_at = DateTime.Now; history.created_by = User.FindFirstValue(ClaimTypes.NameIdentifier); history.profile_id = Guid.Parse(collections["profile_id"]); history.appointment_id = Guid.Parse(collections["appointment_id"]); _pschosocialService.AddFamilyHistory(history); return("success"); } return("failure"); }
public int AddFamilyHistory(mp_family_history history) { _context.Add(history); return(_context.SaveChanges()); }
public void Add(mp_family_history family_History) { family_History.created_at = DateTime.Now; _context.mp_family_history.Add(family_History); _context.SaveChanges(); }