public bool AddUserCounselot(string userId, string firstName, string lastName) { UsersCounselor userCounselorModel = new UsersCounselor { UserId = userId, FirstName = firstName, LastName = lastName }; bool result = _userRepository.AddUserCounselor(userCounselorModel); return result; }
public bool AddUserCounselor(UsersCounselor model) { try { _context.UsersCounselor.Add(model); _context.SaveChanges(); return true; } catch { return false; } }
public bool EditUserCounselor(UsersCounselor model) { try { var dbModel = _context.UsersCounselor .Select(x => x) .Where(x => x.UserId == model.UserId) .FirstOrDefault(); dbModel.FirstName = model.FirstName; dbModel.LastName = model.LastName; _context.SaveChanges(); return true; } catch { return false; } }
public bool ChangeUserCounselor(string userId, string firstName, string lastName) { UsersCounselor model = new UsersCounselor { UserId = userId, FirstName = firstName, LastName = lastName }; bool result = _userRepository.EditUserCounselor(model); return result; }