Пример #1
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
         db = null;
     }
 }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }