Une application de gestion de RDV pour un cabinet medecal
adegane
Messages postés
1
Date d'inscription
Statut
Membre
Dernière intervention
-
DDD -
DDD -
je veux testé si (login, motpasse et la fonction choisi) sont correcte qui est connecté est : un médecin ou employée du cabinet
si ce un médecin : renvois vers interface médecin
si ce un employé : renvois vers un interface employé
mais ça marche d'aide moi stp ce vraiment urgent ....
private void btt_conn_Click(object sender, EventArgs e)
{
try
{
string myConnection = "Data Source=PCINFO01\\SQLEXPRESS;Initial Catalog=GestionRDVSoin;Integrated Security=True;Pooling=False";
SqlConnection myconx = new SqlConnection(myConnection);
SqlCommand query = new SqlCommand("select * from ProfilUser where Login='" + this.txt_login.Text + "' and MotPasse= '" + this.txt_Mp.Text + "' and fonction='"+this.cmb_fonct.Text+ "'", myconx);
myconx.Open();
SqlDataReader myReade;
myReade = query.ExecuteReader();
int count = 0;
if (cmb_fonct.Text == "Medecin")
{
EspaceMedecin EM;
EM = new EspaceMedecin();
EM.Show();
}
else
if (cmb_fonct.Text == " employeur")
{
employeur Em;
Em= new Employeur();
EM.Show();
}
while (myReade.Read())
{
count = count + 1;
}
if (count == 1)
{
MessageBox.Show("login et mot passe correcte ");
}
else
if (count > 1)
{ MessageBox.Show("login et mot passe est incorrecte");
}
myconx.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Merci d avance
si ce un médecin : renvois vers interface médecin
si ce un employé : renvois vers un interface employé
mais ça marche d'aide moi stp ce vraiment urgent ....
private void btt_conn_Click(object sender, EventArgs e)
{
try
{
string myConnection = "Data Source=PCINFO01\\SQLEXPRESS;Initial Catalog=GestionRDVSoin;Integrated Security=True;Pooling=False";
SqlConnection myconx = new SqlConnection(myConnection);
SqlCommand query = new SqlCommand("select * from ProfilUser where Login='" + this.txt_login.Text + "' and MotPasse= '" + this.txt_Mp.Text + "' and fonction='"+this.cmb_fonct.Text+ "'", myconx);
myconx.Open();
SqlDataReader myReade;
myReade = query.ExecuteReader();
int count = 0;
if (cmb_fonct.Text == "Medecin")
{
EspaceMedecin EM;
EM = new EspaceMedecin();
EM.Show();
}
else
if (cmb_fonct.Text == " employeur")
{
employeur Em;
Em= new Employeur();
EM.Show();
}
while (myReade.Read())
{
count = count + 1;
}
if (count == 1)
{
MessageBox.Show("login et mot passe correcte ");
}
else
if (count > 1)
{ MessageBox.Show("login et mot passe est incorrecte");
}
myconx.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Merci d avance
A voir également:
- Une application de gestion de RDV pour un cabinet medecal
- Nommez une application d'appel vidéo ou de visioconférence - Guide
- Logiciel gestion cabinet médical gratuit - Télécharger - Organisation
- Comment supprimer une application préinstallée sur android - Guide
- Desinstaller une application sur windows - Guide
- Logiciel gestion locative gratuit excel - Télécharger - Comptabilité & Facturation