Exemplo n.º 1
0
        private void BAConfirmerArticlere_Click(object sender, RoutedEventArgs e)
        {
            if (TBSymbolere.Text.Equals(""))
            {
                MessageBox.Show("Vous devez saisir le symbole d'article", "Erreur", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                if (Requettes.IdExiste(TBSymbolere.Text) == 0)
                {
                    MessageBox.Show("Vous devez saisir un symbole valide", "Erreur", MessageBoxButton.OK, MessageBoxImage.Error);
                }
                else
                {
                    if (TBSymbolere.Text.Equals("") || TBDescre.Text.Equals("") || TBBesoinre.Text.Equals("") || TBStockre.Text.Equals("") || TBNouvelleQuantiterre.Text.Equals("") || TBUsagere.Text.Equals(""))
                    {
                        MessageBox.Show("Champ(s) vide(s)", "Erreur", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                    else
                    {
                        if (float.Parse(TBNouvelleQuantiterre.Text) > float.Parse(TBStockre.Text))
                        {
                            MessageBox.Show("Stock insuffisant", "Erreur", MessageBoxButton.OK, MessageBoxImage.Error);
                        }
                        else
                        {
                            if (Requettes.ModifierArticle(Int16.Parse(TBSymbolere.Text), TBDescre.Text, Int16.Parse(TBBesoinre.Text), float.Parse(TBStockre.Text) - float.Parse(TBNouvelleQuantiterre.Text), float.Parse(TBRatiore.Text), float.Parse(TBSAre.Text), float.Parse(TBSMdhillare.Text), float.Parse(TBSSkhirare.Text), TBDesignationre.Text, TBFormatre.Text, TBEpisseurre.Text) == 0)
                            {
                                MessageBox.Show("Cet article a été modifier avec succèes", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Asterisk);
                                DateTime localDate = DateTime.Now;
                                int      anne      = localDate.Year;
                                int      moi       = localDate.Month;
                                int      jour      = localDate.Day;
                                Requettes.AjouterJournalArticle(idGeneral, Int16.Parse(TBSymbolere.Text), anne + "", moi + "", jour + "", "retirer", (float.Parse(TBStockre.Text) - float.Parse(TBNouvelleQuantiterre.Text)) + "");

                                try
                                {
                                    DateTime    thisDate = DateTime.Now;
                                    CultureInfo culture  = new CultureInfo("fr-FR");
                                    Requettes.AjouterJournal(idGeneral, "Modifier l'article : " + TBSymbolere.Text + " : " + thisDate.ToString());
                                }
                                catch (Exception ex)
                                {
                                }
                                TBSymbolere.Background = Brushes.White;
                                viderChampsArtilere();
                                importerArticle();
                                importerJournalArticle();
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
 private void BASupprimerAdminS_Click(object sender, RoutedEventArgs e)
 {
     if (TBIdAdminS.Text.Equals(""))
     {
         MessageBox.Show("Vous devez saisir l'identifiant d'un personel", "Erreur", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     else
     {
         if (Requettes.IdExiste(TBIdAdminS.Text) == 0)
         {
             MessageBox.Show("Vous devez saisir un identifiant valide", "Erreur", MessageBoxButton.OK, MessageBoxImage.Error);
         }
         else
         {
             if (TBNomAdminS.Text.Equals("") || TBLoginAdminS.Text.Equals("") || TBMdpAdminS.Password.Equals(""))
             {
                 MessageBox.Show("Champ(s) vide(s)", "Erreur", MessageBoxButton.OK, MessageBoxImage.Error);
             }
             else
             {
                 if (Requettes.SupprimerPersonel(Int16.Parse(TBIdAdminS.Text)) == 0)
                 {
                     MessageBox.Show("Ce personel a été Supprimer avec succèes", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Asterisk);
                     try
                     {
                         DateTime    thisDate = DateTime.Now;
                         CultureInfo culture  = new CultureInfo("fr-FR");
                         Requettes.AjouterJournal(idGeneral, "Supprimer un  personel : " + TBLoginAdminS.Text + " : " + thisDate.ToString());
                     }
                     catch (Exception ex)
                     {
                     }
                     TBIdAdminS.Background    = Brushes.White;
                     TBIdAdminS.Text          = "";
                     TBNomAdminS.Text         = "";
                     TBLoginAdminS.Text       = "";
                     TBMdpAdminS.Password     = "";
                     TBAfficherMdpAdminS.Text = "";
                     importerPersonel();
                 }
             }
         }
     }
     importerPersonel();
 }
Exemplo n.º 3
0
 private void TBIdAdminS_TextChanged(object sender, TextChangedEventArgs e)
 {
     TBIdAdminS.Text = saisieFloat(sender);
     if (!TBIdAdminS.Text.Equals(""))
     {
         TBNomAdminS.Text     = Requettes.GetNomFromIdAdmin(TBIdAdminS.Text);
         TBLoginAdminS.Text   = Requettes.GetLoginFromIdAdmin(TBIdAdminS.Text);
         TBMdpAdminS.Password = Requettes.GetMdpFromIdAdmin(TBIdAdminS.Text);
         String role = Requettes.GetRoleFromIdAdmin(TBIdAdminS.Text);
         if (role.Equals("Administrateur"))
         {
             CBRoleAdminS.SelectedIndex = 0;
         }
         if (role.Equals("Gestionnaire"))
         {
             CBRoleAdminS.SelectedIndex = 1;
         }
         if (role.Equals("Utilisateur"))
         {
             CBRoleAdminS.SelectedIndex = 2;
         }
     }
     if (TBIdAdminS.Text.Equals(""))
     {
         TBIdAdminS.Background    = Brushes.White;
         TBIdAdminS.Text          = "";
         TBNomAdminS.Text         = "";
         TBLoginAdminS.Text       = "";
         TBMdpAdminS.Password     = "";
         TBAfficherMdpAdminS.Text = "";
     }
     else
     {
         if (Requettes.IdExiste(TBIdAdminS.Text) == 0)
         {
             TBIdAdminS.Background = Brushes.Bisque;
         }
         else
         {
             TBIdAdminS.Background = Brushes.GreenYellow;
         }
     }
 }