Example #1
0
 public IActionResult SubmitLoginMedecin(string inputCode14, string inputPassword4)
 {
     if (inputCode14 != null && inputPassword4 != null)
     {
         Medecin m = new Medecin();
         m.Code_Medecin = inputCode14;
         m.Mdp_Medecin  = inputPassword4;
         if (Medecin.CheckLogin(m.Code_Medecin, m.Mdp_Medecin, m))
         {
             HttpContext.Session.Clear();
             HttpContext.Session.SetString("CodeMedecin", m.Code_Medecin);
             return(RedirectToAction("MesInfos", "Medecin", m));
         }
         else
         {
             ViewBag.MessageError = "Identifiants incorrects";
             return(View("LoginMedecin"));
         }
     }
     else
     {
         ViewBag.MessageError = "Merci de remplir la totalité des champs";
         return(View("LoginMedecin"));
     }
 }