//on Click function. This function close this form and open the servicelist Form private void StopEditing(object sender, EventArgs e) { AdminServiceList ServicesListChild = new AdminServiceList(this.Email, this.PassHash, this.ServicedCar.PlateNumber); ServicesListChild.MdiParent = this.ParentForm; ServicesListChild.FormBorderStyle = FormBorderStyle.None; ServicesListChild.Dock = DockStyle.Fill; ServicesListChild.Show(); }
//on Click function. this show the servicelist form relative at the selected car private void CheckServices(object sender, EventArgs e) { if (carListView.SelectedItems.Count == 1) { try { var selectedCar = this.carManager.GetCarByPlate(carListView.SelectedItems[0].Text, this.Email, this.PassHash); AdminServiceList ServicesListChild = new AdminServiceList(this.Email, this.PassHash, selectedCar.PlateNumber); ServicesListChild.MdiParent = this.ParentForm; ServicesListChild.FormBorderStyle = FormBorderStyle.None; ServicesListChild.Dock = DockStyle.Fill; ServicesListChild.Show(); }catch (Exception exc) { MessageBox.Show("Errore nella connessione al server.", "Proprio non riesco a farti vedere i servizi della macchina.", MessageBoxButtons.OK); } } }