Beispiel #1
0
        /// <summary>
        /// 判断用户名是否存在
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public userinfo isHaveThisUserName(string UserName)
        {
            MySqlParameter[] mySqlParameter = { new MySqlParameter("@username", UserName) };

            string sql = @"SELECT username,id,nicheng,zhuceshijian,xiugaishijian,touxiangurl FROM boke.userinfo where username=@username and isdel=0";

            DataTable dt = MySqlHelpers.ExecuteQuery(sql, mySqlParameter);

            if (dt.Rows.Count == 1)
            {
                return(DataToEnity <userinfo> .DataRowToEntity(dt.Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
 /// <summary>
 /// 查询数据
 /// </summary>
 /// <param name="sql"></param>
 /// <param name="mySqlParameters"></param>
 /// <returns></returns>
 public DataTable testlogin(string sql, MySqlParameter[] mySqlParameters)
 {
     return(MySqlHelpers.ExecuteQuery(sql, mySqlParameters));
 }