private List<ExpandoSetting> GetDefaultExpandoProperties() { List<ExpandoSetting> settings = new List<ExpandoSetting>(); using (DbDataReader reader = dbSiteSettingsEx.GetDefaultExpandoSettings()) { while (reader.Read()) { ExpandoSetting s = new ExpandoSetting(); s.SiteId = -1; s.KeyName = reader["KeyName"].ToString(); s.KeyValue = reader["DefaultValue"].ToString(); s.GroupName = reader["GroupName"].ToString(); s.IsDirty = false; settings.Add(s); } } return settings; }
private List<ExpandoSetting> GetExpandoProperties(int siteId) { if (siteId == -1) { return GetDefaultExpandoProperties(); } //new site List<ExpandoSetting> settings = new List<ExpandoSetting>(); using (DbDataReader reader = dbSiteSettingsEx.GetSiteSettingsExList(siteId)) { while (reader.Read()) { ExpandoSetting s = new ExpandoSetting(); s.SiteId = Convert.ToInt32(reader["SiteID"]); s.KeyName = reader["KeyName"].ToString(); s.KeyValue = reader["KeyValue"].ToString(); s.GroupName = reader["GroupName"].ToString(); s.IsDirty = false; settings.Add(s); } } return settings; }