12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Data.Common;
- using CB.Common;
- using CB.Entity;
- using CB.Interface.Infrastructure;
- namespace CB.Data.SqlServer
- {
- public class SysGroupAuthorityManage : Repository<SysGroupAuthorityInfo>, ISysGroupAuthorityService
- {
- public SysGroupAuthorityManage(string interfaceId)
- : base(interfaceId)
- {
- }
- public override bool Save(SysGroupAuthorityInfo entity)
- {
- throw new NotImplementedException();
- }
- public override bool Update(SysGroupAuthorityInfo entity)
- {
- throw new NotImplementedException();
- }
- public override bool Delete(int Id)
- {
- throw new NotImplementedException();
- }
- public override SysGroupAuthorityInfo Get<TKey>(TKey key)
- {
- throw new NotImplementedException();
- }
- public override IList<SysGroupAuthorityInfo> ToList()
- {
- throw new NotImplementedException();
- }
- public override IList<SysGroupAuthorityInfo> ToList(SysGroupAuthorityInfo entity)
- {
- throw new NotImplementedException();
- }
- public override IList<SysGroupAuthorityInfo> ToPaging(SysGroupAuthorityInfo entity, int pageSize, int pageIndex, out int recordCount)
- {
- throw new NotImplementedException();
- }
- public IList<int> GetUserGroupAuthorityList(int groupId)
- {
- DbParameter[] pars =
- {
- DbHelper.MakeInParam(InterfaceId,"@statement",(DbType)SqlDbType.NVarChar,100,"SELECT [AId] FROM [SYS_SysGroupAuthority] WHERE [GroupId]=@gid"),
- DbHelper.MakeInParam(InterfaceId,"@params",(DbType)SqlDbType.NVarChar,10,"@gid int"),
- DbHelper.MakeInParam(InterfaceId,"@gid",(DbType)SqlDbType.Int,4,groupId)
- };
- IList<int> list = new List<int>();
- using (IDataReader reader = DbHelper.ExecuteReader(InterfaceId,CommandType.StoredProcedure, "dbo.sp_executesql", pars))
- {
- while (reader.Read())
- {
- list.Add(reader.GetInt32(0));
- }
- reader.Dispose();
- }
- return list;
- }
- protected override SysGroupAuthorityInfo LoadEntity(IDataReader reader)
- {
- return new SysGroupAuthorityInfo
- {
- Id = TypeConverter.ObjectToInt(reader["Id"]),
- GroupId = TypeConverter.ObjectToInt(reader["GroupId"]),
- AId = TypeConverter.ObjectToInt(reader["AId"])
- };
- }
- protected override SysGroupAuthorityInfo LoadEntity(DataRow dr)
- {
- return new SysGroupAuthorityInfo
- {
- Id = TypeConverter.ObjectToInt(dr["Id"]),
- GroupId = TypeConverter.ObjectToInt(dr["GroupId"]),
- AId = TypeConverter.ObjectToInt(dr["AId"])
- };
- }
- }
- }
|