public double MezzoInUscita(Veicolo v) { Parcheggia p = (_parcheggia.Find(x => x.DataUscita == null && x.Targa == v.Targa)); p.DataUscita = DateTime.Now; return((p.DataUscita.Value - p.DataIngresso).Hours * GetPosto(p.IdPosto).TariffaOraria); }
public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo) { Parcheggia p = (value as BindingGroup).Items[0] as Parcheggia; return(p.DataUscita <= p.DataIngresso ? new ValidationResult(false, "") : ValidationResult.ValidResult); }