Пример #1
0
 /// <summary>
 /// Retrieve user by login and password
 /// </summary>
 /// <param name="login">Login</param>
 /// <param name="pwd">Password</param>
 public User GetUserByLoginAndPassword(string login,string pwd)
 {
     var _user = _context.Users.Where(u => u.Login == login && u.Password == pwd).FirstOrDefault();
     if (_user == null) return null;
     var user = new User { UserId = _user.UserId, FirstName = _user.FirstName, LastName = _user.LastName };
     return (user);
 }
Пример #2
0
        private void FixupUser(User previousValue)
        {
            if (previousValue != null && previousValue.Stats.Contains(this))
            {
                previousValue.Stats.Remove(this);
            }

            if (User != null)
            {
                if (!User.Stats.Contains(this))
                {
                    User.Stats.Add(this);
                }
                if (Users_UserId != User.UserId)
                {
                    Users_UserId = User.UserId;
                }
            }
        }