コード例 #1
0
 private void btn_send_to_database_Click(object sender, EventArgs e)
 {
     if (id != 0)
     {
         UtilityController.UpdateUtility(id, MoleculeController.getByName(cbox_molecules.Text), tbox_name.Text, tbox_description.Text);
         MessageBox.Show("L'utilité a été correctement mise à jour dans la base de données", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         UtilityController.AddUtility(MoleculeController.getByName(cbox_molecules.Text), tbox_name.Text, tbox_description.Text);
         MessageBox.Show("L'utilité a été correctement ajoutée à la base de données", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     uc_MainUtility.Instance.ReloadPanel();
     this.SendToBack();
 }
コード例 #2
0
 private void btn_send_to_database_Click(object sender, EventArgs e)
 {
     if (id != 0)
     {
         PatentController.UpdatePatent(id, MoleculeController.getByName(cbox_molecules.Text), CompanyController.getByName(cbox_companies.Text), tbox_country.Text, tbox_number.Text, dtime_deposit_date.Value, (int)nbox_duration.Value);
         MessageBox.Show("Le brevet a été correctement mise à jour dans la base de données", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         PatentController.AddPatent(MoleculeController.getByName(cbox_molecules.Text), CompanyController.getByName(cbox_companies.Text), tbox_country.Text, tbox_number.Text, dtime_deposit_date.Value, (int)nbox_duration.Value);
         MessageBox.Show("Le brevet a été correctement ajoutée à la base de données", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     uc_MainPatent.Instance.ReloadPanel();
     this.SendToBack();
 }