using System; using System.Collections.Generic; using System.Linq; using System.Text; using CY.IDAL; using System.Data.SqlClient; using System.Data; using CY.Infrastructure.Query; using CY.Model; namespace CY.SQLDAL { public class Integrity_CreditGrowRecordDAL : IIntegrity_CreditGrowRecordDAL { private Database _dataBase = null; public Integrity_CreditGrowRecordDAL() { _dataBase = new Database(); } public Integrity_CreditGrowRecordDAL(Database dDatabase) { _dataBase = dDatabase; } /// /// 新增 /// /// /// public bool InserModel(Infrastructure.Domain.IAggregateRoot model) { Model.Integrity_CreditGrowRecord trueModel = model as Model.Integrity_CreditGrowRecord; if (trueModel == null) { return false; } IList sqlParms = new List() { new SqlParameter("@IntegrityCardId",trueModel.IntegrityCardId), new SqlParameter("@Reason",trueModel.Reason), new SqlParameter("@Fraction",trueModel.Fraction), new SqlParameter("@LastUpdateTime",trueModel.LastUpdateTime), new SqlParameter("@Operator",trueModel.Operator), new SqlParameter("@Remark",trueModel.Remark) }; try { _dataBase.Query("sp_Integrity_CreditGrowRecord_Insert", CommandType.StoredProcedure, sqlParms.ToArray()); } catch (Exception ex) { throw ex; } return true; } /// /// 修改 /// /// /// public bool UpdateModel(Infrastructure.Domain.IAggregateRoot model) { Model.Integrity_CreditGrowRecord trueModel = model as Model.Integrity_CreditGrowRecord; if (trueModel == null) { return false; } IList sqlParms = new List() {new SqlParameter("@Keyid",trueModel.Keyid), new SqlParameter("@IntegrityCardId",trueModel.IntegrityCardId), new SqlParameter("@Reason",trueModel.Reason), new SqlParameter("@Fraction",trueModel.Fraction), new SqlParameter("@LastUpdateTime",trueModel.LastUpdateTime), new SqlParameter("@Operator",trueModel.Operator), new SqlParameter("@Remark",trueModel.Remark) }; try { _dataBase.Query("sp_Integrity_CreditGrowRecord_Update", CommandType.StoredProcedure, sqlParms.ToArray()); } catch (Exception ex) { throw ex; } return true; } /// /// 删除 /// /// /// public bool DeleteModel(Infrastructure.Domain.IAggregateRoot model) { Model.Integrity_CreditGrowRecord trueModel = model as Model.Integrity_CreditGrowRecord; if (trueModel == null) { return false; } IList sqlParms = new List() { new SqlParameter("@Keyid",trueModel.Keyid) }; try { _dataBase.Query("sp_Integrity_CreditGrowRecord_DeleteRow", CommandType.StoredProcedure, sqlParms.ToArray()); } catch (Exception ex) { throw ex; } return true; } /// /// 根据编号分页查询 /// /// /// /// public IEnumerable SelectModelPage(Infrastructure.Query.Pagination pagination,int? Keyid) { if (Keyid == null || Keyid<=0) return null;//错误数据返会空 try { IList result = _dataBase.SelectModelPage(pagination, "*", "Integrity_CreditGrowRecord", "LastUpdateTime DESC", "LastUpdateTime DESC", string.Format(" IntegrityCardId = '{0}' ", Keyid)) as IList;//执行查询 return null == result ? null : result;//返回结果 } catch (Exception ex) { throw ex; } } /// /// 单个查询 /// /// /// public IEnumerable SelectAllModel(Infrastructure.Query.Query query) { throw new NotImplementedException(); } public IEnumerable SelectModelPage(Query query, Pagination pagination) { throw new NotImplementedException(); } } }