123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- 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 DalProductData : BaseDALSQL<MoProductData>, IDalProductData
- {
- #region 对象实例及构造函数
- public static DalProductData Instance
- {
- get
- {
- return new DalProductData();
- }
- }
- public DalProductData() : base("product_data", "data_id")
- {
- this.sortField = "data_id";
- this.isDescending = false;
- }
- #endregion
- /// <summary>
- /// 将DataReader的属性值转化为实体类的属性值,返回实体类
- /// </summary>
- /// <param name="dr">有效的DataReader对象</param>
- /// <returns>实体类对象</returns>
- protected override MoProductData DataReaderToEntity(IDataReader dataReader)
- {
- MoProductData info = new MoProductData();
- SmartDataReader reader = new SmartDataReader(dataReader);
- info.DataId = reader.GetInt64("data_id");
- info.RuleId = reader.GetInt64("rule_id");
- info.DataValue = reader.GetString("data_value");
- info.RuleTime = reader.GetDateTime("rule_time");
- info.Batchid = reader.GetString("batchid");
- return info;
- }
- /// <summary>
- /// 将实体对象的属性值转化为Hashtable对应的键值
- /// </summary>
- /// <param name="obj">有效的实体对象</param>
- /// <returns>包含键值映射的Hashtable</returns>
- protected override Hashtable GetHashByEntity(MoProductData obj)
- {
- MoProductData info = obj as MoProductData;
- Hashtable hash = new Hashtable();
- //hash.Add("data_id", info.DataId);
- hash.Add("rule_id", info.RuleId);
- hash.Add("data_value", info.DataValue);
- hash.Add("rule_time", info.RuleTime);
- hash.Add("batchid", info.Batchid);
- return hash;
- }
- }
- }
|