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
{
///
/// 数据组表操作说明
///
class DalDataGroup : BaseDALSQL, IDalDataGroup
{
#region 对象实例及构造函数
public static DalDataGroup Instance
{
get
{
return new DalDataGroup();
}
}
public DalDataGroup() : base("data_group", "data_group_id")
{
this.sortField = "data_group_id";
this.isDescending = false;
}
#endregion
///
/// 将DataReader的属性值转化为实体类的属性值,返回实体类
///
/// 有效的DataReader对象
/// 实体类对象
protected override MoDataGroup DataReaderToEntity(IDataReader dataReader)
{
MoDataGroup info = new MoDataGroup();
SmartDataReader reader = new SmartDataReader(dataReader);
info.DataGroupId = reader.GetInt64("data_group_id");
info.DataGroupName = reader.GetString("data_group_name");
info.DataGroupType = reader.GetInt64("data_group_type");
info.DataGroupPlcId = reader.GetInt64("data_group_plc_id");
return info;
}
///
/// 将实体对象的属性值转化为Hashtable对应的键值
///
/// 有效的实体对象
/// 包含键值映射的Hashtable
protected override Hashtable GetHashByEntity(MoDataGroup obj)
{
MoDataGroup info = obj as MoDataGroup;
Hashtable hash = new Hashtable();
//hash.Add("data_group_id", info.DataGroupId);
hash.Add("data_group_name", info.DataGroupName);
hash.Add("data_group_type", info.DataGroupType);
hash.Add("data_group_plc_id", info.DataGroupPlcId);
return hash;
}
}
}