Пример #1
0
        /// <summary>
        /// 用户登陆
        /// </summary>
        /// <param name="loginAccount"></param>
        /// <param name="loginPassword"></param>
        /// <returns></returns>
        public DataModel Login(string loginAccount, string loginPassword)
        {
            string password = Util.EncodePassword(loginPassword);
            Login  account  = LoginDAL.Get(u => u.LoginAccount == loginAccount && u.LoginPassword == password);

            if (account == null)
            {
                return(DataModel(false, "帐号或密码错误"));
            }
            else
            {
                //保存Session
                SaveLoginSession(account);
                return(DataModel(true));
            }
        }
Пример #2
0
        public void DeleteById(int entityID)
        {
            var entity = _loginDAL.Get(a => a.ID == entityID);

            Delete(entity);
        }