addresslistDAL.cs
资源名称:OASystem.rar [点击查看]
上传用户:lishan0805
上传日期:2019-12-08
资源大小:12048k
文件大小:26k
源码类别:
OA系统
开发平台:
C#
- // ===================================================================
- // 产品(COM.OA.SqlServerDAL)项目
- //====================================================================
- // wangyp @Copy Right 2006-2008
- // 文件:addresslistDAL.cs
- // 项目名称:工程项目管理
- // 创建时间:2008-9-23
- // 负责人:wangyp
- // 先创建SqlHelper.cs文件,引用System.Configuration程序集和实体(COM.OA.Entity)、产品规则(COM.OA.IDAL)项目、引用业务逻辑(COM.OA.BLL)项目
- // ===================================================================
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Data;
- using System.Data.SqlClient;
- using System.Text;
- using COM.OA.Entity;
- using COM.OA.IDAL;
- using COM.OA.BLL;
- namespace COM.OA.SqlServerDAL
- {
- /// <summary>
- /// 数据访问层dbo.addresslist
- /// </summary>
- public partial class addresslistDAL : IaddresslistDAL
- {
- #region 构造函数
- /// <summary>
- /// 数据层实例化
- /// </summary>
- public addresslistDAL()
- {
- }
- #endregion
- #region -----------实例化接口函数-----------
- #region 添加
- /// <summary>
- /// 向数据库中插入一条新记录
- /// </summary>
- /// <param name="addresslist">addresslist实体对象</param>
- /// <returns></returns>
- public int Insert(addresslist addresslist)
- {
- string sqlCommand = "addresslistInsert";
- int res;
- SqlParameter[] param ={
- new SqlParameter("@al_id",SqlDbType.Int),
- new SqlParameter("@al_u_id",SqlDbType.Int),
- new SqlParameter("@al_dept_id",SqlDbType.Int),
- new SqlParameter("@al_duty",SqlDbType.VarChar),
- new SqlParameter("@al_mobile",SqlDbType.VarChar),
- new SqlParameter("@al_smallclever",SqlDbType.VarChar),
- new SqlParameter("@al_worktelephone",SqlDbType.VarChar),
- new SqlParameter("@al_extension",SqlDbType.VarChar),
- new SqlParameter("@al_fax",SqlDbType.VarChar),
- new SqlParameter("@al_email",SqlDbType.VarChar),
- new SqlParameter("@al_qq",SqlDbType.VarChar),
- new SqlParameter("@al_msn",SqlDbType.VarChar),
- new SqlParameter("@al_address",SqlDbType.VarChar),
- new SqlParameter("@al_remark",SqlDbType.VarChar)
- };
- param[0].Direction = ParameterDirection.Output;
- param[1].Value = addresslist.al_u_id;
- param[2].Value = addresslist.al_dept_id;
- param[3].Value = addresslist.al_duty;
- param[4].Value = addresslist.al_mobile;
- param[5].Value = addresslist.al_smallclever;
- param[6].Value = addresslist.al_worktelephone;
- param[7].Value = addresslist.al_extension;
- param[8].Value = addresslist.al_fax;
- param[9].Value = addresslist.al_email;
- param[10].Value = addresslist.al_qq;
- param[11].Value = addresslist.al_msn;
- param[12].Value = addresslist.al_address;
- param[13].Value = addresslist.al_remark;
- res = SqlHelper.ExecuteNonQuery(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param);
- addresslist.al_id = ((param[0].Value) == DBNull.Value) ? 0 : Convert.ToInt32(param[0].Value);
- return res;
- }
- /// <summary>
- /// 向数据库中插入一条新记录。带事务
- /// </summary>
- /// <param name="sp">事务对象</param>
- /// <param name="addresslist">addresslist实体对象</param>
- /// <returns></returns>
- public int Insert(SqlTransaction sp, addresslist addresslist)
- {
- string sqlCommand = "addresslistInsert";
- int res;
- SqlParameter[] param ={
- new SqlParameter("@al_id",SqlDbType.Int),
- new SqlParameter("@al_u_id",SqlDbType.Int),
- new SqlParameter("@al_dept_id",SqlDbType.Int),
- new SqlParameter("@al_duty",SqlDbType.VarChar),
- new SqlParameter("@al_mobile",SqlDbType.VarChar),
- new SqlParameter("@al_smallclever",SqlDbType.VarChar),
- new SqlParameter("@al_worktelephone",SqlDbType.VarChar),
- new SqlParameter("@al_extension",SqlDbType.VarChar),
- new SqlParameter("@al_fax",SqlDbType.VarChar),
- new SqlParameter("@al_email",SqlDbType.VarChar),
- new SqlParameter("@al_qq",SqlDbType.VarChar),
- new SqlParameter("@al_msn",SqlDbType.VarChar),
- new SqlParameter("@al_address",SqlDbType.VarChar),
- new SqlParameter("@al_remark",SqlDbType.VarChar)
- };
- param[0].Direction = ParameterDirection.Output;
- param[1].Value = addresslist.al_u_id;
- param[2].Value = addresslist.al_dept_id;
- param[3].Value = addresslist.al_duty;
- param[4].Value = addresslist.al_mobile;
- param[5].Value = addresslist.al_smallclever;
- param[6].Value = addresslist.al_worktelephone;
- param[7].Value = addresslist.al_extension;
- param[8].Value = addresslist.al_fax;
- param[9].Value = addresslist.al_email;
- param[10].Value = addresslist.al_qq;
- param[11].Value = addresslist.al_msn;
- param[12].Value = addresslist.al_address;
- param[13].Value = addresslist.al_remark;
- res = SqlHelper.ExecuteNonQuery(sp, CommandType.StoredProcedure, sqlCommand, param);
- addresslist.al_id = ((param[0].Value) == DBNull.Value) ? 0 : Convert.ToInt32(param[0].Value);
- return res;
- }
- #endregion
- #region 更新
- /// <summary>
- /// 向数据表addresslist更新一条记录
- /// </summary>
- /// <param name="addresslist">addresslist实体对象</param>
- /// <returns></returns>
- public int Update(addresslist addresslist)
- {
- string sqlCommand = "addresslistUpdate";
- SqlParameter[] param ={
- new SqlParameter("@al_id",SqlDbType.Int),
- new SqlParameter("@al_u_id",SqlDbType.Int),
- new SqlParameter("@al_dept_id",SqlDbType.Int),
- new SqlParameter("@al_duty",SqlDbType.VarChar),
- new SqlParameter("@al_mobile",SqlDbType.VarChar),
- new SqlParameter("@al_smallclever",SqlDbType.VarChar),
- new SqlParameter("@al_worktelephone",SqlDbType.VarChar),
- new SqlParameter("@al_extension",SqlDbType.VarChar),
- new SqlParameter("@al_fax",SqlDbType.VarChar),
- new SqlParameter("@al_email",SqlDbType.VarChar),
- new SqlParameter("@al_qq",SqlDbType.VarChar),
- new SqlParameter("@al_msn",SqlDbType.VarChar),
- new SqlParameter("@al_address",SqlDbType.VarChar),
- new SqlParameter("@al_remark",SqlDbType.VarChar)
- };
- param[0].Value = addresslist.al_id;
- param[1].Value = addresslist.al_u_id;
- param[2].Value = addresslist.al_dept_id;
- param[3].Value = addresslist.al_duty;
- param[4].Value = addresslist.al_mobile;
- param[5].Value = addresslist.al_smallclever;
- param[6].Value = addresslist.al_worktelephone;
- param[7].Value = addresslist.al_extension;
- param[8].Value = addresslist.al_fax;
- param[9].Value = addresslist.al_email;
- param[10].Value = addresslist.al_qq;
- param[11].Value = addresslist.al_msn;
- param[12].Value = addresslist.al_address;
- param[13].Value = addresslist.al_remark;
- return SqlHelper.ExecuteNonQuery(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param);
- }
- /// <summary>
- /// 向数据表addresslist更新一条记录。带事务
- /// </summary>
- /// <param name="sp">事务对象</param>
- /// <param name="addresslist">addresslist实体对象</param>
- /// <returns></returns>
- public int Update(SqlTransaction sp, addresslist addresslist)
- {
- string sqlCommand = "addresslistUpdate";
- SqlParameter[] param ={
- new SqlParameter("@al_id",SqlDbType.Int),
- new SqlParameter("@al_u_id",SqlDbType.Int),
- new SqlParameter("@al_dept_id",SqlDbType.Int),
- new SqlParameter("@al_duty",SqlDbType.VarChar),
- new SqlParameter("@al_mobile",SqlDbType.VarChar),
- new SqlParameter("@al_smallclever",SqlDbType.VarChar),
- new SqlParameter("@al_worktelephone",SqlDbType.VarChar),
- new SqlParameter("@al_extension",SqlDbType.VarChar),
- new SqlParameter("@al_fax",SqlDbType.VarChar),
- new SqlParameter("@al_email",SqlDbType.VarChar),
- new SqlParameter("@al_qq",SqlDbType.VarChar),
- new SqlParameter("@al_msn",SqlDbType.VarChar),
- new SqlParameter("@al_address",SqlDbType.VarChar),
- new SqlParameter("@al_remark",SqlDbType.VarChar)
- };
- param[0].Value = addresslist.al_id;
- param[1].Value = addresslist.al_u_id;
- param[2].Value = addresslist.al_dept_id;
- param[3].Value = addresslist.al_duty;
- param[4].Value = addresslist.al_mobile;
- param[5].Value = addresslist.al_smallclever;
- param[6].Value = addresslist.al_worktelephone;
- param[7].Value = addresslist.al_extension;
- param[8].Value = addresslist.al_fax;
- param[9].Value = addresslist.al_email;
- param[10].Value = addresslist.al_qq;
- param[11].Value = addresslist.al_msn;
- param[12].Value = addresslist.al_address;
- param[13].Value = addresslist.al_remark;
- return SqlHelper.ExecuteNonQuery(sp, CommandType.StoredProcedure, sqlCommand, param);
- }
- #endregion
- #region 删除
- /// <summary>
- /// 删除数据表addresslist中的一条记录
- /// </summary>
- /// <param name="al_id">al_id</param>
- /// <returns></returns>
- public int Delete(int al_id)
- {
- string sqlCommand = "addresslistDelete";
- SqlParameter[] param ={
- new SqlParameter("@al_id",SqlDbType.Int)
- };
- param[0].Value = al_id;
- return SqlHelper.ExecuteNonQuery(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param);
- }
- /// <summary>
- /// 删除数据表addresslist中的一条记录
- /// </summary>
- /// <param name="addresslist">addresslist实体对象</param>
- /// <returns></returns>
- public int Delete(addresslist addresslist)
- {
- string sqlCommand = "addresslistDelete";
- SqlParameter[] param ={
- new SqlParameter("@al_id",SqlDbType.Int)
- };
- param[0].Value = addresslist.al_id;
- return SqlHelper.ExecuteNonQuery(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param);
- }
- /// <summary>
- /// 删除数据表addresslist中的一条记录,带事务
- /// </summary>
- /// <param name="sp">事务对象</param>
- /// <param name="al_id">al_id</param>
- /// <returns></returns>
- public int Delete(SqlTransaction sp, int al_id)
- {
- string sqlCommand = "addresslistDelete";
- SqlParameter[] param ={
- new SqlParameter("@al_id",SqlDbType.Int)
- };
- param[0].Value = al_id;
- return SqlHelper.ExecuteNonQuery(sp, CommandType.StoredProcedure, sqlCommand, param);
- }
- /// <summary>
- /// 删除数据表addresslist中的一条记录,带事务
- /// </summary>
- /// <param name="sp">事务对象</param>
- /// <param name="addresslist">addresslist实体对象</param>
- /// <returns></returns>
- public int Delete(SqlTransaction sp, addresslist addresslist)
- {
- string sqlCommand = "addresslistDelete";
- SqlParameter[] param ={
- new SqlParameter("@al_id",SqlDbType.Int)
- };
- param[0].Value = addresslist.al_id;
- return SqlHelper.ExecuteNonQuery(sp, CommandType.StoredProcedure, sqlCommand, param);
- }
- #endregion
- #region 实体对象
- /// <summary>
- /// 得到addresslist实体对象
- /// </summary>
- /// <param name="row">row</param>
- /// <returns>addresslist实体对象</returns>
- public addresslist Select(DataRow row)
- {
- addresslist obj = new addresslist();
- if (row != null)
- {
- obj.al_id = ((row["al_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(row["al_id"]);
- obj.al_u_id = ((row["al_u_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(row["al_u_id"]);
- obj.al_dept_id = ((row["al_dept_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(row["al_dept_id"]);
- obj.al_duty = row["al_duty"].ToString();
- obj.al_mobile = row["al_mobile"].ToString();
- obj.al_smallclever = row["al_smallclever"].ToString();
- obj.al_worktelephone = row["al_worktelephone"].ToString();
- obj.al_extension = row["al_extension"].ToString();
- obj.al_fax = row["al_fax"].ToString();
- obj.al_email = row["al_email"].ToString();
- obj.al_qq = row["al_qq"].ToString();
- obj.al_msn = row["al_msn"].ToString();
- obj.al_address = row["al_address"].ToString();
- obj.al_remark = row["al_remark"].ToString();
- }
- else
- {
- return null;
- }
- return obj;
- }
- /// <summary>
- /// 得到addresslist实体对象
- /// </summary>
- /// <param name="dr">dr</param>
- /// <returns>addresslist实体对象</returns>
- public addresslist Select(IDataReader dr)
- {
- addresslist obj = new addresslist();
- obj.al_id = ((dr["al_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(dr["al_id"]);
- obj.al_u_id = ((dr["al_u_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(dr["al_u_id"]);
- obj.al_dept_id = ((dr["al_dept_id"]) == DBNull.Value) ? 0 : Convert.ToInt32(dr["al_dept_id"]);
- obj.al_duty = dr["al_duty"].ToString();
- obj.al_mobile = dr["al_mobile"].ToString();
- obj.al_smallclever = dr["al_smallclever"].ToString();
- obj.al_worktelephone = dr["al_worktelephone"].ToString();
- obj.al_extension = dr["al_extension"].ToString();
- obj.al_fax = dr["al_fax"].ToString();
- obj.al_email = dr["al_email"].ToString();
- obj.al_qq = dr["al_qq"].ToString();
- obj.al_msn = dr["al_msn"].ToString();
- obj.al_address = dr["al_address"].ToString();
- obj.al_remark = dr["al_remark"].ToString();
- return obj;
- }
- /// <summary>
- /// 根据ID,返回一个addresslist实体对象
- /// </summary>
- /// <param name="al_id">al_id</param>
- /// <returns>addresslist实体对象</returns>
- public addresslist Select(int al_id)
- {
- return this.Select(al_id, false, false);
- }
- /// <summary>
- /// 根据ID,返回一个addresslist实体对象
- /// </summary>
- /// <param name="al_id">al_id</param>
- /// <param name="bParentTable">将addresslist对象设置与父表关联</param>
- /// <param name="bChildrenTable">将addresslist对象设置与子表关联</param>
- /// <returns>addresslist实体对象</returns>
- public addresslist Select(int al_id, bool bParentTable, bool bChildrenTable)
- {
- addresslist obj = null;
- SqlParameter[] param ={
- new SqlParameter("@al_id",SqlDbType.Int)
- };
- param[0].Value = al_id;
- string sqlCommand = "addresslistSelect";
- using (SqlDataReader dr = SqlHelper.ExecuteReader(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param))
- {
- while (dr.Read())
- {
- obj = this.Select(dr);
- }
- }
- this.Select(obj, bParentTable, bChildrenTable);
- return obj;
- }
- /// <summary>
- /// 将addresslist实体对象设置与父表和子表关联
- /// </summary>
- /// <param name="obj">addresslist实体对象</param>
- /// <param name="bParentTable">是/否设置与父表对象关联</param>
- /// <param name="bChildrenTable">是/否设置与子表对象关联</param>
- public void Select(addresslist obj, bool bParentTable, bool bChildrenTable)
- {
- //关联的主表
- if (bParentTable)
- {
- obj.users = usersBLL.Select(obj.al_u_id);
- obj.department = departmentBLL.Select(obj.al_dept_id);
- }
- //关联的子表集合
- if (bChildrenTable)
- {
- }
- }
- #endregion
- #region 父表
- /// <summary>
- /// 设置实体对象(addresslist)的父表对象
- /// </summary>
- /// <param name="addresslist">实体对象</param>
- public void users(addresslist addresslist)
- {
- addresslist.users = usersBLL.Select(addresslist.al_u_id);
- }
- /// <summary>
- /// 设置实体对象(addresslist)的父表对象
- /// </summary>
- /// <param name="addresslist">实体对象</param>
- public void department(addresslist addresslist)
- {
- addresslist.department = departmentBLL.Select(addresslist.al_dept_id);
- }
- #endregion
- #region 子表
- #endregion
- #region 查询
- /// <summary>
- /// 得到数据表addresslist所有记录
- /// </summary>
- /// <returns>结果集</returns>
- public IList<addresslist> Select()
- {
- return this.Select(false, false);
- }
- /// <summary>
- /// 得到数据表addresslist所有记录
- /// </summary>
- /// <param name="bParentTable">是/否设置与父表对象关联</param>
- /// <param name="bChildrenTable">是/否设置与子表对象关联</param>
- /// <returns>结果集</returns>
- public IList<addresslist> Select(bool bParentTable, bool bChildrenTable)
- {
- IList<addresslist> list = new List<addresslist>();
- string sqlCommand = "addresslistSelectAll";
- using (SqlDataReader dr = SqlHelper.ExecuteReader(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand))
- {
- while (dr.Read())
- {
- list.Add(this.Select(dr));
- }
- }
- foreach (addresslist obj in list)
- {
- this.Select(obj, bParentTable, bChildrenTable);
- }
- return list;
- }
- /// <summary>
- /// 得到数据表addresslist满足查询条件的记录
- /// </summary>
- /// <param name="where">查询条件</param>
- /// <returns>结果集</returns>
- public IList<addresslist> Select(string where)
- {
- return this.Select(where, false, false);
- }
- /// <summary>
- /// 得到数据表addresslist满足查询条件的记录
- /// </summary>
- /// <param name="where">查询条件</param>
- /// <param name="bParentTable">是/否设置与父表对象关联</param>
- /// <param name="bChildrenTable">是/否设置与子表对象关联</param>
- /// <returns>结果集</returns>
- public IList<addresslist> Select(string where, bool bParentTable, bool bChildrenTable)
- {
- IList<addresslist> list = new List<addresslist>();
- SqlParameter[] param ={
- new SqlParameter("@where",SqlDbType.VarChar,8000)
- };
- param[0].Value = where;
- string sqlCommand = "addresslistSelectByParams";
- using (SqlDataReader dr = SqlHelper.ExecuteReader(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param))
- {
- while (dr.Read())
- {
- list.Add(this.Select(dr));
- }
- }
- foreach (addresslist obj in list)
- {
- this.Select(obj, bParentTable, bChildrenTable);
- }
- return list;
- }
- /// <summary>
- /// 得到数据表ArticalInfo满足外键字段查询条件的记录
- /// </summary>
- /// <param name="foreignFieldName">外键字段名称</param>
- /// <param name="foreignFieldValue">外键字段值</param>
- /// <returns>结果集</returns>
- public IList<addresslist> Select(string foreignFieldName, int foreignFieldValue)
- {
- return this.Select(foreignFieldName, foreignFieldValue, false, false);
- }
- /// <summary>
- /// 得到数据表ArticalInfo满足外键字段查询条件的记录
- /// </summary>
- /// <param name="foreignFieldName">外键字段名称</param>
- /// <param name="foreignFieldValue">外键字段值</param>
- /// <param name="bParentTable">是/否设置与父表对象关联</param>
- /// <param name="bChildrenTable">是/否设置与子表对象关联</param>
- /// <returns>结果集</returns>
- public IList<addresslist> Select(string foreignFieldName, int foreignFieldValue, bool bParentTable, bool bChildrenTable)
- {
- return this.Select(string.Format("{0}='{1}'", foreignFieldName, foreignFieldValue), bParentTable, bChildrenTable);
- }
- /// <summary>
- /// 得到数据表addresslist满足查询条件的记录数
- /// </summary>
- /// <param name="where">查询条件</param>
- /// <param name="recordCount">记录数</param>
- public void Select(string where, out int recordCount)
- {
- string sqlCommand = "addresslistCountByWhere";
- SqlParameter[] param ={
- new SqlParameter("@where",SqlDbType.VarChar,8000),
- new SqlParameter("@recordCount",SqlDbType.Int)
- };
- param[0].Value = where;
- param[1].Direction = ParameterDirection.Output;
- SqlHelper.ExecuteNonQuery(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param);
- recordCount = Convert.ToInt32(param[1].Value);
- }
- /// <summary>
- /// 得到数据表addresslist满足查询条件的分页记录
- /// </summary>
- /// <param name="pageSize">每页显示记录数</param>
- /// <param name="pageIndex">当前显示第几页</param>
- /// <param name="where">查询条件</param>
- /// <returns>结果集</returns>
- public IList<addresslist> Select(int pageSize, int pageIndex, string where)
- {
- return this.Select(pageSize, pageIndex, where, false, false);
- }
- /// <summary>
- /// 得到数据表addresslist满足查询条件的分页记录
- /// </summary>
- /// <param name="pageSize">每页显示记录数</param>
- /// <param name="pageIndex">当前显示第几页</param>
- /// <param name="where">查询条件</param>
- /// <param name="bParentTable">是/否设置与父表对象关联</param>
- /// <param name="bChildrenTable">是/否设置与子表对象关联</param>
- /// <returns>结果集</returns>
- public IList<addresslist> Select(int pageSize, int pageIndex, string where, bool bParentTable, bool bChildrenTable)
- {
- IList<addresslist> list = new List<addresslist>();
- string sqlCommand = "addresslistSelectByPagerParams";
- SqlParameter[] param ={
- new SqlParameter("@pageSize",SqlDbType.Int),
- new SqlParameter("@pageIndex",SqlDbType.Int),
- new SqlParameter("@where",SqlDbType.VarChar,8000)
- };
- param[0].Value = pageSize;
- param[1].Value = pageIndex;
- param[2].Value = where;
- using (SqlDataReader dr = SqlHelper.ExecuteReader(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param))
- {
- while (dr.Read())
- {
- list.Add(this.Select(dr));
- }
- }
- foreach (addresslist obj in list)
- {
- this.Select(obj, bParentTable, bChildrenTable);
- }
- return list;
- }
- /// <summary>
- /// 得到数据表addresslist满足查询条件记录
- /// </summary>
- /// <param name="commandType">命令类型</param>
- /// <param name="sqlCommand">SQL命令</param>
- /// <param name="SqlParameter[]">命令参数数组</param>
- /// <returns>结果集</returns>
- public IList<addresslist> Select(CommandType commandType, string sqlCommand, params SqlParameter[] param)
- {
- return this.Select(false, false, commandType, sqlCommand, param);
- }
- /// <summary>
- /// 得到数据表addresslist满足查询条件记录
- /// </summary>
- /// <param name="bParentTable">是/否设置与父表对象关联</param>
- /// <param name="bChildrenTable">是/否设置与子表对象关联</param>
- /// <param name="commandType">命令类型</param>
- /// <param name="sqlCommand">SQL命令</param>
- /// <param name="SqlParameter[]">命令参数数组</param>
- /// <returns>结果集</returns>
- public IList<addresslist> Select(bool bParentTable, bool bChildrenTable, CommandType commandType, string sqlCommand, params SqlParameter[] param)
- {
- IList<addresslist> list = new List<addresslist>();
- using (SqlDataReader dr = SqlHelper.ExecuteReader(Conn.SqlConn, commandType, sqlCommand, param))
- {
- while (dr.Read())
- {
- list.Add(this.Select(dr));
- }
- }
- foreach (addresslist obj in list)
- {
- this.Select(obj, bParentTable, bChildrenTable);
- }
- return list;
- }
- /// <summary>
- /// 根据主键检测是否存在该条记录
- /// </summary>
- /// <param name="al_id">al_id</param>
- /// <returns>存在/不存在</returns>
- public bool Exists(int al_id)
- {
- SqlParameter[] param ={
- new SqlParameter("@al_id",SqlDbType.Int)
- };
- param[0].Value = al_id;
- string sqlCommand = "addresslistIsExist";
- int a = Convert.ToInt32(SqlHelper.ExecuteScalar(Conn.SqlConn, CommandType.StoredProcedure, sqlCommand, param));
- if (a > 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- #endregion
- #endregion
- }
- }