Пример #1
0
        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;
        }
Пример #2
0
        public bool AddUserCounselor(UsersCounselor model)
        {
            try
            {
                _context.UsersCounselor.Add(model);
                _context.SaveChanges();

                return true;
            }
            catch
            {
                return false;
            }
        }
Пример #3
0
        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;
            }
        }
Пример #4
0
        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;
        }