DalRemnantInformation.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using ProjectBase.Data.BaseDAL.BaseDatabase;
  7. using ProjectBase.Util;
  8. using SIMDP.DAL.IDALSQL;
  9. using SIMDP.Model;
  10. using System.Data;
  11. using System.Collections;
  12. namespace SIMDP.DAL.DALSQL
  13. {
  14. public class DalRemnantInformation : BaseDALSQL<MoRemnantInformation>, IDalRemnantInformation
  15. {
  16. #region 对象实例及构造函数
  17. public static DalRemnantInformation Instance
  18. {
  19. get
  20. {
  21. return new DalRemnantInformation();
  22. }
  23. }
  24. public DalRemnantInformation() : base("remnant_information", "data_id")
  25. {
  26. this.sortField = "data_id";
  27. this.isDescending = false;
  28. }
  29. #endregion
  30. /// <summary>
  31. /// 将DataReader的属性值转化为实体类的属性值,返回实体类
  32. /// </summary>
  33. /// <param name="dr">有效的DataReader对象</param>
  34. /// <returns>实体类对象</returns>
  35. protected override MoRemnantInformation DataReaderToEntity(IDataReader dataReader)
  36. {
  37. MoRemnantInformation info = new MoRemnantInformation();
  38. SmartDataReader reader = new SmartDataReader(dataReader);
  39. info.Data_id = reader.GetInt64("data_id");
  40. info.Tray_code = reader.GetString("tray_code");
  41. info.Record_time = reader.GetDateTime("record_time");
  42. info.Flag = reader.GetByte("flag");
  43. return info;
  44. }
  45. /// <summary>
  46. /// 将实体对象的属性值转化为Hashtable对应的键值
  47. /// </summary>
  48. /// <param name="obj">有效的实体对象</param>
  49. /// <returns>包含键值映射的Hashtable</returns>
  50. protected override Hashtable GetHashByEntity(MoRemnantInformation obj)
  51. {
  52. MoRemnantInformation info = obj as MoRemnantInformation;
  53. Hashtable hash = new Hashtable();
  54. hash.Add("tray_code", info.Tray_code);
  55. hash.Add("record_time", info.Record_time);
  56. hash.Add("flag", info.Flag);
  57. return hash;
  58. }
  59. }
  60. }