Пример #1
0
        private void btnEnreg_Click(object sender, System.EventArgs e)
        {
            //recuperation du numero du medecin traitant
            Patient unPatient = new Patient(txtNom.Text, txtPrenom.Text, txtAd.Text, txtCp.Text, txtVille.Text, txtTel.Text, cmbMedecin.Text);

            textBox1.Text = unPatient.enregistrer();
            ApplicationGestionRdv maFrm;

            maFrm = new ApplicationGestionRdv();
            this.Close();
        }
        private void cmdEntrer_Click(object sender, System.EventArgs e)
        {
            if (txtNom.Text == "admin" && txtPwd.Text == "admin")
            {
                AdminInterface maForm;
                maForm = new AdminInterface();
                maForm.Show();
            }
            else
            {
                test = new log.Log();


                try
                {
                    if (test.testLog(txtNom.Text, txtPwd.Text))
                    {
                        //l'authentification est bonne on redirectionne vers le bon frm
                        if (test.testType(txtNom.Text, txtPwd.Text) == "medecin")
                        {
                            //ouverture du formulaire pour le medecin
                            RdvMedecin maForm;
                            maForm = new RdvMedecin(test.getNomMed(txtNom.Text, txtPwd.Text));
                            maForm.Show();
                        }
                        else
                        {
                            ApplicationGestionRdv maForm;
                            maForm = new ApplicationGestionRdv();
                            //this.Close();
                            maForm.Show();
                        }
                    }
                    else
                    {
                        this.result.Text = "Mauvaise authentificaiton";
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }