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 EC_AccepterAddressDAL : IEC_AccepterAddressDAL { private Database _dataBase = null; public EC_AccepterAddressDAL() { _dataBase = new Database(); } /// /// 新增 /// /// /// public bool InserModel(Infrastructure.Domain.IAggregateRoot model) { Model.EC_AccepterAddress trueModel = model as Model.EC_AccepterAddress; if (trueModel == null) { return false; } IList sqlParms = new List() { new SqlParameter("@MemberId",trueModel.MemberId), new SqlParameter("@Accepter",trueModel.Accepter), new SqlParameter("@AccepterMobileNum",trueModel.AccepterMobileNum), new SqlParameter("@PhoneNum",trueModel.PhoneNum), new SqlParameter("@Email",trueModel.Email), new SqlParameter("@Province",trueModel.Province), new SqlParameter("@City",trueModel.City), new SqlParameter("@County",trueModel.County), new SqlParameter("@DetailedAddress",trueModel.DetailedAddress), new SqlParameter("@Postcode",trueModel.Postcode), new SqlParameter("@LastUpdateTime",trueModel.LastUpdateTime), new SqlParameter("@Operator",trueModel.Operator), new SqlParameter("@Remark",trueModel.Remark) }; try { _dataBase.Query("sp_EC_AccepterAddress_Insert", CommandType.StoredProcedure, sqlParms.ToArray()); } catch (Exception ex) { throw ex; } return true; } /// /// 修改 /// /// /// public bool UpdateModel(Infrastructure.Domain.IAggregateRoot model) { Model.EC_AccepterAddress trueModel = model as Model.EC_AccepterAddress; if (trueModel == null) { return false; } IList sqlParms = new List() { new SqlParameter("@Keyid",trueModel.Keyid), new SqlParameter("@MemberId",trueModel.MemberId), new SqlParameter("@Accepter",trueModel.Accepter), new SqlParameter("@AccepterMobileNum",trueModel.AccepterMobileNum), new SqlParameter("@PhoneNum",trueModel.PhoneNum), new SqlParameter("@Email",trueModel.Email), new SqlParameter("@Province",trueModel.Province), new SqlParameter("@City",trueModel.City), new SqlParameter("@County",trueModel.County), new SqlParameter("@DetailedAddress",trueModel.DetailedAddress), new SqlParameter("@Postcode",trueModel.Postcode), new SqlParameter("@LastUpdateTime",trueModel.LastUpdateTime), new SqlParameter("@Operator",trueModel.Operator), new SqlParameter("@Remark",trueModel.Remark) }; try { _dataBase.Query("sp_EC_AccepterAddress_Update", CommandType.StoredProcedure, sqlParms.ToArray()); } catch (Exception ex) { throw ex; } return true; } /// /// 删除 /// /// /// public bool DeleteModel(Infrastructure.Domain.IAggregateRoot model) { Model.EC_AccepterAddress trueModel = model as Model.EC_AccepterAddress; if (trueModel == null) { return false; } IList sqlParms = new List() { new SqlParameter("@Keyid",trueModel.Keyid) }; try { _dataBase.Query("sp_EC_AccepterAddress_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(); } } }