ArticleClass.cs
资源名称:moban.rar [点击查看]
上传用户:szraylite
上传日期:2018-06-06
资源大小:11546k
文件大小:4k
源码类别:
软件测试
开发平台:
Java
- /**********************************************************
- * 说明:文章类ArticleClass
- * 作者:
- * 创建日期:
- *********************************************************/
- using System;
- using System.Collections;
- using System.Data;
- using ENTERPRISE.DataAccessLayer;
- using ENTERPRISE.DataAccessHelper;
- namespace ENTERPRISE.BusinessLogicLayer
- {
- /// <summary>
- /// ArticleClass 的摘要说明
- /// </summary>
- ///
- public class ArticleClass
- {
- private int _id;
- private string _column_name;
- private string _column_memo;
- public int id
- {
- set
- {
- this._id = value;
- }
- get
- {
- return this._id;
- }
- }
- public string column_name
- {
- set
- {
- this._column_name = value;
- }
- get
- {
- return this._column_name;
- }
- }
- public string column_memo
- {
- set
- {
- this._column_memo = value;
- }
- get
- {
- return this._column_memo;
- }
- }
- public ArticleClass()
- {
- //
- // TODO: 在此处添加构造函数逻辑
- //
- }
- #region 方法
- /// <summary>
- /// 向数据库添加一个用户
- /// </summary>
- /// <param name="message">用户信息哈希表</param>
- public void Add(NoSortHashtable ArticleClass)
- {
- Database db = new Database(); //实例化一个Database类
- db.Insert("[column]", ArticleClass);
- }
- /// <summary>
- /// 修改留言内容
- /// </summary>
- /// <param name="newTopicInfo"></param>
- public void Update(Hashtable ArticleClass, int id)
- {
- Database db = new Database();
- string strCond = "Where id = " + id;
- db.Update("[column]", ArticleClass, strCond);
- }
- /// <summary>
- /// 删除留言
- /// </summary>
- public void Delete()
- {
- ArrayList sqls = new ArrayList();
- string sql = "";
- sql = "Delete from [column] where id = " + this._id;
- sqls.Add(sql);
- Database db = new Database();
- db.ExecuteSQL(sqls);
- }
- /// <summary>
- /// 按时间降序,读取所有留言
- /// </summary>
- /// <returns></returns>
- public static DataSet Queryclass()
- {
- string sql = "";
- sql = "Select * from [column]";
- Database db = new Database();
- return db.GetDataSet(sql);
- }
- /// <summary>
- /// 根据参数ID,获取帖子细信息
- /// </summary>
- /// <param name="topicID">帖子ID</param>
- public void LoadData(int id)
- {
- Database db = new Database(); //实例化一个Database类
- string sql = "";
- sql = "Select * from [column] where id = " + id;
- DataRow dr = db.GetDataRow(sql); //利用Database类的GetDataRow方法查询用户数据
- //根据查询得到的数据,对成员赋值
- if (dr != null)
- {
- this._id = GetSafeData.ValidateDataRow_N(dr, "id");
- this._column_name = GetSafeData.ValidateDataRow_S(dr, "column_name");
- this._column_memo = GetSafeData.ValidateDataRow_S(dr, "column_memo");
- }
- }
- #endregion 方法
- }
- }