using System; using ProjectBase.Data.BaseDAL.BaseDatabase; using ProjectBase.Util; using System.Collections; using System.Data; using SIASUN.Autopilot.DAL.IDALSQL; using SIASUN.Autopilot.Model; namespace SIASUN.Autopilot.DAL.DALSQL { public class DalLogOperationSetting : BaseDALSQL, IDalLogOperationSetting { #region 对象实例及构造函数 public static DalLogOperationSetting Instance { get { return new DalLogOperationSetting(); } } public DalLogOperationSetting() : base("log_operationSetting", new string[] { "setting_id" }) { this.sortField = "setting_id"; this.isDescending = false; } #endregion /// /// 将DataReader的属性值转化为实体类的属性值,返回实体类 /// /// 有效的DataReader对象 /// 实体类对象 protected override MoLogOperationSetting DataReaderToEntity(IDataReader dataReader) { MoLogOperationSetting info = new MoLogOperationSetting(); SmartDataReader reader = new SmartDataReader(dataReader); info.ID = reader.GetInt64("setting_id"); info.Forbid = Convert.ToBoolean(reader.GetInt32("setting_forBid")); info.TableName = reader.GetString("setting_tableName"); info.InsertLog = Convert.ToBoolean(reader.GetInt32("setting_insertLog")); info.DeleteLog = Convert.ToBoolean(reader.GetInt32("setting_deleteLog")); info.UpdateLog = Convert.ToBoolean(reader.GetInt32("setting_updateLog")); info.CreatorAccount = reader.GetString("setting_creatorAccount"); info.CreatorName = reader.GetString("setting_creatorName"); info.CreateTime = Convert.ToDateTime(reader.GetString("setting_creatTime")); info.EditorAccount = reader.GetString("setting_editorAccount"); info.EditorName = reader.GetString("setting_editorName"); info.EditTime = Convert.ToDateTime(reader.GetString("setting_editorTime")); return info; } /// /// 将实体对象的属性值转化为Hashtable对应的键值 /// /// 有效的实体对象 /// 包含键值映射的Hashtable protected override Hashtable GetHashByEntity(MoLogOperationSetting obj) { MoLogOperationSetting info = obj as MoLogOperationSetting; Hashtable hash = new Hashtable(); //hash.Add("logIn_id", info.ID); hash.Add("setting_forBid", info.Forbid); hash.Add("setting_tableName", info.TableName); hash.Add("setting_insertLog", info.InsertLog); hash.Add("setting_deleteLog", info.DeleteLog); hash.Add("setting_updateLog", info.UpdateLog); hash.Add("setting_creatorAccount", info.CreatorAccount); hash.Add("setting_creatorName", info.CreatorName); hash.Add("setting_creatTime", info.CreateTime); hash.Add("setting_editorAccount", info.EditorAccount); hash.Add("setting_editorName", info.EditorName); hash.Add("setting_editorTime", info.EditTime); return hash; } } }