示例#1
0
 public ParkingInput(int days, int hours, int minutes, EparkRate eParkRate)
 {
     Days     = days;
     Hours    = hours;
     Minutes  = minutes;
     ParkRate = eParkRate;
 }
示例#2
0
        public ParkRate(EparkRate eparkRate)
        {
            Name = eparkRate.ToDescriptionString();

            switch (eparkRate)
            {
            case EparkRate.ParkRate0:
                throw new Exception("Le Forfait n'est pas défini");

            case EparkRate.ParkRate1:
                PriceFor20Minutes = 6;
                MaxPricePerDay    = 37;
                break;

            case EparkRate.ParkRate2:
                PriceFor20Minutes = 6;
                MaxPricePerDay    = 30;
                break;

            case EparkRate.ParkRate3:
                PriceFor20Minutes = 12;
                MaxPricePerDay    = 42;
                break;

            default:
                throw new Exception("Le Forfait n'est pas défini");
            }
        }
示例#3
0
 public static string ToDescriptionString(this EparkRate val)
 {
     DescriptionAttribute[] attributes = (DescriptionAttribute[])val.GetType().GetField(val.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false);
     return(attributes.Length > 0 ? attributes[0].Description : string.Empty);
 }