Beispiel #1
0
        /// <summary>
        /// Charger les informations sur le client sélectionné dans la liste déroulante
        /// </summary>
        private void ActualiserListe()
        {
            Clientel monclient = new Clientel();
            int index = cb_listecli.SelectedIndex;
            if (index != -1)
            {
                monclient.RechercheUnClient(cb_listecli.Items[index].ToString());

                lbl_nom.Text = monclient.NomCl;
                lbl_prenom.Text = monclient.PrenomCl;
                lbl_scte.Text = monclient.Societe;
                lbl_adresse.Text = monclient.AdresseCl;
                lbl_ville.Text = monclient.VilleCl;
                lbl_cp.Text = monclient.CodePostCl;

                lbl_noclient.Text = "Client n°" + cb_listecli.Items[index].ToString();
            }
            else
            {
                lbl_nom.Text = "";
                lbl_prenom.Text = "";
                lbl_scte.Text = "";
                lbl_adresse.Text = "";
                lbl_ville.Text = "";
                lbl_cp.Text = "";

                lbl_noclient.Text = "Veuillez choisir un client";
            }
        }
Beispiel #2
0
        /// <summary>
        /// Initialisation
        /// </summary>
        public Fclient()
        {
            InitializeComponent();

            lbl_nom.Text = "";
            lbl_prenom.Text = "";
            lbl_scte.Text = "";
            lbl_adresse.Text = "";
            lbl_ville.Text = "";
            lbl_cp.Text = "";
            btn_details.Visible = false;

            List<String> mesNumeros;
            try
            {
                Clientel unClient = new Clientel();
                mesNumeros = unClient.LectureNoClient();
                foreach (String item in mesNumeros)
                {
                    cb_listecli.Items.Add(item);
                }

            }
            catch (MonException exception)
            {
                MessageBox.Show(exception.MessageApplication(), exception.Message);
            }

        }
        /// <summary>
        /// Charger les données pour les listes déroulantes de clients et vendeurs
        /// </summary>
        private void ChargerDonnees()
        {
            List<String> mesNumeros;
            try
            {
                Clientel unClient = new Clientel();
                mesNumeros = unClient.LectureNoClient();
                foreach (String item in mesNumeros)
                {
                    cb_noclient.Items.Add(item);
                }

                Vendeur unVendeur = new Vendeur();
                mesNumeros = unVendeur.LectureNoVendeur();
                foreach (String item in mesNumeros)
                {
                    cb_novendeur.Items.Add(item);
                }

            }
            catch (MonException exception)
            {
                MessageBox.Show(exception.MessageApplication(), exception.Message);
            }
        }
        public List <Commande> getLesCommandes(String tris, String ordres)
        {
            DataTable dt;
            String    mysql = "SELECT NO_COMMAND, NO_VENDEUR, NO_CLIENT, DATE_CDE, FACTURE " +
                              "FROM COMMANDES " + "ORDER BY " + tris + " " + ordres;
            sErreurs er = new sErreurs("Erreur sur lecture des commandes", "Commande.getLesCommandes()");

            try
            {
                dt = DbInterface.Lecture(mysql, er);
                List <Commande> mesCdes = new List <Commande>();
                foreach (DataRow dataRow in dt.Rows)
                {
                    Vendeur unvd = new Vendeur();
                    unvd.NoVendeur = dataRow[1].ToString();
                    Clientel uncli = new Clientel();
                    uncli.NoCl = dataRow[2].ToString();
                    Commande unecde = new Commande(dataRow[0].ToString(),
                                                   ((DateTime)dataRow[3]),
                                                   dataRow[4].ToString(),
                                                   unvd,
                                                   uncli);
                    mesCdes.Add(unecde);
                }
                return(mesCdes);
            }
            catch (MonException erreur)
            {
                throw erreur;
            }
        }
 /// <summary>
 /// Initialisation avec les paramètres
 /// </summary>
 public Commande(String noC, DateTime dateC, String factC, Vendeur ven, Clientel cli)
 {
     noCommande = noC;
     dateCommande = dateC;
     facture = factC;
     vendeur = ven;
     client = cli;
 }
 /// <summary>
 /// Initialisation
 /// </summary>
 public Commande()
 {
     noCommande = "";
     facture = "";
     vendeur = new Vendeur();
     client = new Clientel();
     dateCommande = DateTime.Today;
 }
 /// <summary>
 /// Initialisation avec les paramètres
 /// </summary>
 public Commande(String noC, DateTime dateC, String factC, Vendeur ven, Clientel cli)
 {
     noCommande   = noC;
     dateCommande = dateC;
     facture      = factC;
     vendeur      = ven;
     client       = cli;
 }
 /// <summary>
 /// Initialisation
 /// </summary>
 public Commande()
 {
     noCommande   = "";
     facture      = "";
     vendeur      = new Vendeur();
     client       = new Clientel();
     dateCommande = DateTime.Today;
 }
 public List<Commande> getLesCommandes(String tri, String ordre)
 {
     DataTable dt;
     String mysql = "SELECT NO_COMMAND, NO_VENDEUR, NO_CLIENT, DATE_CDE, FACTURE ";
     mysql += "FROM COMMANDES ";
     mysql += "ORDER BY " + tri + " " + ordre;
     sErreurs er = new sErreurs("Erreur sur lecture des commandes", "Commande.getLesCommandes()");
     try
     {
         dt = DbInterface.Lecture(mysql, er);
         List<Commande> mesCdes = new List<Commande>();
         foreach (DataRow dataRow in dt.Rows)
         {
             Vendeur unvd = new Vendeur();
             unvd.NoVendeur = dataRow[1].ToString();
             Clientel uncli = new Clientel();
             uncli.NoCl = dataRow[2].ToString();
             Commande unecde = new Commande(dataRow[0].ToString(),
                                             ((DateTime)dataRow[3]),
                                            dataRow[4].ToString(), unvd, uncli);
             mesCdes.Add(unecde);
         }
         return mesCdes;
     }
     catch (MonException erreur)
     {
         throw erreur;
     }
 }