public bool isResistrato(Utente utente) { for (int i = 0; i < lista.Count; i++) { if ((utente.getCognome() == lista.ElementAt(i).getCognome()) && (utente.getCodFiscale() == lista.ElementAt(i).getCodFiscale()) && (utente.getPassword() == lista.ElementAt(i).getPassword())) { return(true); } } return(false); }
public Utente getUtente(Utente u) { Utente temp = new Utente(); for (int i = 0; i < lista.Count; i++) { if ((u.getCognome() == lista.ElementAt(i).getCognome()) && (u.getCodFiscale() == lista.ElementAt(i).getCodFiscale()) && (u.getPassword() == lista.ElementAt(i).getPassword())) { temp = lista.ElementAt(i); return(temp); } } return(null); }
public FinestraAreaRiservata(Utente temp, gestioneFile listaRegistrati) { com = new SerialPort("COM3", 9600); try { com.Open(); } catch { }; u = temp; g = listaRegistrati; InitializeComponent(); lblUtente.Content = u.getCognome() + " " + u.getNome(); timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(1); timer.Tick += timer_Tick; timer.Start(); b = u.getBiglietto(); tariffa = b.getTariffa(); indice = b.getIndice(); if (b.getTariffa() == "s") { lblTariffa.Content = "Settimanale"; lblIndice.Content = indice.ToString(); } else if (b.getTariffa() == "g") { lblTariffa.Content = "Giornaliero"; lblIndice.Content = indice.ToString(); } else if (b.getTariffa() == "m") { lblTariffa.Content = "Mensile"; lblIndice.Content = indice.ToString(); } else { lblTariffa.Content = "NESSUNO"; lblIndice.Content = "NESSUNO"; } lblIndice.Content = indice.ToString(); lblSaldo.Content = u.getSaldo().ToString() + " €"; saldo = u.getSaldo(); cmbTariffa.Items.Add("Giornaliero"); cmbTariffa.Items.Add("Settimanale"); cmbTariffa.Items.Add("Mensile"); }