public bool IsUserLocked(string username) { using (var context = new APIMSEntities()) { var user = (from u in context.User where u.ULoginName == username select u).FirstOrDefault(); if (user != null && user.UIsLock == 1) { return(true); } } return(false); }
public bool IsUserExisted(string username) { using (var context = new APIMSEntities()) { var userCount = (from u in context.User where u.ULoginName == username select u).Count(); //用户存在 if (userCount > 0) { return(true); } } return(false); }
public bool Authenticate(string username, string password) { using (var context = new APIMSEntities()) { var user = (from u in context.User where u.ULoginName == username && u.UPassword == password select u).FirstOrDefault(); //用户存在 if (user != null) { return(true); } } return(false); }