Esempio n. 1
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     denSantier  = textBoxDenumire.Text;
     benSantier  = textBoxBeneficiar.Text;
     adrSantier  = textBoxAdresa.Text;
     proiSantier = textBoxProiectant.Text;
     imgSantier  = textBoxImagine.Text;
     manager     = Convert.ToInt16(comboBoxSefSantier.SelectedValue.ToString());
     try
     {
         // daca nu sunt completate datele complete, eroare
         if (denSantier == "" || benSantier == "" || adrSantier == "" || proiSantier == "" || imgSantier == "")
         {
             throw new Exception("Completați toate datele!");
         }
         Adaugare_DB.inregistrezSantierDB(denSantier, benSantier, adrSantier, proiSantier, Convert.ToInt16(manager), imgSantier);
         MessageBox.Show("Șantier adăugat!");
         //golim continutul obiectelor din interfata
         textBoxDenumire.Text   = "";
         textBoxBeneficiar.Text = "";
         textBoxAdresa.Text     = "";
         textBoxProiectant.Text = "";
         textBoxImagine.Text    = "";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 2
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     numeFct = textBoxFunctie.Text;
     try
     {
         if (numeFct == "")
         {
             throw new Exception("Introduceți numele funcției!");
         }
         Adaugare_DB.inregistrariFunctie(numeFct);
         MessageBox.Show("Funcție nouă adăugat!");
         textBoxFunctie.Text = "";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 3
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     numeTr = textBoxDenumire.Text;
     valTr  = Convert.ToInt16(textBoxPret.Text);
     try
     {
         if (numeTr == "")
         {
             throw new Exception("Date incomplete. Repetati!");
         }
         Adaugare_DB.inregistrariTransport(numeTr, valTr);
         MessageBox.Show("Material nou transportat adaugat");
         textBoxDenumire.Text = "";
         textBoxPret.Text     = "";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 4
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     numeUt  = textBoxDenumire.Text;
     prodUt  = textBoxProducator.Text;
     tarifUt = Convert.ToInt16(textBoxTarif.Text);
     try
     {
         if (numeUt == "" || prodUt == "")
         {
             throw new Exception("Date incomplete. Repetati!");
         }
         Adaugare_DB.inregistrariUtilaj(numeUt, prodUt, Convert.ToInt16(tarifUt));
         MessageBox.Show("Utilaj nou adaugat");
         textBoxDenumire.Text   = "";
         textBoxProducator.Text = "";
         textBoxTarif.Text      = "";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 5
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     denMat   = textBoxDenumire.Text;
     umMat    = textBoxUM.Text;
     pretMat  = Convert.ToInt16(textBoxPret.Text);
     furnizor = Convert.ToInt16(comboBoxFurnizor.SelectedValue.ToString());
     try
     {
         if (denMat == "" || umMat == "")
         {
             throw new Exception("Date incomplete. Repetati!");
         }
         Adaugare_DB.inregistrariMateriale(denMat, umMat, Convert.ToInt16(pretMat), Convert.ToInt16(furnizor));
         MessageBox.Show("Material nou adaugat");
         textBoxDenumire.Text = "";
         textBoxUM.Text       = "";
         textBoxPret.Text     = "";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 6
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     numeMan    = textBoxNume.Text;
     prenumeMan = textBoxPrenume.Text;
     codfctMan  = Convert.ToInt16(comboBoxFunctia.SelectedValue.ToString());
     tarifMan   = Convert.ToInt16(textBoxTarif.Text);
     try
     {
         if (numeMan == "" || prenumeMan == "")
         {
             throw new Exception("Date incomplete.Repetati!");
         }
         Adaugare_DB.inregistrariManopera(numeMan, prenumeMan, Convert.ToInt16(codfctMan), tarifMan);
         MessageBox.Show("Angajat nou adăugat!");
         textBoxNume.Text    = "";
         textBoxPrenume.Text = "";
         textBoxTarif.Text   = "";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 7
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     denFurn  = textBoxDenumire.Text;
     adrFurn  = textBoxAdresa.Text;
     telFurn  = textBoxTel.Text;
     mailFurn = textBoxMail.Text;
     try
     {
         if (denFurn == "" || adrFurn == "" || telFurn == "" || mailFurn == "")
         {
             throw new Exception("Date incomplete. Repetati!");
         }
         Adaugare_DB.inregistrariFurnizori(denFurn, adrFurn, telFurn, mailFurn);
         MessageBox.Show("Furnizor nou adaugat");
         textBoxDenumire.Text = "";
         textBoxAdresa.Text   = "";
         textBoxTel.Text      = "";
         textBoxMail.Text     = "";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }