using System; using System.Collections.Generic; using System.Linq; using System.Text; using CY.IDAL; using System.Data.SqlClient; using System.Data; namespace CY.SQLDAL { public class Pay_CashApplyRecordDAL : IPay_CashApplyRecordDAL { private Database _dataBase = null; public Pay_CashApplyRecordDAL() { _dataBase = new Database(); } /// /// 新增 /// /// /// public bool InserModel(Infrastructure.Domain.IAggregateRoot model) { Model.Pay_CashApplyRecord trueModel = model as Model.Pay_CashApplyRecord; if (trueModel == null) { return false; } IList sqlParms = new List() { new SqlParameter("@Money",trueModel.Money), new SqlParameter("@CreateTime",trueModel.CreateTime), new SqlParameter("@Payid",trueModel.Payid), new SqlParameter("@TargetBankName",trueModel.TargetBankName), new SqlParameter("@CashType",trueModel.CashType), new SqlParameter("@TargetBankNum",trueModel.TargetBankNum), new SqlParameter("@Cardholder",trueModel.Cardholder), new SqlParameter("@Operator",trueModel.Operator), new SqlParameter("@Remark",trueModel.Remark) }; try { _dataBase.Query("sp_Pay_CashApplyRecord_Insert", CommandType.StoredProcedure, sqlParms.ToArray()); } catch (Exception ex) { throw ex; } return true; } /// /// 修改 /// /// /// public bool UpdateModel(Infrastructure.Domain.IAggregateRoot model) { Model.Pay_CashApplyRecord trueModel = model as Model.Pay_CashApplyRecord; if (trueModel == null) { return false; } IList sqlParms = new List() {new SqlParameter("@Keyid",trueModel.Keyid), new SqlParameter("@Money",trueModel.Money), new SqlParameter("@CreateTime",trueModel.CreateTime), new SqlParameter("@Payid",trueModel.Payid), new SqlParameter("@TargetBankName",trueModel.TargetBankName), new SqlParameter("@CashType",trueModel.CashType), new SqlParameter("@TargetBankNum",trueModel.TargetBankNum), new SqlParameter("@Cardholder",trueModel.Cardholder), new SqlParameter("@Operator",trueModel.Operator), new SqlParameter("@Remark",trueModel.Remark) }; try { _dataBase.Query("sp_Pay_CashApplyRecord_Update", CommandType.StoredProcedure, sqlParms.ToArray()); } catch (Exception ex) { throw ex; } return true; } /// /// 删除 /// /// /// public bool DeleteModel(Infrastructure.Domain.IAggregateRoot model) { Model.Pay_CashApplyRecord trueModel = model as Model.Pay_CashApplyRecord; if (trueModel == null) { return false; } IList sqlParms = new List() { new SqlParameter("@Keyid",trueModel.Keyid) }; try { _dataBase.Query("sp_Pay_CashApplyRecord_DeleteRow", CommandType.StoredProcedure, sqlParms.ToArray()); } catch (Exception ex) { throw ex; } return true; } /// /// 分页查询 /// /// /// /// public IEnumerable SelectModelPage(Infrastructure.Query.Query query, Infrastructure.Query.Pagination pagination) { throw new NotImplementedException(); } /// /// 单个查询 /// /// /// public IEnumerable SelectAllModel(Infrastructure.Query.Query query) { throw new NotImplementedException(); } } }