using ProjectBase.Data.BaseDAL.BaseDatabase; using ProjectBase.Util; using SIASUN.Autopilot.DAL.IDALSQL; using SIASUN.Autopilot.Model; using System; using System.Collections; using System.Collections.Generic; using System.Data; namespace SIASUN.Autopilot.DAL.DALSQL { public class DalAuthoryRole : BaseDALSQL, IDalAuthoryRole { #region 对象实例及构造函数 public static DalAuthoryRole Instance { get { return new DalAuthoryRole(); } } public DalAuthoryRole() : base("authory_role", new string[] { "role_id" }) { this.sortField = "role_id"; this.isDescending = false; } #endregion /// /// 将DataReader的属性值转化为实体类的属性值,返回实体类 /// /// 有效的DataReader对象 /// 实体类对象 protected override MoAuthoryRole DataReaderToEntity(IDataReader dataReader) { MoAuthoryRole info = new MoAuthoryRole(); SmartDataReader reader = new SmartDataReader(dataReader); info.RoleId = reader.GetString("role_id"); info.RoleName = reader.GetString("role_name"); info.RoleTime = reader.GetDateTime("role_time"); info.RoleDescription = reader.GetString("role_description"); return info; } /// /// 将实体对象的属性值转化为Hashtable对应的键值 /// /// 有效的实体对象 /// 包含键值映射的Hashtable protected override Hashtable GetHashByEntity(MoAuthoryRole obj) { MoAuthoryRole info = obj as MoAuthoryRole; Hashtable hash = new Hashtable(); hash.Add("role_id", info.RoleId); hash.Add("role_name", info.RoleName); hash.Add("role_time", info.RoleTime); hash.Add("role_description", info.RoleDescription); return hash; } } }