12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using ProjectBase.Data.BaseDAL.BaseDatabase;
- 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 DalUserParameter : BaseDALSQL<MoUserParameter>, IDalUserParameter
- {
- #region 对象实例及构造函数
- public static DalUserParameter Instance
- {
- get
- {
- return new DalUserParameter();
- }
- }
- public DalUserParameter() : base("user_parameter", "user_para_id")
- {
- this.sortField = "user_para_id";
- this.isDescending = false;
- }
- #endregion
- /// <summary>
- /// 将DataReader的属性值转化为实体类的属性值,返回实体类
- /// </summary>
- /// <param name="dr">有效的DataReader对象</param>
- /// <returns>实体类对象</returns>
- protected override MoUserParameter DataReaderToEntity(IDataReader dataReader)
- {
- MoUserParameter info = new MoUserParameter();
- SmartDataReader reader = new SmartDataReader(dataReader);
- info.UserParaId = reader.GetInt32("user_para_id");
- info.UserParaName = reader.GetString("user_para_name");
- //info.UserParaType = reader.GetString("user_para_type");
- //info.UserParaScope = reader.GetString("user_para_scope");
- info.UserParaUnit = reader.GetString("user_para_unit");
- info.UserParaDescription = reader.GetString("user_para_description");
- info.UserParaValue = reader.GetString("user_para_value");
- info.UserParaValid = Convert.ToBoolean(reader.GetInt32("user_para_valid"));
- //info.UserParaTime = reader.GetDateTime("user_para_time");
- return info;
- }
- /// <summary>
- /// 将实体对象的属性值转化为Hashtable对应的键值
- /// </summary>
- /// <param name="obj">有效的实体对象</param>
- /// <returns>包含键值映射的Hashtable</returns>
- protected override Hashtable GetHashByEntity(MoUserParameter obj)
- {
- MoUserParameter info = obj as MoUserParameter;
- Hashtable hash = new Hashtable();
- //hash.Add("rule_id", info.RuleId);
- hash.Add("user_para_name", info.UserParaName);
- //hash.Add("user_para_type", info.UserParaType);
- //hash.Add("user_para_scope", info.UserParaScope);
- hash.Add("user_para_unit", info.UserParaUnit);
- hash.Add("user_para_description", info.UserParaDescription);
- hash.Add("user_para_value", info.UserParaValue);
- hash.Add("user_para_valid", info.UserParaValid);
- //hash.Add("user_para_time", info.UserParaTime);
- return hash;
- }
- }
- }
|