private void btn_prec_Click(object sender, RoutedEventArgs e)
        {
            CURS   cs3      = new CURS(_chaineConnexion);
            string requete3 = "SELECT MIN(PRA_NUM) as MIN FROM praticien ;";

            cs3.ReqSelect(requete3);

            if (tbx_Num.Text == cs3.champ("MIN").ToString())
            {
                CURS   cs4      = new CURS(_chaineConnexion);
                string requete4 = "SELECT MAX(PRA_NUM) as MAX FROM praticien ;";
                cs4.ReqSelect(requete4);
                tbx_Num.Text = cs4.champ("MAX").ToString();
                cs4.fermer();
                UserControl_Loaded(sender, e);
            }
            else
            {
                int num = Convert.ToInt32(tbx_Num.Text);
                num--;
                tbx_Num.Text = num.ToString();
                UserControl_Loaded(sender, e);
            }
            cs3.fermer();
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            CURS   cs      = new CURS(_chaineConnexion);
            string requete = "SELECT * FROM praticien WHERE PRA_NUM =" + tbx_Num.Text + ";";

            cs.ReqSelect(requete);

            tbx_Prenom.Text  = cs.champ("PRA_PRENOM").ToString();
            tbx_Nom.Text     = cs.champ("PRA_NOM").ToString();
            tbx_Adresse.Text = cs.champ("PRA_ADRESSE").ToString();
            tbx_CP.Text      = cs.champ("PRA_CP").ToString();
            tbx_Noto.Text    = cs.champ("PRA_COEFNOTORIETE").ToString();
            tbx_Ville.Text   = cs.champ("PRA_VILLE").ToString();
            string code = cs.champ("TYP_CODE").ToString();

            cs.fermer();

            CURS   cs1      = new CURS(_chaineConnexion);
            string requete1 = "SELECT TYP_LIEU FROM type_praticien WHERE TYP_CODE ='" + code + "';";

            cs1.ReqSelect(requete1);

            tbx_lieu.Text = cs1.champ("TYP_LIEU").ToString();
            cs1.fermer();
        }
示例#3
0
 private void comboBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (comboBox1.SelectedItem.ToString() != "")
     {
         CURS   cs2      = new CURS(_chaineConnexion);
         string requete2 = "SELECT PRA_NUM FROM praticien WHERE PRA_NOM= '" + comboBox1.SelectedItem.ToString() + "';";
         cs2.ReqSelect(requete2);
         while (!cs2.Fin())
         {
             tbx_test.Text = cs2.champ("PRA_NUM").ToString();
             cs2.suivant();
         }
         cs2.fermer();
     }
 }
        public UserControlMedicaments(string chaineConnexion)
        {
            InitializeComponent();
            this._chaineConnexion = chaineConnexion;
            tbx_num.Text          = "3MYC7";
            CURS   cs1      = new CURS(chaineConnexion);
            string requete1 = "SELECT MED_DEPOTLEGAL FROM medicament;";

            cs1.ReqSelect(requete1);
            while (!cs1.Fin())
            {
                _list.Add(cs1.champ("MED_DEPOTLEGAL").ToString());
                cs1.suivant();
            }
            cs1.fermer();
        }
示例#5
0
        public UserControlVisiteurs(string chaineConnexion)
        {
            InitializeComponent();
            this._chaineConnexion = chaineConnexion;
            tbx_num.Text          = "a131";
            CURS   cs1      = new CURS(chaineConnexion);
            string requete1 = "SELECT collaborateur.COL_MATRICULE FROM collaborateur INNER JOIN visiteur ON visiteur.COL_MATRICULE = collaborateur.COL_MATRICULE ORDER BY visiteur.COL_MATRICULE;";

            cs1.ReqSelect(requete1);
            while (!cs1.Fin())
            {
                _list.Add(cs1.champ("COL_MATRICULE").ToString());
                cs1.suivant();
            }
            cs1.fermer();
        }
示例#6
0
        public Echantillons(string chaineConnexion, int rapportNum)
        {
            InitializeComponent();
            this._chaineConnexion = chaineConnexion;
            this._rapNum          = rapportNum;

            CURS   cs2      = new CURS(chaineConnexion);
            string requete2 = "SELECT MED_NOMCOMMERCIAL FROM medicament;";

            cs2.ReqSelect(requete2);
            while (!cs2.Fin())
            {
                cbx_nom.Items.Add(cs2.champ("MED_NOMCOMMERCIAL").ToString());
                cs2.suivant();
            }
            cs2.fermer();
        }
