examineDAL.cs
上传用户:lishan0805
上传日期:2019-12-08
资源大小:12048k
文件大小:24k
源码类别:

OA系统

开发平台:

C#

  1. // =================================================================== 
  2. // 产品(COM.OA.SqlServerDAL)项目
  3. //====================================================================
  4. // wangyp @Copy Right 2006-2008
  5. // 文件:examineDAL.cs
  6. // 项目名称:工程项目管理
  7. // 创建时间:2008-9-23
  8. // 负责人:wangyp
  9. // 先创建SqlHelper.cs文件,引用System.Configuration程序集和实体(COM.OA.Entity)、产品规则(COM.OA.IDAL)项目、引用业务逻辑(COM.OA.BLL)项目
  10. // ===================================================================
  11. using System;
  12. using System.Collections;
  13. using System.Collections.Generic;
  14. using System.Data;
  15. using System.Data.SqlClient;
  16. using System.Text;
  17. using COM.OA.Entity;
  18. using COM.OA.IDAL;
  19. using COM.OA.BLL;
  20. namespace COM.OA.SqlServerDAL
  21. {
  22.     /// <summary>
  23.     /// 数据访问层dbo.examine
  24.     /// </summary>
  25.     public partial class examineDAL : IexamineDAL
  26.     {
  27.         #region 构造函数
  28.         /// <summary>
  29.         /// 数据层实例化
  30.         /// </summary>
  31.         public examineDAL()
  32.         {
  33.         }
  34.         #endregion
  35.         #region -----------实例化接口函数-----------
  36.         #region 添加
  37.         /// <summary>
  38.         /// 向数据库中插入一条新记录
  39.         /// </summary>
  40.         /// <param name="examine">examine实体对象</param>
  41.         /// <returns></returns>
  42.         public int Insert(examine examine)
  43.         {
  44.             string sqlCommand = "examineInsert";
  45.             int res;
  46.             SqlParameter[] param ={
  47. new SqlParameter("@ex_id",SqlDbType.Int),
  48. new SqlParameter("@ex_applycontent",SqlDbType.VarChar),
  49. new SqlParameter("@ex_define",SqlDbType.VarChar),
  50. new SqlParameter("@ex_remark",SqlDbType.VarChar),
  51. new SqlParameter("@ex_u_id",SqlDbType.Int),
  52. new SqlParameter("@ex_applytime",SqlDbType.DateTime),
  53. new SqlParameter("@ex_state",SqlDbType.Int),
  54. new SqlParameter("@ex_inceptid",SqlDbType.Int),
  55. new SqlParameter("@ex_examineidea",SqlDbType.VarChar),
  56. new SqlParameter("@ex_examinetiem",SqlDbType.DateTime),
  57. new SqlParameter("@ex_dept_id",SqlDbType.Int)
  58. };
  59.             param[0].Direction = ParameterDirection.Output;
  60.             param[1].Value = examine.ex_applycontent;
  61.             param[2].Value = examine.ex_define;
  62.             param[3].Value = examine.ex_remark;
  63.             param[4].Value = examine.ex_u_id;
  64.             param[5].Value = examine.ex_applytime;
  65.             param[6].Value = examine.ex_state;
  66.             param[7].Value = examine.ex_inceptid;
  67.             param[8].Value = examine.ex_examineidea;
  68.             param[9].Value = examine.ex_examinetiem;
  69.             param[10].Value = examine.ex_dept_id;
  70.             res = SqlHelper.ExecuteNonQuery(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param);
  71.             examine.ex_id = ((param[0].Value) == DBNull.Value) ? 0 : Convert.ToInt32(param[0].Value);
  72.             return res;
  73.         }
  74.         /// <summary>
  75.         /// 向数据库中插入一条新记录。带事务
  76.         /// </summary>
  77.         /// <param name="sp">事务对象</param>
  78.         /// <param name="examine">examine实体对象</param>
  79.         /// <returns></returns>
  80.         public int Insert(SqlTransaction sp, examine examine)
  81.         {
  82.             string sqlCommand = "examineInsert";
  83.             int res;
  84.             SqlParameter[] param ={
  85. new SqlParameter("@ex_id",SqlDbType.Int),
  86. new SqlParameter("@ex_applycontent",SqlDbType.VarChar),
  87. new SqlParameter("@ex_define",SqlDbType.VarChar),
  88. new SqlParameter("@ex_remark",SqlDbType.VarChar),
  89. new SqlParameter("@ex_u_id",SqlDbType.Int),
  90. new SqlParameter("@ex_applytime",SqlDbType.DateTime),
  91. new SqlParameter("@ex_state",SqlDbType.Int),
  92. new SqlParameter("@ex_inceptid",SqlDbType.Int),
  93. new SqlParameter("@ex_examineidea",SqlDbType.VarChar),
  94. new SqlParameter("@ex_examinetiem",SqlDbType.DateTime),
  95. new SqlParameter("@ex_dept_id",SqlDbType.Int)
  96. };
  97.             param[0].Direction = ParameterDirection.Output;
  98.             param[1].Value = examine.ex_applycontent;
  99.             param[2].Value = examine.ex_define;
  100.             param[3].Value = examine.ex_remark;
  101.             param[4].Value = examine.ex_u_id;
  102.             param[5].Value = examine.ex_applytime;
  103.             param[6].Value = examine.ex_state;
  104.             param[7].Value = examine.ex_inceptid;
  105.             param[8].Value = examine.ex_examineidea;
  106.             param[9].Value = examine.ex_examinetiem;
  107.             param[10].Value = examine.ex_dept_id;
  108.             res = SqlHelper.ExecuteNonQuery(sp, CommandType.StoredProcedure, sqlCommand, param);
  109.             examine.ex_id = ((param[0].Value) == DBNull.Value) ? 0 : Convert.ToInt32(param[0].Value);
  110.             return res;
  111.         }
  112.         #endregion
  113.         #region 更新
  114.         /// <summary>
  115.         /// 向数据表examine更新一条记录
  116.         /// </summary>
  117.         /// <param name="examine">examine实体对象</param>
  118.         /// <returns></returns>
  119.         public int Update(examine examine)
  120.         {
  121.             string sqlCommand = "examineUpdate";
  122.             SqlParameter[] param ={
  123. new SqlParameter("@ex_id",SqlDbType.Int),
  124. new SqlParameter("@ex_applycontent",SqlDbType.VarChar),
  125. new SqlParameter("@ex_define",SqlDbType.VarChar),
  126. new SqlParameter("@ex_remark",SqlDbType.VarChar),
  127. new SqlParameter("@ex_u_id",SqlDbType.Int),
  128. new SqlParameter("@ex_applytime",SqlDbType.DateTime),
  129. new SqlParameter("@ex_state",SqlDbType.Int),
  130. new SqlParameter("@ex_inceptid",SqlDbType.Int),
  131. new SqlParameter("@ex_examineidea",SqlDbType.VarChar),
  132. new SqlParameter("@ex_examinetiem",SqlDbType.DateTime),
  133. new SqlParameter("@ex_dept_id",SqlDbType.Int)
  134. };
  135.             param[0].Value = examine.ex_id;
  136.             param[1].Value = examine.ex_applycontent;
  137.             param[2].Value = examine.ex_define;
  138.             param[3].Value = examine.ex_remark;
  139.             param[4].Value = examine.ex_u_id;
  140.             param[5].Value = examine.ex_applytime;
  141.             param[6].Value = examine.ex_state;
  142.             param[7].Value = examine.ex_inceptid;
  143.             param[8].Value = examine.ex_examineidea;
  144.             param[9].Value = examine.ex_examinetiem;
  145.             param[10].Value = examine.ex_dept_id;
  146.             return SqlHelper.ExecuteNonQuery(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param);
  147.         }
  148.         /// <summary>
  149.         /// 向数据表examine更新一条记录。带事务
  150.         /// </summary>
  151.         /// <param name="sp">事务对象</param>
  152.         /// <param name="examine">examine实体对象</param>
  153.         /// <returns></returns>
  154.         public int Update(SqlTransaction sp, examine examine)
  155.         {
  156.             string sqlCommand = "examineUpdate";
  157.             SqlParameter[] param ={
  158. new SqlParameter("@ex_id",SqlDbType.Int),
  159. new SqlParameter("@ex_applycontent",SqlDbType.VarChar),
  160. new SqlParameter("@ex_define",SqlDbType.VarChar),
  161. new SqlParameter("@ex_remark",SqlDbType.VarChar),
  162. new SqlParameter("@ex_u_id",SqlDbType.Int),
  163. new SqlParameter("@ex_applytime",SqlDbType.DateTime),
  164. new SqlParameter("@ex_state",SqlDbType.Int),
  165. new SqlParameter("@ex_inceptid",SqlDbType.Int),
  166. new SqlParameter("@ex_examineidea",SqlDbType.VarChar),
  167. new SqlParameter("@ex_examinetiem",SqlDbType.DateTime),
  168. new SqlParameter("@ex_dept_id",SqlDbType.Int)
  169. };
  170.             param[0].Value = examine.ex_id;
  171.             param[1].Value = examine.ex_applycontent;
  172.             param[2].Value = examine.ex_define;
  173.             param[3].Value = examine.ex_remark;
  174.             param[4].Value = examine.ex_u_id;
  175.             param[5].Value = examine.ex_applytime;
  176.             param[6].Value = examine.ex_state;
  177.             param[7].Value = examine.ex_inceptid;
  178.             param[8].Value = examine.ex_examineidea;
  179.             param[9].Value = examine.ex_examinetiem;
  180.             param[10].Value = examine.ex_dept_id;
  181.             return SqlHelper.ExecuteNonQuery(sp, CommandType.StoredProcedure, sqlCommand, param);
  182.         }
  183.         #endregion
  184.         #region 删除
  185.         /// <summary>
  186.         /// 删除数据表examine中的一条记录
  187.         /// </summary>
  188.         /// <param name="ex_id">ex_id</param>
  189.         /// <returns></returns>
  190.         public int Delete(int ex_id)
  191.         {
  192.             string sqlCommand = "examineDelete";
  193.             SqlParameter[] param ={
  194. new SqlParameter("@ex_id",SqlDbType.Int)
  195. };
  196.             param[0].Value = ex_id;
  197.             return SqlHelper.ExecuteNonQuery(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param);
  198.         }
  199.         /// <summary>
  200.         /// 删除数据表examine中的一条记录
  201.         /// </summary>
  202.         /// <param name="examine">examine实体对象</param>
  203.         /// <returns></returns>
  204.         public int Delete(examine examine)
  205.         {
  206.             string sqlCommand = "examineDelete";
  207.             SqlParameter[] param ={
  208. new SqlParameter("@ex_id",SqlDbType.Int)
  209. };
  210.             param[0].Value = examine.ex_id;
  211.             return SqlHelper.ExecuteNonQuery(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param);
  212.         }
  213.         /// <summary>
  214.         /// 删除数据表examine中的一条记录,带事务
  215.         /// </summary>
  216.         /// <param name="sp">事务对象</param>
  217.         /// <param name="ex_id">ex_id</param>
  218.         /// <returns></returns>
  219.         public int Delete(SqlTransaction sp, int ex_id)
  220.         {
  221.             string sqlCommand = "examineDelete";
  222.             SqlParameter[] param ={
  223. new SqlParameter("@ex_id",SqlDbType.Int)
  224. };
  225.             param[0].Value = ex_id;
  226.             return SqlHelper.ExecuteNonQuery(sp, CommandType.StoredProcedure, sqlCommand, param);
  227.         }
  228.         /// <summary>
  229.         /// 删除数据表examine中的一条记录,带事务
  230.         /// </summary>
  231.         /// <param name="sp">事务对象</param>
  232.         /// <param name="examine">examine实体对象</param>
  233.         /// <returns></returns>
  234.         public int Delete(SqlTransaction sp, examine examine)
  235.         {
  236.             string sqlCommand = "examineDelete";
  237.             SqlParameter[] param ={
  238. new SqlParameter("@ex_id",SqlDbType.Int)
  239. };
  240.             param[0].Value = examine.ex_id;
  241.             return SqlHelper.ExecuteNonQuery(sp, CommandType.StoredProcedure, sqlCommand, param);
  242.         }
  243.         #endregion
  244.         #region 实体对象
  245.         /// <summary>
  246.         /// 得到examine实体对象
  247.         /// </summary>
  248.         /// <param name="row">row</param>
  249.         /// <returns>examine实体对象</returns>
  250.         public examine Select(DataRow row)
  251.         {
  252.             examine obj = new examine();
  253.             if (row != null)
  254.             {
  255.                 obj.ex_id = ((row["ex_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(row["ex_id"]);
  256.                 obj.ex_applycontent = row["ex_applycontent"].ToString();
  257.                 obj.ex_define = row["ex_define"].ToString();
  258.                 obj.ex_remark = row["ex_remark"].ToString();
  259.                 obj.ex_u_id = ((row["ex_u_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(row["ex_u_id"]);
  260.                 obj.ex_applytime = ((row["ex_applytime"]) == DBNull.Value) ? DateTime.MinValue : Convert.ToDateTime(row["ex_applytime"]);
  261.                 obj.ex_state = ((row["ex_state"]) == DBNull.Value) ? 0 : Convert.ToInt32(row["ex_state"]);
  262.                 obj.ex_inceptid = ((row["ex_inceptid"]) == DBNull.Value) ? 0 : Convert.ToInt32(row["ex_inceptid"]);
  263.                 obj.ex_examineidea = row["ex_examineidea"].ToString();
  264.                 obj.ex_examinetiem = ((row["ex_examinetiem"]) == DBNull.Value) ? DateTime.MinValue : Convert.ToDateTime(row["ex_examinetiem"]);
  265.                 obj.ex_dept_id = ((row["ex_dept_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(row["ex_dept_id"]);
  266.             }
  267.             else
  268.             {
  269.                 return null;
  270.             }
  271.             return obj;
  272.         }
  273.         /// <summary>
  274.         /// 得到examine实体对象
  275.         /// </summary>
  276.         /// <param name="dr">dr</param>
  277.         /// <returns>examine实体对象</returns>
  278.         public examine Select(IDataReader dr)
  279.         {
  280.             examine obj = new examine();
  281.             obj.ex_id = ((dr["ex_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(dr["ex_id"]);
  282.             obj.ex_applycontent = dr["ex_applycontent"].ToString();
  283.             obj.ex_define = dr["ex_define"].ToString();
  284.             obj.ex_remark = dr["ex_remark"].ToString();
  285.             obj.ex_u_id = ((dr["ex_u_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(dr["ex_u_id"]);
  286.             obj.ex_applytime = ((dr["ex_applytime"]) == DBNull.Value) ? DateTime.MinValue : Convert.ToDateTime(dr["ex_applytime"]);
  287.             obj.ex_state = ((dr["ex_state"]) == DBNull.Value) ? 0 : Convert.ToInt32(dr["ex_state"]);
  288.             obj.ex_inceptid = ((dr["ex_inceptid"]) == DBNull.Value) ? 0 : Convert.ToInt32(dr["ex_inceptid"]);
  289.             obj.ex_examineidea = dr["ex_examineidea"].ToString();
  290.             obj.ex_examinetiem = ((dr["ex_examinetiem"]) == DBNull.Value) ? DateTime.MinValue : Convert.ToDateTime(dr["ex_examinetiem"]);
  291.             obj.ex_dept_id = ((dr["ex_dept_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(dr["ex_dept_id"]);
  292.             return obj;
  293.         }
  294.         /// <summary>
  295.         /// 根据ID,返回一个examine实体对象
  296.         /// </summary>
  297.         /// <param name="ex_id">ex_id</param>
  298.         /// <returns>examine实体对象</returns>
  299.         public examine Select(int ex_id)
  300.         {
  301.             return this.Select(ex_id, false, false);
  302.         }
  303.         /// <summary>
  304.         /// 根据ID,返回一个examine实体对象
  305.         /// </summary>
  306.         /// <param name="ex_id">ex_id</param>
  307.         /// <param name="bParentTable">将examine对象设置与父表关联</param>
  308.         /// <param name="bChildrenTable">将examine对象设置与子表关联</param>
  309.         /// <returns>examine实体对象</returns>
  310.         public examine Select(int ex_id, bool bParentTable, bool bChildrenTable)
  311.         {
  312.             examine obj = null;
  313.             SqlParameter[] param ={
  314. new SqlParameter("@ex_id",SqlDbType.Int)
  315. };
  316.             param[0].Value = ex_id;
  317.             string sqlCommand = "examineSelect";
  318.             using (SqlDataReader dr = SqlHelper.ExecuteReader(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param))
  319.             {
  320.                 while (dr.Read())
  321.                 {
  322.                     obj = this.Select(dr);
  323.                 }
  324.             }
  325.             this.Select(obj, bParentTable, bChildrenTable);
  326.             return obj;
  327.         }
  328.         /// <summary>
  329.         /// 将examine实体对象设置与父表和子表关联
  330.         /// </summary>
  331.         /// <param name="obj">examine实体对象</param>
  332.         /// <param name="bParentTable">是/否设置与父表对象关联</param>
  333.         /// <param name="bChildrenTable">是/否设置与子表对象关联</param>
  334.         public void Select(examine obj, bool bParentTable, bool bChildrenTable)
  335.         {
  336.             //关联的主表
  337.             if (bParentTable)
  338.             {
  339.                 obj.users = usersBLL.Select(obj.ex_u_id);
  340.                 obj.department = departmentBLL.Select(obj.ex_dept_id);
  341.             }
  342.             //关联的子表集合
  343.             if (bChildrenTable)
  344.             {
  345.             }
  346.         }
  347.         #endregion
  348.         #region 父表
  349.         /// <summary>
  350.         /// 设置实体对象(examine)的父表对象
  351.         /// </summary>
  352.         /// <param name="examine">实体对象</param>
  353.         public void users(examine examine)
  354.         {
  355.             examine.users = usersBLL.Select(examine.ex_u_id);
  356.         }
  357.         /// <summary>
  358.         /// 设置实体对象(examine)的父表对象
  359.         /// </summary>
  360.         /// <param name="examine">实体对象</param>
  361.         public void department(examine examine)
  362.         {
  363.             examine.department = departmentBLL.Select(examine.ex_dept_id);
  364.         }
  365.         #endregion
  366.         #region 子表
  367.         #endregion
  368.         #region 查询
  369.         /// <summary>
  370.         /// 得到数据表examine所有记录
  371.         /// </summary>
  372.         /// <returns>结果集</returns>
  373.         public IList<examine> Select()
  374.         {
  375.             return this.Select(false, false);
  376.         }
  377.         /// <summary>
  378.         /// 得到数据表examine所有记录
  379.         /// </summary>
  380.         /// <param name="bParentTable">是/否设置与父表对象关联</param>
  381.         /// <param name="bChildrenTable">是/否设置与子表对象关联</param>
  382.         /// <returns>结果集</returns>
  383.         public IList<examine> Select(bool bParentTable, bool bChildrenTable)
  384.         {
  385.             IList<examine> list = new List<examine>();
  386.             string sqlCommand = "examineSelectAll";
  387.             using (SqlDataReader dr = SqlHelper.ExecuteReader(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand))
  388.             {
  389.                 while (dr.Read())
  390.                 {
  391.                     list.Add(this.Select(dr));
  392.                 }
  393.             }
  394.             foreach (examine obj in list)
  395.             {
  396.                 this.Select(obj, bParentTable, bChildrenTable);
  397.             }
  398.             return list;
  399.         }
  400.         /// <summary>
  401.         /// 得到数据表examine满足查询条件的记录
  402.         /// </summary>
  403.         /// <param name="where">查询条件</param>
  404.         /// <returns>结果集</returns>
  405.         public IList<examine> Select(string where)
  406.         {
  407.             return this.Select(where, false, false);
  408.         }
  409.         /// <summary>
  410.         /// 得到数据表examine满足查询条件的记录
  411.         /// </summary>
  412.         /// <param name="where">查询条件</param>
  413.         /// <param name="bParentTable">是/否设置与父表对象关联</param>
  414.         /// <param name="bChildrenTable">是/否设置与子表对象关联</param>
  415.         /// <returns>结果集</returns>
  416.         public IList<examine> Select(string where, bool bParentTable, bool bChildrenTable)
  417.         {
  418.             IList<examine> list = new List<examine>();
  419.             SqlParameter[] param ={
  420. new SqlParameter("@where",SqlDbType.VarChar,8000)
  421. };
  422.             param[0].Value = where;
  423.             string sqlCommand = "examineSelectByParams";
  424.             using (SqlDataReader dr = SqlHelper.ExecuteReader(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param))
  425.             {
  426.                 while (dr.Read())
  427.                 {
  428.                     list.Add(this.Select(dr));
  429.                 }
  430.             }
  431.             foreach (examine obj in list)
  432.             {
  433.                 this.Select(obj, bParentTable, bChildrenTable);
  434.             }
  435.             return list;
  436.         }
  437.         /// <summary>
  438.         /// 得到数据表ArticalInfo满足外键字段查询条件的记录
  439.         /// </summary>
  440.         /// <param name="foreignFieldName">外键字段名称</param>
  441.         /// <param name="foreignFieldValue">外键字段值</param>
  442.         /// <returns>结果集</returns>
  443.         public IList<examine> Select(string foreignFieldName, int foreignFieldValue)
  444.         {
  445.             return this.Select(foreignFieldName, foreignFieldValue, false, false);
  446.         }
  447.         /// <summary>
  448.         /// 得到数据表ArticalInfo满足外键字段查询条件的记录
  449.         /// </summary>
  450.         /// <param name="foreignFieldName">外键字段名称</param>
  451.         /// <param name="foreignFieldValue">外键字段值</param>
  452.         /// <param name="bParentTable">是/否设置与父表对象关联</param>
  453.         /// <param name="bChildrenTable">是/否设置与子表对象关联</param>
  454.         /// <returns>结果集</returns>
  455.         public IList<examine> Select(string foreignFieldName, int foreignFieldValue, bool bParentTable, bool bChildrenTable)
  456.         {
  457.             return this.Select(string.Format("{0}='{1}'", foreignFieldName, foreignFieldValue), bParentTable, bChildrenTable);
  458.         }
  459.         /// <summary>
  460.         /// 得到数据表examine满足查询条件的记录数
  461.         /// </summary>
  462.         /// <param name="where">查询条件</param>
  463.         /// <param name="recordCount">记录数</param>
  464.         public void Select(string where, out int recordCount)
  465.         {
  466.             string sqlCommand = "examineCountByWhere";
  467.             SqlParameter[] param ={
  468. new SqlParameter("@where",SqlDbType.VarChar,8000),
  469. new SqlParameter("@recordCount",SqlDbType.Int)
  470. };
  471.             param[0].Value = where;
  472.             param[1].Direction = ParameterDirection.Output;
  473.             SqlHelper.ExecuteNonQuery(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param);
  474.             recordCount = Convert.ToInt32(param[1].Value);
  475.         }
  476.         /// <summary>
  477.         /// 得到数据表examine满足查询条件的分页记录
  478.         /// </summary>
  479.         /// <param name="pageSize">每页显示记录数</param>
  480.         /// <param name="pageIndex">当前显示第几页</param>
  481.         /// <param name="where">查询条件</param>
  482.         /// <returns>结果集</returns>
  483.         public IList<examine> Select(int pageSize, int pageIndex, string where)
  484.         {
  485.             return this.Select(pageSize, pageIndex, where, false, false);
  486.         }
  487.         /// <summary>
  488.         /// 得到数据表examine满足查询条件的分页记录
  489.         /// </summary>
  490.         /// <param name="pageSize">每页显示记录数</param>
  491.         /// <param name="pageIndex">当前显示第几页</param>
  492.         /// <param name="where">查询条件</param>
  493.         /// <param name="bParentTable">是/否设置与父表对象关联</param>
  494.         /// <param name="bChildrenTable">是/否设置与子表对象关联</param>
  495.         /// <returns>结果集</returns>
  496.         public IList<examine> Select(int pageSize, int pageIndex, string where, bool bParentTable, bool bChildrenTable)
  497.         {
  498.             IList<examine> list = new List<examine>();
  499.             string sqlCommand = "examineSelectByPagerParams";
  500.             SqlParameter[] param ={
  501. new SqlParameter("@pageSize",SqlDbType.Int),
  502. new SqlParameter("@pageIndex",SqlDbType.Int),
  503. new SqlParameter("@where",SqlDbType.VarChar,8000)
  504. };
  505.             param[0].Value = pageSize;
  506.             param[1].Value = pageIndex;
  507.             param[2].Value = where;
  508.             using (SqlDataReader dr = SqlHelper.ExecuteReader(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param))
  509.             {
  510.                 while (dr.Read())
  511.                 {
  512.                     list.Add(this.Select(dr));
  513.                 }
  514.             }
  515.             foreach (examine obj in list)
  516.             {
  517.                 this.Select(obj, bParentTable, bChildrenTable);
  518.             }
  519.             return list;
  520.         }
  521.         /// <summary>
  522.         /// 得到数据表examine满足查询条件记录
  523.         /// </summary>
  524.         /// <param name="commandType">命令类型</param>
  525.         /// <param name="sqlCommand">SQL命令</param>
  526.         /// <param name="SqlParameter[]">命令参数数组</param>
  527.         /// <returns>结果集</returns>
  528.         public IList<examine> Select(CommandType commandType, string sqlCommand, params SqlParameter[] param)
  529.         {
  530.             return this.Select(false, false, commandType, sqlCommand, param);
  531.         }
  532.         /// <summary>
  533.         /// 得到数据表examine满足查询条件记录
  534.         /// </summary>
  535.         /// <param name="bParentTable">是/否设置与父表对象关联</param>
  536.         /// <param name="bChildrenTable">是/否设置与子表对象关联</param>
  537.         /// <param name="commandType">命令类型</param>
  538.         /// <param name="sqlCommand">SQL命令</param>
  539.         /// <param name="SqlParameter[]">命令参数数组</param>
  540.         /// <returns>结果集</returns>
  541.         public IList<examine> Select(bool bParentTable, bool bChildrenTable, CommandType commandType, string sqlCommand, params SqlParameter[] param)
  542.         {
  543.             IList<examine> list = new List<examine>();
  544.             using (SqlDataReader dr = SqlHelper.ExecuteReader(Conn.SqlConn, commandType, sqlCommand, param))
  545.             {
  546.                 while (dr.Read())
  547.                 {
  548.                     list.Add(this.Select(dr));
  549.                 }
  550.             }
  551.             foreach (examine obj in list)
  552.             {
  553.                 this.Select(obj, bParentTable, bChildrenTable);
  554.             }
  555.             return list;
  556.         }
  557.         /// <summary>
  558.         /// 根据主键检测是否存在该条记录
  559.         /// </summary>
  560.         /// <param name="ex_id">ex_id</param>
  561.         /// <returns>存在/不存在</returns>
  562.         public bool Exists(int ex_id)
  563.         {
  564.             SqlParameter[] param ={
  565.                                  new SqlParameter("@ex_id",SqlDbType.Int)
  566.                                  };
  567.             param[0].Value = ex_id;
  568.             string sqlCommand = "examineIsExist";
  569.             int a = Convert.ToInt32(SqlHelper.ExecuteScalar(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param));
  570.             if (a > 0)
  571.             {
  572.                 return true;
  573.             }
  574.             else
  575.             {
  576.                 return false;
  577.             }
  578.         }
  579.         #endregion
  580.         #endregion
  581.     }
  582. }