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, 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 key) { throw new NotImplementedException(); } public override IList ToList() { throw new NotImplementedException(); } public override IList ToList(SysGroupAuthorityInfo entity) { throw new NotImplementedException(); } public override IList ToPaging(SysGroupAuthorityInfo entity, int pageSize, int pageIndex, out int recordCount) { throw new NotImplementedException(); } public IList 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 list = new List(); 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"]) }; } } }