Example #1
0
        /// <summary>
        /// 取得 系統管理員 資訊
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public tblAdmin CheckUser(string Account, string Password)
        {
            LoginData data = new LoginData();

            Password = PasswordUtility.SHA512Encryptor(Password);
            tblAdmin admin = this.Get(x => x.PersonalID.Equals(Account) && x.Password.Equals(Password) && x.UseStatus == true);

            return(admin);
        }
Example #2
0
        /// <summary>
        /// 更新密碼
        /// </summary>
        /// <returns></returns>
        public bool UptPassword(string Account, string password)
        {
            List <tblAdmin> users = this.GetSome(x => x.PersonalID.Equals(Account) && x.UseStatus == true).ToList();

            foreach (var user in users)
            {
                try
                {
                    user.Password = PasswordUtility.SHA512Encryptor(password);
                    this.Update(user);
                }
                catch (Exception ex)
                {
                    return(false);
                }
            }
            return(true);
        }