Exemplo n.º 1
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();
        }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
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();
        }
Exemplo n.º 5
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;
        }
        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();
        }
Exemplo n.º 7
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();
        }
Exemplo n.º 8
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();
            }
        }