/// <summary> /// 按照查询条件查询 /// </summary> /// <param name="query">查询条件</param> /// <param name="order">排序</param> /// <param name="currentPage">页号,-1不分页</param> /// <param name="pageSize">每页记录数</param> /// <param name="totalCount">总行数</param> /// <returns>集合</returns> public DataTable GetQS_DeadOrAppraisal(QueryQS_DeadOrAppraisal query, string order, int currentPage, int pageSize, out int totalCount) { string where = string.Empty; if (query.QS_DAID != Constant.INT_INVALID_VALUE) { where += " And QS_DAID=" + query.QS_DAID; } if (query.QS_RTID != Constant.INT_INVALID_VALUE) { where += " And QS_RTID=" + query.QS_RTID; } if (query.DeadItemName != Constant.STRING_INVALID_VALUE) { where += " And DeadItemName like '%" + StringHelper.SqlFilter(query.DeadItemName) + "%'"; } if (query.Status != Constant.INT_INVALID_VALUE) { where += " And Status=" + query.Status; } if (query.CreateUserID != Constant.INT_INVALID_VALUE) { where += " And CreateUserID=" + query.CreateUserID; } DataSet ds; SqlParameter[] parameters = { new SqlParameter("@where", SqlDbType.NVarChar, 40000), new SqlParameter("@order", SqlDbType.NVarChar, 200), new SqlParameter("@pagesize", SqlDbType.Int, 4), new SqlParameter("@indexpage", SqlDbType.Int, 4), new SqlParameter("@totalRecorder", SqlDbType.Int, 4) }; parameters[0].Value = where; parameters[1].Value = order; parameters[2].Value = pageSize; parameters[3].Value = currentPage; parameters[4].Direction = ParameterDirection.Output; ds = SqlHelper.ExecuteDataset(CONNECTIONSTRINGS, CommandType.StoredProcedure, P_QS_DEADORAPPRAISAL_SELECT, parameters); totalCount = (int)(parameters[4].Value); return(ds.Tables[0]); }
/// <summary> /// 是否存在该记录 /// </summary> public bool IsExistsByQS_DAID(int QS_DAID) { QueryQS_DeadOrAppraisal query = new QueryQS_DeadOrAppraisal(); query.QS_DAID = QS_DAID; DataTable dt = new DataTable(); int count = 0; dt = GetQS_DeadOrAppraisal(query, string.Empty, 1, 1, out count); if (count > 0) { return(true); } else { return(false); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Entities.QS_DeadOrAppraisal GetQS_DeadOrAppraisal(int QS_DAID) { QueryQS_DeadOrAppraisal query = new QueryQS_DeadOrAppraisal(); query.QS_DAID = QS_DAID; DataTable dt = new DataTable(); int count = 0; dt = GetQS_DeadOrAppraisal(query, string.Empty, 1, 1, out count); if (count > 0) { return(LoadSingleQS_DeadOrAppraisal(dt.Rows[0])); } else { return(null); } }
/// <summary> /// 按照查询条件查询 /// </summary> /// <param name="query">查询条件</param> /// <param name="order">排序</param> /// <param name="currentPage">页号,-1不分页</param> /// <param name="pageSize">每页记录数</param> /// <param name="totalCount">总行数</param> /// <returns>集合</returns> public DataTable GetQS_DeadOrAppraisal(QueryQS_DeadOrAppraisal query, string order, int currentPage, int pageSize, out int totalCount) { return(Dal.QS_DeadOrAppraisal.Instance.GetQS_DeadOrAppraisal(query, order, currentPage, pageSize, out totalCount)); }