예제 #1
0
        //........................................................................................................
        private void button_Lancer_Recherche_Par_Click(object sender, EventArgs e)//Button Lancer Recherche Par
        {
            if (radioButton_Par_Nom.Checked == true)
            {
                Adherents a = new Adherents();
                a.Recherche_par_nom(textBox_Recherhe_Avancée_Nom_Adrérent.Text);
                //a.Recherche_par_Prefixe_Nom(textBox_Recherhe_Avancée_Nom_Adrérent.Text);
                dataGridView_Liste_Adhérent.DataSource = listeAdhrents.Recherche_par_nom(textBox_Recherhe_Avancée_Nom_Adrérent.Text);
            }
            if (radioButton_Par_Num.Checked == true)
            {
                Adherents a = new Adherents();
                //   a.Recherche_par_num(textBox_Recherhe_Avancée_Nom_Adrérent.Text);
                //    dataGridView_Liste_Adhérent.DataSource = listeAdhrents.Recherche_par_num(textBox_Recherhe_Avancée_Nom_Adrérent.Text);
            }

            // dataGridView_Liste_Adhérent.DataSource = ListRetourPrêt.Recherche_par_num(textBox_Recherhe_Avancée_Nom_Adrérent.Text);
            MessageBox.Show("Recherche en cours veuillez patienter");
        }
