/// <summary> /// 将数据反序列化 /// </summary> /// <param name="data">序列化的数据</param> public void SetSerializerData(SerializerData data) { if (this.extendedAttributes == null || this.extendedAttributes.Count == 0) { this.extendedAttributes = Serializer.ConvertToNameValueCollection(data.Keys, data.Values); } if (this.extendedAttributes == null) { extendedAttributes = new NameValueCollection(); } }
/// <summary> /// 获取经过序列转化后的数据 /// </summary> /// <returns>序列化后的数据</returns> public SerializerData GetSerializerData() { SerializerData data = new SerializerData(); string keys = null; string values = null; Serializer.ConvertFromNameValueCollection(this.extendedAttributes, ref keys, ref values); data.Keys = keys; data.Values = values; return(data); }
/// <summary> /// 将数据反序列化 /// </summary> /// <param name="data">序列化的数据</param> public void SetSerializerData(SerializerData data) { if (this.extendedAttributes == null || this.extendedAttributes.Count == 0) { this.extendedAttributes = Serializer.ConvertToNameValueCollection(data.Keys, data.Values); } if (this.extendedAttributes == null) extendedAttributes = new NameValueCollection(); }
/// <summary> /// 获取经过序列转化后的数据 /// </summary> /// <returns>序列化后的数据</returns> public SerializerData GetSerializerData() { SerializerData data = new SerializerData(); string keys = null; string values = null; Serializer.ConvertFromNameValueCollection(this.extendedAttributes, ref keys, ref values); data.Keys = keys; data.Values = values; return data; }
/// <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; }
public static CorporationInfo PopulateCorporationInfo(IDataReader reader) { CorporationInfo entity = new CorporationInfo() { ID = (int)reader["ID"], Name = reader["Name"] as string, Sort = DataConvert.SafeInt(reader["Sort"]) }; SerializerData data = new SerializerData(); data.Keys = reader["PropertyNames"] as string; data.Values = reader["PropertyValues"] as string; entity.SetSerializerData(data); return entity; }