using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ProjectBase.Data.BaseDAL.BaseDatabase; using ProjectBase.Util; using SIMDP.DAL.IDALSQL; using SIMDP.Model; using System.Collections; using System.Data; namespace SIMDP.DAL.DALSQL { public class DalLogLogIn : BaseDALSQL, IDalLogLogIn { #region 对象实例及构造函数 public static DalLogLogIn Instance { get { return new DalLogLogIn(); } } public DalLogLogIn() : base("log_logIn", "logIn_id") { this.sortField = "logIn_id"; this.isDescending = false; } #endregion /// /// 将DataReader的属性值转化为实体类的属性值,返回实体类 /// /// 有效的DataReader对象 /// 实体类对象 protected override MoLogLogIn DataReaderToEntity(IDataReader dataReader) { MoLogLogIn info = new MoLogLogIn(); SmartDataReader reader = new SmartDataReader(dataReader); info.ID = reader.GetInt64("logIn_id"); info.Account = reader.GetString("logIn_account"); info.Name = reader.GetString("logIn_name"); info.GroupId = reader.GetString("logIn_groupId"); info.Description = reader.GetString("logIn_description"); info.Ip = reader.GetString("logIn_ip"); info.Mac = reader.GetString("logIn_mac"); info.Time = Convert.ToDateTime(reader.GetString("logIn_time")); return info; } /// /// 将实体对象的属性值转化为Hashtable对应的键值 /// /// 有效的实体对象 /// 包含键值映射的Hashtable protected override Hashtable GetHashByEntity(MoLogLogIn obj) { MoLogLogIn info = obj as MoLogLogIn; Hashtable hash = new Hashtable(); //hash.Add("logIn_id", info.ID); hash.Add("logIn_account", info.Account); hash.Add("logIn_name", info.Name); hash.Add("logIn_groupId", info.GroupId); hash.Add("logIn_description", info.Description); hash.Add("logIn_ip", info.Ip); hash.Add("logIn_mac", info.Mac); hash.Add("logIn_time", info.Time); return hash; } } }