Exemple #1
0
        public MySqlDataReader readinfo(Help help)
        {
            StringBuilder sql = new StringBuilder();
            sql.Append("select * from help where _id=@id");

            MySqlParameter[] pra = {
                                new  MySqlParameter("@id",MySqlDbType.Int32)

                                };

            pra[0].Value = help.ID;
            return DBHelperMySQL.ExecuteReader(sql.ToString(), pra);
        }
Exemple #2
0
        public SqlDataReader readinfo(Help help)
        {
            StringBuilder sql = new StringBuilder();
               sql.Append("select * from help where _id=@id");

               SqlParameter[] pra = {
                                new  SqlParameter("@id",SqlDbType.Int,4)

                                };

               pra[0].Value = help.ID;
               return Common.DbHelperSQL.ExecuteReader(sql.ToString(), pra);
        }
Exemple #3
0
        public int delete(Help help)
        {
            StringBuilder sql = new StringBuilder();
            sql.Append("delete from help where _id=@id");

            MySqlParameter[] pra = {
                                new MySqlParameter("@id",MySqlDbType.Int32)

                                };

            pra[0].Value = help.ID;

            return DBHelperMySQL.ExecuteSql(sql.ToString(), pra);
        }
Exemple #4
0
        public int inserthelp(Help help)
        {
            StringBuilder sql = new StringBuilder();
            sql.Append("insert into help values(@title,@content,@cateid)");

            MySqlParameter[] pra = {
                                new MySqlParameter("@title",MySqlDbType.VarChar,50),
                                new MySqlParameter("@content",MySqlDbType.VarChar,0),
                                new MySqlParameter("@cateid",MySqlDbType.Int32)
                               };
            pra[0].Value = help.Title;
            pra[1].Value = help.Content;
            pra[2].Value = help.Cateid;

            return DBHelperMySQL.ExecuteSql(sql.ToString(), pra);
        }
Exemple #5
0
        public int searchResult(Help help)
        {
            string sqlstr = "select count(*) from help where _cateid=" + help.Cateid + "";
            int result;
            if (DBHelperMySQL.ExecuteScalar(sqlstr) == null)
            {
                result = 0;

            }
            else
            {
                result = (int)DBHelperMySQL.ExecuteScalar(sqlstr);
            }
            return result;
        }
Exemple #6
0
        public int update(Help help)
        {
            StringBuilder sql = new StringBuilder();
            sql.Append("update help set _title=@title,_content=@content where _id=@id");

            MySqlParameter[] pra = {
                                new MySqlParameter("@title",MySqlDbType.VarChar,50),
                                new MySqlParameter("@content",MySqlDbType.VarChar,0),
                                new MySqlParameter("id",MySqlDbType.Int32)
                                };
            pra[0].Value = help.Title;
            pra[1].Value = help.Content;
            pra[2].Value = help.ID;

            return DBHelperMySQL.ExecuteSql(sql.ToString(), pra);
        }
Exemple #7
0
 public int update(Help help)
 {
     DALhelpDAL DALhelpDAL = new DALhelpDAL();
        return DALhelpDAL.update(help);
 }
Exemple #8
0
 public int searchResult(Help help)
 {
     DALhelpDAL DALhelpDAL = new DALhelpDAL();
        return DALhelpDAL.searchResult(help);
 }
Exemple #9
0
 public MySqlDataReader readinfo(Help help)
 {
     DALhelpDAL DALhelpDAL = new DALhelpDAL();
        return DALhelpDAL.readinfo(help);
 }
Exemple #10
0
 public int insert(Help help)
 {
     DALhelpDAL DALhelpDAL = new DALhelpDAL();
       return  DALhelpDAL.inserthelp(help);
 }
Exemple #11
0
 public int delete(Help help)
 {
     DALhelpDAL DALhelpDAL = new DALhelpDAL();
        return DALhelpDAL.delete(help);
 }