Пример #1
0
        /// <summary>
        /// 填充后台用户实体类
        /// </summary>
        /// <param name="reader">记录集</param>
        /// <returns>实体类</returns>
        protected AdminInfo PopulateAdmin(IDataReader reader)
        {
            AdminInfo admin = new AdminInfo();

            admin.ID             = (int)reader["ID"];
            admin.Administrator  = DataConvert.SafeBool(reader["Administrator"]);
            admin.LastLoginIP    = reader["LastLoginIP"] as string;
            admin.LastLoginTime  = reader["LastLoginTime"] as DateTime?;
            admin.Password       = reader["Password"] as string;
            admin.UserName       = reader["UserName"] as string;
            admin.UserRole       = (UserRoleType)(Int16)reader["UserRole"];
            admin.PowerGroupID   = DataConvert.SafeInt(reader["PowerGroupID"]);
            admin.PowerGroupName = reader["PowerGroupName"] as string;
            admin.GroupPower     = reader["GroupPower"] as string;

            SerializerData data = new SerializerData();

            data.Keys   = reader["PropertyNames"] as string;
            data.Values = reader["PropertyValues"] as string;
            admin.SetSerializerData(data);

            return(admin);
        }
Пример #2
0
        /// <summary>
        /// 填充后台用户实体类
        /// </summary>
        /// <param name="reader">记录集</param>
        /// <returns>实体类</returns>
        protected AdminInfo PopulateAdmin(IDataReader reader)
        {
            AdminInfo admin = new AdminInfo();
            admin.ID = (int)reader["ID"];
            admin.Administrator = DataConvert.SafeBool(reader["Administrator"]);
            admin.LastLoginIP = reader["LastLoginIP"] as string;
            admin.LastLoginTime = reader["LastLoginTime"] as DateTime?;
            admin.Password = reader["Password"] as string;
            admin.UserName = reader["UserName"] as string;
            admin.UserRole = (UserRoleType)(Int16)reader["UserRole"];
            admin.PowerGroupID = DataConvert.SafeInt(reader["PowerGroupID"]);
            admin.PowerGroupName = reader["PowerGroupName"] as string;
            admin.GroupPower = reader["GroupPower"] as string;

            SerializerData data = new SerializerData();
            data.Keys = reader["PropertyNames"] as string;
            data.Values = reader["PropertyValues"] as string;
            admin.SetSerializerData(data);

            return admin;
        }