1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- using ProjectBase.Data.BaseDAL.BaseDatabase;
- using ProjectBase.Util;
- using SIASUN.Autopilot.DAL.IDALSQL;
- using SIASUN.Autopilot.Model;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Data;
- namespace SIASUN.Autopilot.DAL.DALSQL
- {
- public class DalAuthoryUser : BaseDALSQL<MoAuthoryUser>, IDalAuthoryUser
- {
- #region 对象实例及构造函数
- public static DalAuthoryUser Instance
- {
- get
- {
- return new DalAuthoryUser();
- }
- }
- public DalAuthoryUser() : base("authory_user", new string[] { "login_account" })
- {
- this.sortField = "login_account";
- this.isDescending = false;
- }
- #endregion
- /// <summary>
- /// 将DataReader的属性值转化为实体类的属性值,返回实体类
- /// </summary>
- /// <param name="dr">有效的DataReader对象</param>
- /// <returns>实体类对象</returns>
- protected override MoAuthoryUser DataReaderToEntity(IDataReader dataReader)
- {
- MoAuthoryUser info = new MoAuthoryUser();
- SmartDataReader reader = new SmartDataReader(dataReader);
- info.LoginAccount = reader.GetString("login_account");
- info.LoginPasswd = reader.GetString("login_passwd");
- info.UserName = reader.GetString("user_name");
- info.UserMobile = reader.GetString("user_mobile");
- info.UserEmail = reader.GetString("user_email");
- info.UserTime = reader.GetDateTime("user_time");
- info.GroupId = reader.GetString("group_id");
- info.UserStatus = reader.GetInt32("user_status");
- info.UserSex = reader.GetInt32("user_sex");
- info.CardId = reader.GetString("card_id");
- return info;
- }
- /// <summary>
- /// 将实体对象的属性值转化为Hashtable对应的键值
- /// </summary>
- /// <param name="obj">有效的实体对象</param>
- /// <returns>包含键值映射的Hashtable</returns>
- protected override Hashtable GetHashByEntity(MoAuthoryUser obj)
- {
- MoAuthoryUser info = obj as MoAuthoryUser;
- Hashtable hash = new Hashtable();
- hash.Add("login_account", info.LoginAccount);
- hash.Add("login_passwd", info.LoginPasswd);
- hash.Add("user_name", info.UserName);
- hash.Add("user_mobile", info.UserMobile);
- hash.Add("user_email", info.UserEmail);
- hash.Add("user_time", info.UserTime);
- hash.Add("group_id", info.GroupId);
- hash.Add("user_status", info.UserStatus);
- hash.Add("user_sex", info.UserSex);
- hash.Add("card_id", info.CardId);
- return hash;
- }
- }
- }
|