Esempio n. 1
0
        /// <summary>
        /// 获取信息
        /// </summary>
        /// <returns></returns>
        public UserLogin GetInfo()
        {
            var re     = new UserLogin();
            var result = TxtOperate.TxtRead();

            if (result != null && result.Count > 0)
            {
                re.userName = result[0];
                re.userPwd  = result[1];
                if (result[2] != null)
                {
                    re.isRemPwd = int.Parse(result[2]) == 1 ? true:false;
                }
            }
            return(re);
        }
Esempio n. 2
0
        /// <summary>
        /// 登录保存信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool userLogin(UserLogin model)
        {
            bool isSuccess = false;
            var  strList   = new List <string>();

            strList.Add(model.userName);
            strList.Add(model.userPwd);
            strList.Add(model.isRemPwd == true?"1":"0");
            string whereStr = string.Format("uAccount={0}", model.userName);
            var    dt       = DbHelper.GetTableByTbNameAndWhereStr("userinfo", whereStr);

            if (dt != null && dt.Rows.Count > 0)
            {
                var user = dt.Rows[0];
                if (user["uPwd"].ToString() == model.userPwd)
                {
                    TxtOperate.TxtWrite(strList);
                    isSuccess = true;
                }
            }
            return(isSuccess);
        }