public static bool Login(string userId, string password) { //clear current principal Thread.CurrentPrincipal = null; AppPrincipal prin = new AppPrincipal(); AppIdentity appIdentity = prin.AppIdentity; UserLoginDAL userLoginDal = new UserLoginDAL(); userLoginDal.FillUserLoginByUserId(userId, appIdentity); if (appIdentity.IsNew) { return(false); } if (appIdentity.Disabled != 0) { return(false); } if (appIdentity.Password == password) { Thread.CurrentPrincipal = prin; return(true); } return(false); }
public BL() { loginDAL = new LoginDAL(); orderDAL = new OrderDAL(); productDAL = new ProductDAL(); historyDAL = new SaleHistoryDAL(); userDAL = new UserDAL(); userLoginDAL = new UserLoginDAL(); }
public bool ChangePassword(User user) { if (string.IsNullOrWhiteSpace(user.UserName) || string.IsNullOrWhiteSpace(user.Password)) { return(false); } var login = new UserLoginDAL(); return(login.ChangePassword(user)); }
public bool VerifyLoginCredentials(User user) { if (string.IsNullOrWhiteSpace(user.UserName) || string.IsNullOrWhiteSpace(user.Password)) { return(false); } var login = new UserLoginDAL(); return(login.VerifyCredentials(user.UserName, user.Password, user.UserType)); }
public static bool LoginForService(string userId) { Thread.CurrentPrincipal = null; AppPrincipal appPrincipal = new AppPrincipal(); AppIdentity appIdentity = appPrincipal.AppIdentity; UserLoginDAL userLoginDal = new UserLoginDAL(); userLoginDal.FillUserLoginByUserId(userId, appIdentity); if (appIdentity.IsNew) { return(false); } Thread.CurrentPrincipal = appPrincipal; return(true); }
public bool LoginUser(Property objProp) { try { UserLoginDAL userLog = new UserLoginDAL(); if (userLog.getUser(objProp) == 1) { flag = true; } else { flag = false; } } catch (Exception ex) { objNLog.Error("Exception : " + ex.Message); } return flag; }