SysGroupAuthorityManage.cs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Data.Common;
  5. using CB.Common;
  6. using CB.Entity;
  7. using CB.Interface.Infrastructure;
  8. namespace CB.Data.SqlServer
  9. {
  10. public class SysGroupAuthorityManage : Repository<SysGroupAuthorityInfo>, ISysGroupAuthorityService
  11. {
  12. public SysGroupAuthorityManage(string interfaceId)
  13. : base(interfaceId)
  14. {
  15. }
  16. public override bool Save(SysGroupAuthorityInfo entity)
  17. {
  18. throw new NotImplementedException();
  19. }
  20. public override bool Update(SysGroupAuthorityInfo entity)
  21. {
  22. throw new NotImplementedException();
  23. }
  24. public override bool Delete(int Id)
  25. {
  26. throw new NotImplementedException();
  27. }
  28. public override SysGroupAuthorityInfo Get<TKey>(TKey key)
  29. {
  30. throw new NotImplementedException();
  31. }
  32. public override IList<SysGroupAuthorityInfo> ToList()
  33. {
  34. throw new NotImplementedException();
  35. }
  36. public override IList<SysGroupAuthorityInfo> ToList(SysGroupAuthorityInfo entity)
  37. {
  38. throw new NotImplementedException();
  39. }
  40. public override IList<SysGroupAuthorityInfo> ToPaging(SysGroupAuthorityInfo entity, int pageSize, int pageIndex, out int recordCount)
  41. {
  42. throw new NotImplementedException();
  43. }
  44. public IList<int> GetUserGroupAuthorityList(int groupId)
  45. {
  46. DbParameter[] pars =
  47. {
  48. DbHelper.MakeInParam(InterfaceId,"@statement",(DbType)SqlDbType.NVarChar,100,"SELECT [AId] FROM [SYS_SysGroupAuthority] WHERE [GroupId]=@gid"),
  49. DbHelper.MakeInParam(InterfaceId,"@params",(DbType)SqlDbType.NVarChar,10,"@gid int"),
  50. DbHelper.MakeInParam(InterfaceId,"@gid",(DbType)SqlDbType.Int,4,groupId)
  51. };
  52. IList<int> list = new List<int>();
  53. using (IDataReader reader = DbHelper.ExecuteReader(InterfaceId,CommandType.StoredProcedure, "dbo.sp_executesql", pars))
  54. {
  55. while (reader.Read())
  56. {
  57. list.Add(reader.GetInt32(0));
  58. }
  59. reader.Dispose();
  60. }
  61. return list;
  62. }
  63. protected override SysGroupAuthorityInfo LoadEntity(IDataReader reader)
  64. {
  65. return new SysGroupAuthorityInfo
  66. {
  67. Id = TypeConverter.ObjectToInt(reader["Id"]),
  68. GroupId = TypeConverter.ObjectToInt(reader["GroupId"]),
  69. AId = TypeConverter.ObjectToInt(reader["AId"])
  70. };
  71. }
  72. protected override SysGroupAuthorityInfo LoadEntity(DataRow dr)
  73. {
  74. return new SysGroupAuthorityInfo
  75. {
  76. Id = TypeConverter.ObjectToInt(dr["Id"]),
  77. GroupId = TypeConverter.ObjectToInt(dr["GroupId"]),
  78. AId = TypeConverter.ObjectToInt(dr["AId"])
  79. };
  80. }
  81. }
  82. }