示例#1
0
        private void Modifier_Click(object sender, RoutedEventArgs e)
        {
            string sexe;

            if (Sexe.SelectedItem == homme)
            {
                sexe = "Homme";
            }
            else
            {
                sexe = "Femme";
            }

            //int id = Convert.ToInt32(ID.Text);
            string   nom     = Nom.Text;
            string   prenom  = Prenom.Text;
            DateTime date    = Convert.ToDateTime(Date_naiss.Text);
            string   mail    = Mail.Text;
            string   pays    = Pays.Text;
            string   adresse = Adresse.Text;

            ClientDAL mod = new ClientDAL();

            mod.Modification(idClient, nom, prenom, sexe, date, mail, pays, adresse);

            GestionClients page = new GestionClients();

            NavigationService.Navigate(page);
        }
        private void SupprClient_Click(object sender, RoutedEventArgs e)
        {
            Client RecupClient = clientGrid.SelectedItem as Client;

            int idClient = RecupClient.Id;

            ClientDAL sup = new ClientDAL();

            sup.Suppression(idClient);

            GestionClients gest = new GestionClients();

            NavigationService.Navigate(gest);
        }
示例#3
0
        private void Ajouter_Click(object sender, RoutedEventArgs e)
        {
            string   nom     = Nom.Text;
            string   prenom  = Prenom.Text;
            DateTime date    = DateTime.Parse(Date_naiss.Text);
            string   pays    = Pays.Text;
            string   adresse = Adresse.Text;
            string   mail    = Mail.Text;

            ClientDAL ajo = new ClientDAL();

            ajo.Ajout(nom, prenom, boxContent, date, pays, adresse, mail);

            GestionClients page = new GestionClients();

            NavigationService.Navigate(page);
        }