示例#7
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            CURS   cs      = new CURS(_chaineConnexion);
            string requete = "SELECT PRA_NOM, PRA_PRENOM, PRA_NUM FROM praticien; ";

            cs.ReqSelect(requete);

            while (!cs.Fin())
            {
                comboBox1.Items.Add(cs.champ("PRA_NOM").ToString());
                //comboBox1.Items.Add(cs.champ("PRA_NOM").ToString() + " " + cs.champ("PRA_PRENOM").ToString());
                cs.suivant();
            }
            cs.fermer();

            CURS   cs1 = new CURS(_chaineConnexion);
            string numRapp;

            string requete1 = "SELECT MAX(RAP_NUM)+1 as MAX FROM rapport_visite; ";

            cs1.ReqSelect(requete1);

            while (!cs1.Fin())
            {
                numRapp           = cs1.champ("MAX").ToString();
                tbx_NRapport.Text = numRapp;
                cs1.suivant();
            }
            cs1.fermer();

            CURS   cs2      = new CURS(_chaineConnexion);
            string requete2 = "SELECT MOTIF_LIBELLE FROM motif; ";

            cs2.ReqSelect(requete2);

            while (!cs2.Fin())
            {
                cbx_motif.Items.Add(cs2.champ("MOTIF_LIBELLE").ToString());
                cs2.suivant();
            }
            cs2.fermer();

            comboBox1.SelectedIndex = 0;
            cbx_motif.SelectedIndex = 0;
        }
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            CURS   cs2      = new CURS(_chaineConnexion);
            string requete2 = "SELECT * FROM medicament ";

            requete2 += "INNER JOIN famille ON medicament.FAM_CODE = famille.FAM_CODE ";
            requete2 += "WHERE medicament.MED_DEPOTLEGAL ='" + tbx_num.Text + "' ;";
            cs2.ReqSelect(requete2);

            tbx_Nom.Text   = cs2.champ("MED_NOMCOMMERCIAL").ToString();
            tbx_fam.Text   = cs2.champ("FAM_CODE").ToString();
            tbx_compo.Text = cs2.champ("MED_COMPOSITION").ToString();
            tbx_effet.Text = cs2.champ("MED_EFFETS").ToString();
            tbx_indic.Text = cs2.champ("MED_CONTREINDIC").ToString();
            tbx_prix.Text  = cs2.champ("MED_PRIXECHANTILLON").ToString();
            tbx_num.Text   = cs2.champ("MED_DEPOTLEGAL").ToString();
            cs2.fermer();
        }
