using ProjectBase.Data.BaseDAL.BaseDatabase; using ProjectBase.Data.Logs; using ProjectBase.Util; using SIMDP.DAL.IDALSQL; using SIMDP.Model; using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SIMDP.DAL.DALSQL { public class DalRoleRight : BaseDALSQL, IDalRoleRight { #region 对象实例及构造函数 public static DalRoleRight Instance { get { return new DalRoleRight(); } } public DalRoleRight() : base("role_right", "role_id") { this.sortField = "role_id"; this.isDescending = false; } #endregion /// /// 将DataReader的属性值转化为实体类的属性值,返回实体类 /// /// 有效的DataReader对象 /// 实体类对象 protected override MoRoleRight DataReaderToEntity(IDataReader dataReader) { MoRoleRight info = new MoRoleRight(); SmartDataReader reader = new SmartDataReader(dataReader); info.RoleId = reader.GetString("role_id"); info.RightId = reader.GetString("right_id"); info.RightType = reader.GetInt32("right_type"); return info; } /// /// 将实体对象的属性值转化为Hashtable对应的键值 /// /// 有效的实体对象 /// 包含键值映射的Hashtable protected override Hashtable GetHashByEntity(MoRoleRight obj) { MoRoleRight info = obj as MoRoleRight; Hashtable hash = new Hashtable(); hash.Add("role_id", info.RoleId); hash.Add("right_id", info.RightId); hash.Add("right_type", info.RightType); return hash; } } }