예제 #1
0
 private void CreazaFirma_Click(object sender, RoutedEventArgs e)
 {
     if (flag == true)
     {
         UpdateDateFirma();
         this.Close();
     }
     else
     {
         if (NumeFirma.Text != "" && AdresaFirma.Text != "" && Oras.Text != "" && Judet.Text != "" && CodPostal.Text != "" && Tara.Text != "" && RegComert.Text != "" && Nume.Text != "" && Functie.Text != "" && Telefon.Text != "" && Fax.Text != "" && Email.Text != "")
         {
             Firma.CodFiscal = Cif.Text;
             Firma.NumeFirma = NumeFirma.Text;
             if (File.Exists(FileLocation.DataBase + Firma.CodFiscal + ".mdb"))
             {
                 MessageBox.Show("Exista deja o baza de date pentru aceasta firma!");
             }
             else
             {
                 if (File.Exists(FileLocation.DataBase + "Goala.mdb"))
                 {
                     File.Copy(FileLocation.DataBase + "Goala.mdb", FileLocation.DataBase + Firma.CodFiscal + ".mdb");
                     if (File.Exists(FileLocation.DataBase + Firma.CodFiscal + ".mdb"))
                     {
                         AdaugaFirma();
                         Frm_Setari_Implicite frm_Setari_Implicite = new Frm_Setari_Implicite(false);
                         frm_Setari_Implicite.Show();
                         this.Hide();
                     }
                     else
                     {
                         MessageBox.Show("Firma nu poate fi creata! Verificati drepturile de aministrator.");
                     }
                 }
                 else
                 {
                     MessageBox.Show("Goala.mdb nu exista!");;
                 }
             }
         }
         else
         {
             MessageBox.Show("Completati toate campurile pentru a crea o firma noua");
         }
     }
 }
예제 #2
0
 private void Ok_Btn_Click(object sender, RoutedEventArgs e)
 {
     if (ComboBoxSelectFirma.SelectedValue != null)
     {
         string[] aux = ComboBoxSelectFirma.SelectedItem.ToString().Split(' ');
         for (int i = 0; i < v.Length / 2; i++)
         {
             if (v[i, 0] != null)
             {
                 if (aux[aux.Length - 1] == v[i, 0])
                 {
                     Firma.CodFiscal = v[i, 0].ToString();
                     Firma.NumeFirma = v[i, 1].ToString();
                 }
             }
         }
         CONSTANTE.Meniu.LabelFirma.Content = "Firma: " + Firma.NumeFirma;
         CONSTANTE.Meniu.LabelFirma.Width  += Firma.NumeFirma.Length * 6;
         CONSTANTE.Meniu.Show();
         Frm_Setari_Implicite frm_Setari_Implicite = new Frm_Setari_Implicite(true);
         this.Hide();
     }
 }
예제 #3
0
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            Frm_Setari_Implicite frmSetImplicite = new Frm_Setari_Implicite(true);

            frmSetImplicite.Show();
        }