示例#9
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            CURS   cs2      = new CURS(_chaineConnexion);
            string requete2 = "SELECT * FROM collaborateur INNER JOIN visiteur ON visiteur.COL_MATRICULE = collaborateur.COL_MATRICULE ";

            requete2 += "INNER JOIN labo ON collaborateur.LAB_CODE = labo.LAB_CODE ";
            requete2 += "LEFT JOIN secteur ON collaborateur.SEC_CODE = secteur.SEC_CODE ";
            requete2 += "WHERE collaborateur.COL_MATRICULE ='" + tbx_num.Text + "' ;";
            cs2.ReqSelect(requete2);

            tbx_Nom.Text     = cs2.champ("COL_NOM").ToString();
            tbx_Prenom.Text  = cs2.champ("COL_PRENOM").ToString();
            tbx_Adresse.Text = cs2.champ("COL_ADRESSE").ToString();
            tbx_CP.Text      = cs2.champ("COL_CP").ToString();
            tbx_secteur.Text = cs2.champ("SEC_LIBELLE").ToString();
            tbx_Ville.Text   = cs2.champ("COL_VILLE").ToString();
            tbx_labo.Text    = cs2.champ("LAB_CHEFVENTE").ToString();
            tbx_num.Text     = cs2.champ("COL_MATRICULE").ToString();
            cs2.fermer();
        }
        private void btn_suiv_Click(object sender, RoutedEventArgs e)
        {
            CURS   cs2      = new CURS(_chaineConnexion);
            string requete2 = "SELECT MAX(PRA_NUM) as MAX FROM praticien ;";

            cs2.ReqSelect(requete2);

            if (tbx_Num.Text == cs2.champ("MAX").ToString())
            {
                tbx_Num.Text = "1";
                UserControl_Loaded(sender, e);
            }
            else
            {
                int num = Convert.ToInt32(tbx_Num.Text);
                num++;
                tbx_Num.Text = num.ToString();
                UserControl_Loaded(sender, e);
            }
            cs2.fermer();
        }
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            CURS   cs2      = new CURS(_chaineConnexion);
            string requete2 = "SELECT * FROM rapport_visite INNER JOIN praticien ON rapport_visite.PRA_NUM = praticien.PRA_NUM ";

            requete2 += "LEFT JOIN motiver ON rapport_visite.RAP_NUM = motiver.RAP_NUM ";
            requete2 += "LEFT JOIN motif ON motif.MOTIF_CODE = motiver.MOTIF_CODE ";
            requete2 += "WHERE rapport_visite.RAP_NUM = " + tbx_NRapport.Text + ";";
            cs2.ReqSelect(requete2);

            tbx_praticien.Text = cs2.champ("PRA_NOM").ToString();
            tbx_date.Text      = cs2.champ("RAP_DATE").ToString();
            tbx_motif.Text     = cs2.champ("MOTIF_LIBELLE").ToString();

            TextRange textrange = new TextRange(
                rtbx_bilan.Document.ContentStart,
                rtbx_bilan.Document.ContentEnd
                );

            textrange.Text = cs2.champ("RAP_BILAN").ToString();
            cs2.fermer();
        }
        public UserControlConsulterRapport(string chaineConnexion)
        {
            InitializeComponent();
            this._chaineConnexion = chaineConnexion;
            CURS   cs6      = new CURS(_chaineConnexion);
            string requete6 = "SELECT MAX(RAP_NUM) as MAX FROM rapport_visite ;";

            cs6.ReqSelect(requete6);
            tbx_NRapport.Text = cs6.champ("MAX").ToString();
            cs6.fermer();

            CURS   cs1      = new CURS(_chaineConnexion);
            string requete1 = "SELECT RAP_NUM FROM rapport_visite ORDER BY RAP_NUM;";

            cs1.ReqSelect(requete1);
            while (!cs1.Fin())
            {
                _list.Add(cs1.champ("RAP_NUM").ToString());
                cs1.suivant();
            }
            cs1.fermer();
        }
示例#13
0
        private void btn_fermer_Click(object sender, RoutedEventArgs e)
        {
            int i, codeEchan, qte;

            for (i = 0; i < ltb_resultat.Items.Count; i++)
            {
                CURS   cs      = new CURS(_chaineConnexion);
                string requete = "SELECT ECHAN_CODE FROM echantillon WHERE ECHAN_NOM = '" + ltb_resultat.Items[i] + "'; ";
                cs.ReqSelect(requete);
                codeEchan = Int32.Parse(cs.champ("ECHAN_CODE").ToString());
                cs.fermer();

                qte = Int32.Parse(ltb_qte.Items[i].ToString());

                CURS   cs3      = new CURS(_chaineConnexion);
                string requete3 = "INSERT INTO distribuer VALUES ( " + -_rapNum + " , " + codeEchan + " , " + qte + ");";
                cs3.ReqAdmin(requete3);
                cs3.fermer();
            }

            this.Close();
        }
示例#14
0
        public void Reload()
        {
            tbx_NRapport.Clear();
            dtp_date.SelectedDate   = null;
            comboBox1.SelectedIndex = 0;
            cbx_motif.SelectedIndex = 0;
            rtbx_bilan.Document.Blocks.Clear();

            CURS   cs1 = new CURS(_chaineConnexion);
            string numRapp;
            string requete1 = "SELECT MAX(RAP_NUM)+1 as MAX FROM rapport_visite; ";

            cs1.ReqSelect(requete1);

            while (!cs1.Fin())
            {
                numRapp           = cs1.champ("MAX").ToString();
                tbx_NRapport.Text = numRapp;
                cs1.suivant();
            }
            cs1.fermer();
        }
