Beispiel #1
0
 //this function reload the list of all services
 private void UpdateServices()
 {
     servicesListView.Items.Clear();
     try
     {
         var services = serviceManager.GetCarServicesForCar(this.CarPlate, this.Email, this.PassHash);
         PlateNumberLabel.Text = "su " + this.CarPlate;
         foreach (var SingleService in services)
         {
             servicesListView.Items.Add(new ListViewItem(new string[] { SingleService.ID.ToString(), SingleService.Kilometers.ToString(), SingleService.TotalSpent.ToString() }));
         }
     }catch (Exception exc)
     {
         MessageBox.Show("Errore nella connessione al server.", "Proprio non riesco ad aggiornare la lista delle macchine.", MessageBoxButtons.OK);
     }
     servicesListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
     servicesListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
 }