Exemple #1
0
        //根据id获取数据库实体对象
        public Hashtable GetEntity(string Id)
        {
            string    sql = selectSql + " where bookguid=@bookguid";
            Hashtable hs  = DapperHelper.QuerySingle(sql, new { bookguid = Id });

            return(hs);
        }
Exemple #2
0
        /// <summary>
        /// 登录数据访问层方法
        /// </summary>
        /// <param name="phone"></param>
        /// <param name="pass"></param>
        /// <returns></returns>
        public UserInfo UserInfoLgoin(string phone, string pass)
        {
            string   sql  = $@"select u.UserId,u.UserName,u.UserPhone from UserInfo u where u.UserPhone=@Phone and u.UserPass=@Pass and Status=1;";
            UserInfo user = new UserInfo();

            user = DapperHelper <UserInfo> .QuerySingle(sql, new { Phone = phone, Pass = pass });

            return(user);
        }
Exemple #3
0
        /// <summary>
        /// 获取盐
        /// </summary>
        /// <param name="UserPhone"></param>
        /// <returns></returns>
        public string GetUserInfoSalt(string UserPhone)
        {
            string sql = $" select UserSalt from UserInfo where UserPhone=@UserPhone and Status=1 ";

            return(DapperHelper <string> .QuerySingle(sql, new { UserPhone = UserPhone }));
        }