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