Exemple #1
0
 public Rate(Tariff tariff, Zone zone, double peakRate, double offPeakRate)
 {
     this.Tariff = tariff;
     this.Zone = zone;
     this.PeakRate = peakRate;
     this.OffPeakRate = offPeakRate;
 }
        public bool Update(Tariff tariff)
        {
            DbCommand updateCommand = database.CreateCommand(SQL_UPDATE);
            database.DefineParameter(updateCommand, "@Id", DbType.String, tariff.Id);
            database.DefineParameter(updateCommand, "@Name", DbType.String, tariff.Name);
            database.DefineParameter(updateCommand, "@BasicFee", DbType.Double, tariff.BasicFee);

            return database.ExecuteNonQuery(updateCommand) == 1;
        }