Ejemplo n.º 1
0
        //on Click function. this show a new child form which allow the admin to add a service
        private void AddService(object sender, EventArgs e)
        {
            AdminServiceEdit ServicesListChild = new AdminServiceEdit(this.Email, this.PassHash, CarPlate);

            ServicesListChild.MdiParent       = this.ParentForm;
            ServicesListChild.FormBorderStyle = FormBorderStyle.None;
            ServicesListChild.Dock            = DockStyle.Fill;
            ServicesListChild.Show();
        }
Ejemplo n.º 2
0
 //on Click function. this show a new child form which allow the admin to modify a service
 private void EditService(object sender, EventArgs e)
 {
     if (servicesListView.SelectedItems.Count == 1)
     {
         try
         {
             var selectedService = this.serviceManager.GetServiceByID(Convert.ToInt32(this.servicesListView.SelectedItems[0].Text), this.Email, this.PassHash);
             AdminServiceEdit ServicesListChild = new AdminServiceEdit(this.Email, this.PassHash, selectedService);
             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 ad editare il servizio", MessageBoxButtons.OK);
         }
     }
 }