using CB.Entity; using CB.Interface.Infrastructure; using System.Collections.Generic; using System.Data; using System.Data.Common; using System.Data.SqlClient; using CB.Common; namespace CB.Data.SqlServer { public class PicClassManage : Repository, IPicClassService { public PicClassManage(string interfaceId) : base(interfaceId) { } public override bool Save(PicClassInfo entity) { throw new System.NotImplementedException(); } public override bool Update(PicClassInfo entity) { throw new System.NotImplementedException(); } public override bool Delete(int Id) { throw new System.NotImplementedException(); } public override PicClassInfo Get(TKey key) { throw new System.NotImplementedException(); } public override IList ToList() { DbParameter[] parameters = new SqlParameter[] { }; using (DataTable dt = DbHelper.ExecuteDatatable(InterfaceId, CommandType.StoredProcedure, "uzt_PicClass_GetList", parameters)) { List lists = new List(); for (int i = 0; i < dt.Rows.Count; i++) { lists.Add(LoadEntity(dt.Rows[i])); } return lists; } } public override IList ToList(PicClassInfo entity) { throw new System.NotImplementedException(); } public override IList ToPaging(PicClassInfo entity, int pageSize, int pageIndex, out int recordCount) { throw new System.NotImplementedException(); } /// /// IDataReader数据转换实体 /// /// IDataReader /// protected override PicClassInfo LoadEntity(IDataReader row) { return new PicClassInfo { Id = TypeConverter.ObjectToInt(row["Id"]), Cid = TypeConverter.ObjectToInt(row["Cid"]), Pid = TypeConverter.ObjectToInt(row["Pid"]) }; } /// /// DataRow数据转换实体 /// /// DataRow /// protected override PicClassInfo LoadEntity(DataRow row) { return new PicClassInfo { Id = TypeConverter.ObjectToInt(row["Id"]), Cid = TypeConverter.ObjectToInt(row["Cid"]), Pid = TypeConverter.ObjectToInt(row["Pid"]) }; } } }