示例#15
0
        private void btn_Valider_Click(object sender, RoutedEventArgs e)
        {
            if (tbx_login.Text == "" || tbx_mdp.Text == "")
            {
                MessageBox.Show("Vos informations de connexion ne sont pas correctes");
            }
            else
            {
                CURS   cs      = new CURS(_chaineConnexion);
                string requete = "SELECT collaborateur.COL_MATRICULE , COL_DATEEMBAUCHE FROM collaborateur INNER JOIN visiteur ON collaborateur.COL_MATRICULE = visiteur.COL_MATRICULE WHERE COL_NOM = ";
                requete += "'";
                requete += tbx_login.Text;
                requete += "'";
                requete += ";";
                cs.ReqSelect(requete);

                _matricule = cs.champ("COL_MATRICULE").ToString();
                string mdp = cs.champ("COL_DATEEMBAUCHE").ToString();
                mdp = mdp.Replace('/', '-');
                mdp = mdp.Substring(0, 10);

                while (!cs.Fin())
                {
                    if (mdp == tbx_mdp.Text)
                    {
                        MainWindow m = new MainWindow(_chaineConnexion, _matricule);
                        this.Hide();
                        m.Show();
                    }
                    else
                    {
                        MessageBox.Show("Vos informations de connexion ne sont pas correctes");
                    }
                    cs.suivant();
                }
                cs.fermer();
            }
        }
示例#16
0
        private void button2_Click(object sender, RoutedEventArgs e)
        {
            TextRange textrange = new TextRange(
                rtbx_bilan.Document.ContentStart,
                rtbx_bilan.Document.ContentEnd
                );

            if (tbx_NRapport.Text != "" && textrange.Text != "")
            {
                string dt = Convert.ToString(dtp_date);
                dt = dt.Replace('/', '-');
                string   checkbox_value = dt;
                char[]   splitters      = new char[] { '-' };
                string[] laCase         = checkbox_value.Split(splitters);
                string   value          = laCase[2];
                char[]   split          = new char[] { ' ' };
                string[] laCas          = value.Split(split);
                dt = laCas[0] + "-" + laCase[1] + "-" + laCase[0] + " " + laCas[1];


                MessageBoxResult retour = MessageBox.Show("Vous venez de valider un rapport de visite !. Avez-vous donner des échantillons ?", "Alerte", MessageBoxButton.YesNo);
                if (retour == MessageBoxResult.Yes)
                {
                    CURS   cs3      = new CURS(_chaineConnexion);
                    string requete3 = "INSERT INTO rapport_visite VALUES ( '" + _matricule + "' , " + tbx_NRapport.Text + " , " + tbx_test.Text + ", '" + dt + "' , '" + textrange.Text + "');";
                    cs3.ReqAdmin(requete3);
                    cs3.fermer();
                    CURS   cs5      = new CURS(_chaineConnexion);
                    string requete5 = "SELECT MOTIF_CODE FROM motif WHERE MOTIF_LIBELLE = '" + cbx_motif.Text + "' ;";
                    cs5.ReqSelect(requete5);
                    string code_motif;
                    code_motif = cs5.champ("MOTIF_CODE").ToString();
                    CURS   cs4      = new CURS(_chaineConnexion);
                    string requete4 = "INSERT INTO motiver VALUES ( " + code_motif + " , " + tbx_NRapport.Text + " , '" + _matricule + "' );";
                    cs4.ReqAdmin(requete4);
                    cs4.fermer();

                    Echantillons echan = new Echantillons(_chaineConnexion, Int32.Parse(tbx_NRapport.Text));
                    echan.Show();

                    Reload();
                }
                else
                {
                    CURS   cs3      = new CURS(_chaineConnexion);
                    string requete3 = "INSERT INTO rapport_visite VALUES ( '" + _matricule + "' , " + tbx_NRapport.Text + " , " + tbx_test.Text + " , '" + dt + "' , '" + textrange.Text + "');";
                    cs3.ReqAdmin(requete3);
                    cs3.fermer();
                    CURS   cs5      = new CURS(_chaineConnexion);
                    string requete5 = "SELECT MOTIF_CODE FROM motif WHERE MOTIF_LIBELLE = '" + cbx_motif.Text + "' ;";
                    cs5.ReqSelect(requete5);
                    string code_motif;
                    code_motif = cs5.champ("MOTIF_CODE").ToString();
                    CURS   cs4      = new CURS(_chaineConnexion);
                    string requete4 = "INSERT INTO motiver VALUES ( " + code_motif + " , " + tbx_NRapport.Text + " , '" + _matricule + "' );";
                    cs4.ReqAdmin(requete4);
                    cs4.fermer();


                    MessageBox.Show("Rapport enregistrer !");
                    Reload();
                }
            }
            else
            {
                MessageBox.Show("Vous n'avez pas remplis tout les champs ! ");
            }
        }