PicClassManage.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using CB.Entity;
  2. using CB.Interface.Infrastructure;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Data.Common;
  6. using System.Data.SqlClient;
  7. using CB.Common;
  8. namespace CB.Data.SqlServer
  9. {
  10. public class PicClassManage : Repository<PicClassInfo>, IPicClassService
  11. {
  12. public PicClassManage(string interfaceId) : base(interfaceId)
  13. {
  14. }
  15. public override bool Save(PicClassInfo entity)
  16. {
  17. throw new System.NotImplementedException();
  18. }
  19. public override bool Update(PicClassInfo entity)
  20. {
  21. throw new System.NotImplementedException();
  22. }
  23. public override bool Delete(int Id)
  24. {
  25. throw new System.NotImplementedException();
  26. }
  27. public override PicClassInfo Get<TKey>(TKey key)
  28. {
  29. throw new System.NotImplementedException();
  30. }
  31. public override IList<PicClassInfo> ToList()
  32. {
  33. DbParameter[] parameters = new SqlParameter[] { };
  34. using (DataTable dt = DbHelper.ExecuteDatatable(InterfaceId, CommandType.StoredProcedure, "uzt_PicClass_GetList", parameters))
  35. {
  36. List<PicClassInfo> lists = new List<PicClassInfo>();
  37. for (int i = 0; i < dt.Rows.Count; i++)
  38. {
  39. lists.Add(LoadEntity(dt.Rows[i]));
  40. }
  41. return lists;
  42. }
  43. }
  44. public override IList<PicClassInfo> ToList(PicClassInfo entity)
  45. {
  46. throw new System.NotImplementedException();
  47. }
  48. public override IList<PicClassInfo> ToPaging(PicClassInfo entity, int pageSize, int pageIndex, out int recordCount)
  49. {
  50. throw new System.NotImplementedException();
  51. }
  52. /// <summary>
  53. /// IDataReader数据转换实体
  54. /// </summary>
  55. /// <param name="row">IDataReader</param>
  56. /// <returns></returns>
  57. protected override PicClassInfo LoadEntity(IDataReader row)
  58. {
  59. return new PicClassInfo
  60. {
  61. Id = TypeConverter.ObjectToInt(row["Id"]),
  62. Cid = TypeConverter.ObjectToInt(row["Cid"]),
  63. Pid = TypeConverter.ObjectToInt(row["Pid"])
  64. };
  65. }
  66. /// <summary>
  67. /// DataRow数据转换实体
  68. /// </summary>
  69. /// <param name="row">DataRow</param>
  70. /// <returns></returns>
  71. protected override PicClassInfo LoadEntity(DataRow row)
  72. {
  73. return new PicClassInfo
  74. {
  75. Id = TypeConverter.ObjectToInt(row["Id"]),
  76. Cid = TypeConverter.ObjectToInt(row["Cid"]),
  77. Pid = TypeConverter.ObjectToInt(row["Pid"])
  78. };
  79. }
  80. }
  81. }