Esempio n. 1
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
         db = null;
     }
 }
        public long GetLoggedInUserId(long userId)
        {
            long _userId = 0;

            using (var db = new BMSEntities())
            {
                var user = db.Users.FirstOrDefault(u => u.UserId == userId);
                if (user != null)
                {
                    _userId = user.UserId;
                }
            }

            return(_userId);
        }
        public static string GetLoggedInUserFirstName(string userId)
        {
            var firstName = string.Empty;

            using (var db = new BMSEntities())
            {
                var user = db.Users.FirstOrDefault(u => u.AspNetUserId == userId);
                if (user != null)
                {
                    firstName = user.FullName;
                }
            }

            return(firstName);
        }