int IComparable.CompareTo(object obj) { InflationCurveSetting ics = obj as InflationCurveSetting; if (ics != null) { if ( (this.ZcBasisId == ics.ZcBasisId) && (this.ZcCompounding == ics.ZcCompounding) && (this.ZcFrequency == ics.ZcFrequency) && (this.ifZc == ics.ifZc) && (this.ZCColor == ics.ZCColor) && (this.ifIndex == ics.ifIndex) && (this.IndexColor == ics.IndexColor) // (this.Calendar == ycs.Calendar) ) { return(0); } else { return(-1); } } else { throw new ArgumentException("Parameter is not a InflationCurveSetting!"); } }
//??? public Calendar Calendar { get; set; } public object Clone() { InflationCurveSetting ics = new InflationCurveSetting(); ics.ZcBasisId = this.ZcBasisId; ics.ZcCompounding = this.ZcCompounding; ics.ZcFrequency = this.ZcFrequency; ics.ifZc = this.ifZc; ics.ZCColor = this.ZCColor; ics.ifIndex = this.ifIndex; ics.IndexColor = this.IndexColor; return(ics); }
// settings and name internal static List <InflationCurveData> GetInflationCurveData(ConnectionContextSQLite ctx, long?idIC) { List <InflationCurveData> ic = new List <InflationCurveData>(); var command = SqlHelperSQLite.SelectInflationCurveDataCommand(ctx, idIC); using (var reader = command.ExecuteReader()) { while (reader.Read()) { var ics = new InflationCurveSetting { ZcBasisId = reader.GetInt32(reader.GetOrdinal("ZcBasisId")), ZcCompounding = reader.GetString(reader.GetOrdinal("ZcCompounding")), ZcFrequency = reader.GetString(reader.GetOrdinal("ZcFrequency")), ifZc = reader.GetBoolean(reader.GetOrdinal("ifZC")), ZCColor = reader.IsDBNull(reader.GetOrdinal("ZCColor")) ? "" : reader.GetString(reader.GetOrdinal("ZCColor")), ifIndex = reader.GetBoolean(reader.GetOrdinal("ifIndex")), IndexColor = reader.IsDBNull(reader.GetOrdinal("IndexColor")) ? "" : reader.GetString(reader.GetOrdinal("IndexColor")) }; // Calendar cal = new Calendar // { // Id = reader.IsDBNull(reader.GetOrdinal("calId")) ? -1 : reader.GetInt32(reader.GetOrdinal("calId")), // ClassName = reader.IsDBNull(reader.GetOrdinal("calClassName")) ? null : reader.GetString(reader.GetOrdinal("calClassName")), // MarketName = reader.IsDBNull(reader.GetOrdinal("calMarketName")) ? null : reader.GetString(reader.GetOrdinal("calMarketName")) // }; // ycs.Calendar = cal; ic.Add(new InflationCurveData { Id = reader.GetInt32(reader.GetOrdinal("Id")), Name = reader.GetString(reader.GetOrdinal("Name")), Family = reader.GetString(reader.GetOrdinal("Family")), //CurrencyId = reader.IsDBNull(reader.GetOrdinal("CurrencyId")) ? -1 : reader.GetInt32(reader.GetOrdinal("CurrencyId")), //InflationIndexId = reader.IsDBNull(reader.GetOrdinal("InflationIndex")) ? -1 : reader.GetInt32(reader.GetOrdinal("InflationIndex")), CurrencyId = reader.GetInt32(reader.GetOrdinal("CurrencyId")), InflationIndexId = reader.GetInt32(reader.GetOrdinal("InflationIndex")), settings = ics }); } } return(ic); }