1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- 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.DALSQ
- {
- public class DalSchedulerJob : BaseDALSQL<MoSchedulerJob>, IDalSchedulerJob
- {
- #region 对象实例及构造函数
- public static DalSchedulerJob Instance
- {
- get
- {
- return new DalSchedulerJob();
- }
- }
- public DalSchedulerJob() : base("scheduler_job", "id")
- {
- this.sortField = "id";
- this.isDescending = false;
- }
- #endregion
- /// <summary>
- /// 将DataReader的属性值转化为实体类的属性值,返回实体类
- /// </summary>
- /// <param name="dr">有效的DataReader对象</param>
- /// <returns>实体类对象</returns>
- protected override MoSchedulerJob DataReaderToEntity(IDataReader dataReader)
- {
- MoSchedulerJob info = new MoSchedulerJob();
- SmartDataReader reader = new SmartDataReader(dataReader);
- info.Id = reader.GetInt32("id");
- info.JobName = reader.GetString("job_name");
- info.JobTime = reader.GetString("job_time");
- info.JobPara = reader.GetString("job_para");
- info.JobValid = reader.GetInt32("job_valid");
- return info;
- }
- /// <summary>
- /// 将实体对象的属性值转化为Hashtable对应的键值
- /// </summary>
- /// <param name="obj">有效的实体对象</param>
- /// <returns>包含键值映射的Hashtable</returns>
- protected override Hashtable GetHashByEntity(MoSchedulerJob obj)
- {
- MoSchedulerJob info = obj as MoSchedulerJob;
- Hashtable hash = new Hashtable();
- //hash.Add("Id", info.Id);
- hash.Add("job_name", info.JobName);
- hash.Add("job_time", info.JobTime);
- hash.Add("job_para", info.JobPara);
- hash.Add("job_valid", info.JobValid);
- return hash;
- }
- }
- }
|