예제 #2
0
        private void btn_rechercher_Click(object sender, EventArgs e)
        {
            // On charge la liste des adherents
            ListAdh = new Adherents();
            datagridview_adherents.DataSource = null; // On on est déjà passé ==> annuler l'association du DATAGRID

            //if (rdbtn_tous_les_adh.Checked)
            //{
            //    datagridview_adherents.DataSource = ListAdh;
            //}
            try
            {
                while (txtbox_rechercher.Text.Length < 3)
                {
                    if (rdbtn_par_num_adh.Checked)
                    {
                        datagridview_adherents.Visible    = true;
                        datagridview_adherents.Enabled    = true;
                        datagridview_adherents.DataSource = ListAdh.Recherche_par_num(Convert.ToInt32(txtbox_rechercher.Text));
                    }
                    else
                    {
                        if (rdbtn_par_nom.Checked)
                        {
                            datagridview_adherents.Visible    = true;
                            datagridview_adherents.Enabled    = true;
                            datagridview_adherents.DataSource = ListAdh.Recherche_par_nom(txtbox_rechercher.Text);
                        }
                        else
                        {
                            MessageBox.Show("INSERER UN VALEUR");
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #3
0
        //....................................................................................
        private void Frm_Retour_pret_Load(object sender, EventArgs e)//Démarrage fromulaire
        {
            listeAdhrents = new Adherents();
            listeAdhrents.init();
            // Initialisation de le list Emprunt
            ListRetourPrêt = new Emprunts();
            ListRetourPrêt.init();// Chargement de la list Emprunt


            comboBox_Code_Exemplaire.DataSource    = ListRetourPrêt;
            comboBox_Code_Exemplaire.DisplayMember = "Code Exemplaire";
            comboBox_Code_Exemplaire.ValueMember   = "NumExemplaire";
            comboBox_Code_Exemplaire.Text          = "Code Exemplaire";

            //dateTimePicker_Date_Prêt = ListRetourPrêt;



            button_Lancer_Recherche_Par.Enabled = false;

            comboBox_Code_Exemplaire.Focus();
        }
예제 #4
0
 private void Frm_Gerer_les_adherents_Load(object sender, EventArgs e)
 {
     ListAdh = new Adherents();
     ListAdh.init();
 }
예제 #5
0
        private void btn_enregistrer_Click(object sender, EventArgs e)
        {
            //    tabAdherent.Ajoute(txtbox_numadherent.Text, txtbox_nom.Text, txtbox_prenom.Text, Convert.ToInt32(numerUpD_numderue.Text), txtbox_adresse.Text, Convert.ToInt32(txtbox_codepostal.Text), txtbox_ville.Text, txtbox_telephone.Text, txtbox_adr_mail.Text, DTPicker_perime_le.Value, txtbox_motdepasse.Text);

            /* Si le bouton Nouveau à été cliqué */
            if (choix == 1)
            {
                try
                {
                    if (txtbox_numadherent.Text.Length < 3 || txtbox_nom.Text.Length < 3 ||
                        txtbox_prenom.Text.Length < 3 || numerUpD_numderue.Text.Length < 1 ||
                        txtbox_adresse.Text.Length < 3 || txtbox_codepostal.Text.Length < 2 ||
                        txtbox_ville.Text.Length < 2 || txtbox_telephone.Text.Length < 10 ||
                        txtbox_adr_mail.Text.Length < 6 || txtbox_motdepasse.Text.Length < 3)
                    {
                        MessageBox.Show("ACTION NON EFFECTUER !\nUn ou plusieurs sont ne sont pas correctement remplir ou vide.");
                        return;
                    }
                    else
                    {
                        Adherent a = new Adherent
                        {
                            NumeroAdherent = txtbox_numadherent.Text,
                            Nom            = txtbox_nom.Text,
                            Prenom         = txtbox_prenom.Text,
                            NumeroDeRue    = Convert.ToInt32(numerUpD_numderue.Text),
                            NomDeRue       = txtbox_adresse.Text,
                            CodePostal     = Convert.ToInt32(txtbox_codepostal.Text),
                            Ville          = txtbox_ville.Text,
                            Telephone      = txtbox_telephone.Text,
                            Mail           = txtbox_adr_mail.Text,
                            PerimeLe       = DTPicker_perime_le.Value,
                            Password       = txtbox_motdepasse.Text
                        };
                        Adherents Adh = new Adherents();
                        Adh.Add(a);
                        MessageBox.Show("ADHERENT AJOUTER !");
                        return;
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("ERREUR !");
                }
            }

            /* Si le bouton Modifier à été cliqué */
            if (choix == 2)
            {
                try
                {
                    if (txtbox_numadherent.Text.Length < 3 || txtbox_nom.Text.Length < 3 ||
                        txtbox_prenom.Text.Length < 3 || numerUpD_numderue.Text.Length < 1 ||
                        txtbox_adresse.Text.Length < 3 || txtbox_codepostal.Text.Length < 2 ||
                        txtbox_ville.Text.Length < 2 || txtbox_telephone.Text.Length < 10 ||
                        txtbox_adr_mail.Text.Length < 6 || txtbox_motdepasse.Text.Length < 3)
                    {
                        MessageBox.Show("ACTION NON EFFECTUER !\nUn ou plusieurs sont ne sont pas correctement remplir ou vide.");
                        return;
                    }
                    else
                    {
                        Adherent a = new Adherent
                        {
                            NumeroAdherent = txtbox_numadherent.Text,
                            Nom            = txtbox_nom.Text,
                            Prenom         = txtbox_prenom.Text,
                            NumeroDeRue    = Convert.ToInt32(numerUpD_numderue.Text),
                            NomDeRue       = txtbox_adresse.Text,
                            CodePostal     = Convert.ToInt32(txtbox_codepostal.Text),
                            Ville          = txtbox_ville.Text,
                            Telephone      = txtbox_telephone.Text,
                            Mail           = txtbox_adr_mail.Text,
                            PerimeLe       = DTPicker_perime_le.Value,
                            Password       = txtbox_motdepasse.Text
                        };
                        Adherents Adh = new Adherents();
                        Adh.Add(a);
                        MessageBox.Show("ADHERENT MODIFIER !");
                        return;
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("ERREUR !");
                }
            }

            /* Si le bouton Supprimer à été cliqué */
            if (choix == 3)
            {
                try
                {
                    Adherent  a   = new Adherent();
                    Adherents Adh = new Adherents();
                    Adh.Remove(a);
                    MessageBox.Show("ADHERENT SUPPRIMER !");
                    return;
                }
                catch (Exception)
                {
                    MessageBox.Show("ERREUR !");
                }
            }
        }
예제 #6
0
        // User Logged In Successfully Changes the hole interface according to user role
        public void OnUserLoggedIn(object sender, LoginEventArgs e) // I must add admin / client default form event handeler subscription when implemented
        {
            // Disable Logins
            SignInBtn.Enabled   = false;
            SignInBtn.Visible   = false;
            SignUpBtn.IconChar  = IconChar.SignOutAlt;
            SignUpBtn.Text      = "Sign Out";
            SignUpBtn.IconColor = RGBColors.color6;

            // Show the logged in panel
            LoggedPannel.Visible = true;
            LoggedLabel.Text     = "Welcome " + e.User.Email + " !";

            // Set user Informations to this login
            currentUser = e.User;

            // Close current child forms
            if (currentChildForm != null)
            {
                currentChildForm.Close();
            }
            if (currentMenuForm != null)
            {
                currentMenuForm.Close();
            }
            if (currentSignForm != null)
            {
                currentSignForm.Close();
            }

            // Disable loggin panel
            SignPanel.Enabled = false;
            SignPanel.Visible = false;
            SignPanel.Dispose();

            // check for user role and open corresponding child forms
            if (e.User.Role == User.Admin)
            {
                // set color for header
                CurrentChildFormIcon.IconColor  = RGBColors.color2;
                CurrentChildFormTitle.ForeColor = RGBColors.color2;

                // Open admin forms
                AdminMenu adminMenu = new AdminMenu();
                adminMenu.SelectedMenu += OnSelectedMenu;
                // Here add other event handler subscription if needed in the future
                OpenMenuForm(adminMenu);

                Adherents adherents = new Adherents();

                /*
                 * Here Add your event handelers when implemented
                 */
                OpenChildForm(adherents);
            }

            else if (e.User.Role == User.NonPayedClient || e.User.Role == User.NonRegisteredClient)
            {
                // Create Unregistered Forms
                UnsubscribedClientMenu unsubscribedClientMenu = new UnsubscribedClientMenu(currentUser);
                unsubscribedClientMenu.SelectedMenu += OnSelectedMenu;
                OpenMenuForm(unsubscribedClientMenu);
            }

            else if (e.User.Role == User.Client)
            {
                // Open client forms
                ClientMenu clientMenu = new ClientMenu();
                clientMenu.SelectedMenu += OnSelectedMenu;
                // Here add other event handler subscription if needed in the future
                OpenMenuForm(clientMenu);

                UpdateCurrentUser();
                Profile profile = new Profile(currentUser);

                /*
                 * Here Add your event handelers when implemented
                 */
                OpenChildForm(profile);
            }
        }
예제 #7
0
        //........................................................................................
        private void Frm_Gerer_les_prets_Load(object sender, EventArgs e)//Démarrage fromulaire
        {
            ListEmprunts = new Emprunts();
            ListEmprunts.init();

            //.................
            //ListExemplaire...
            //.................

            ListExemplaires = new Exemplaires();
            ListExemplaires.init();

            ListAdherents = new Adherents();
            ListAdherents.init();

            //...........................
            //comboBox_Code_Exemplaire...
            //...........................

            comboBox_Code_Exemplaire.DataSource = ListExemplaires;

            comboBox_Code_Exemplaire.DisplayMember = "Numéro Exemplaire";
            comboBox_Code_Exemplaire.ValueMember   = "NumeroExemplaire";
            comboBox_Code_Exemplaire.Text          = "Code exemplaire";

            //............................................
            //ComboBox Recherhe Avancée Code Exemplaire...
            //............................................
            comboBox_Recherhe_Avancée_Code_Exemplaire.DataSource = ListExemplaires;

            comboBox_Recherhe_Avancée_Code_Exemplaire.DisplayMember = "Numéro Exemplaire";
            comboBox_Recherhe_Avancée_Code_Exemplaire.ValueMember   = "NumeroExemplaire";
            comboBox_Recherhe_Avancée_Code_Exemplaire.Text          = "Code exemplaire";



            //.................
            //ListeAdherents...
            //.................



            //........................
            //comboBox_Num_Adhérent...
            //........................

            comboBox_Num_Adhérent.DataSource = ListAdherents;

            comboBox_Num_Adhérent.DisplayMember = "Num";
            comboBox_Num_Adhérent.ValueMember   = "NumeroAdherent";
            comboBox_Num_Adhérent.Text          = "Num";

            //........................
            //comboBox_Nom_Adhérent...
            //........................

            comboBox_Nom_Adhérent.DataSource = ListAdherents;

            comboBox_Nom_Adhérent.DisplayMember = "nom";
            comboBox_Nom_Adhérent.ValueMember   = "Nom";
            comboBox_Nom_Adhérent.Text          = "Nom";
        }