示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="loginName"></param>
        /// <param name="loginPWD"></param>
        /// <returns></returns>
        public async Task <sysUserInfo> SaveUserInfo(string loginName, string loginPWD)
        {
            sysUserInfo sysUserInfo = new sysUserInfo(loginName, loginPWD);
            sysUserInfo model       = new sysUserInfo();
            var         userList    = await dal.Query(a => a.uLoginName == sysUserInfo.uLoginName && a.uLoginPWD == sysUserInfo.uLoginPWD);

            if (userList.Count > 0)
            {
                model = userList.FirstOrDefault();
            }
            else
            {
                var id = await dal.Add(sysUserInfo);

                model = await dal.QueryByID(id);
            }

            return(model);
        }
示例#2
0
        public async Task <sysUserInfo> LoginAsync(sysUserInfo sysUserInfo)
        {
            var user = await _dal.Query(d => d.LoginName == sysUserInfo.LoginName && d.LoginPWD == sysUserInfo.LoginPWD);

            return(user.FirstOrDefault());
        }