Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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;
        }
Esempio n. 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);
        }
Esempio n. 7
0
 public int update(Help help)
 {
     DALhelpDAL DALhelpDAL = new DALhelpDAL();
        return DALhelpDAL.update(help);
 }
Esempio n. 8
0
 public int searchResult(Help help)
 {
     DALhelpDAL DALhelpDAL = new DALhelpDAL();
        return DALhelpDAL.searchResult(help);
 }
Esempio n. 9
0
 public MySqlDataReader readinfo(Help help)
 {
     DALhelpDAL DALhelpDAL = new DALhelpDAL();
        return DALhelpDAL.readinfo(help);
 }
Esempio n. 10
0
 public int insert(Help help)
 {
     DALhelpDAL DALhelpDAL = new DALhelpDAL();
       return  DALhelpDAL.inserthelp(help);
 }
Esempio n. 11
0
 public int delete(Help help)
 {
     DALhelpDAL DALhelpDAL = new DALhelpDAL();
        return DALhelpDAL.delete(help);
 }