1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- 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 DalPcData : BaseDALSQL<MoPcData>, IDalPcData
- {
- #region 对象实例及构造函数
- public static DalPcData Instance
- {
- get
- {
- return new DalPcData();
- }
- }
- public DalPcData() : base("PC_DATA", "ID")
- {
- }
- #endregion
- /// <summary>
- /// 将DataReader的属性值转化为实体类的属性值,返回实体类
- /// </summary>
- /// <param name="dr">有效的DataReader对象</param>
- /// <returns>实体类对象</returns>
- protected override MoPcData DataReaderToEntity(IDataReader dataReader)
- {
- MoPcData info = new MoPcData();
- SmartDataReader reader = new SmartDataReader(dataReader);
- info.Id = reader.GetInt32("ID");
- info.ImportTime = reader.GetDateTime("IMPORT_TIME");
- info.Model = reader.GetInt32("MODEL");
- info.Color = reader.GetInt32("COLOR");
- info.Vin = reader.GetString("VIN");
- return info;
- }
- /// <summary>
- /// 将实体对象的属性值转化为Hashtable对应的键值
- /// </summary>
- /// <param name="obj">有效的实体对象</param>
- /// <returns>包含键值映射的Hashtable</returns>
- protected override Hashtable GetHashByEntity(MoPcData obj)
- {
- MoPcData info = obj as MoPcData;
- Hashtable hash = new Hashtable();
- hash.Add("ID", info.Id);
- hash.Add("IMPORT_TIME", info.ImportTime);
- hash.Add("MODEL", info.Model);
- hash.Add("COLOR", info.Color);
- hash.Add("VIN", info.Vin);
- return hash;
- }
- /// <summary>
- /// 获取字段中文别名(用于界面显示)的字典集合
- /// </summary>
- /// <returns></returns>
- public override Dictionary<string, string> GetColumnNameAlias()
- {
- Dictionary<string, string> dict = new Dictionary<string, string>();
- #region 添加别名解析
- //dict.Add("ID", "编号");
- dict.Add("ID", "");
- dict.Add("ImportTime", "记录数据导入日期(防止第二天写入前未清除)");
- dict.Add("Model", "型号");
- dict.Add("Color", "颜色");
- dict.Add("Vin", "VIN码,限制17个字符");
- #endregion
- return dict;
- }
- }
- }
|