public ActionResult Controle() { try { // on récupère les données du formulaire String login = Request["login"]; String mdp = Request["pwd"]; try { Service unService = new Service(); Utilisateur unUtilisateur = unService.getUtilistateur(login); if (unUtilisateur != null) { try { String pwdmd5 = FonctionsUtiles.md5(mdp); if (unUtilisateur.MotPasse.CompareTo(pwdmd5) == 0) { Session["id"] = unUtilisateur.NumUtil; Session["name"] = unUtilisateur.NomUtil; } else { ModelState.AddModelError("Erreur", "Erreur lors du contrôle du mot de passe pour : " + login); Session["msgerr"] = "Login ou mot de passe incorrect!"; return(RedirectToAction("Connexion", "Home")); } } catch (Exception e) { ModelState.AddModelError("Erreur", "Erreur lors du contrôle : " + e.Message); Session["msgerr"] = "Login ou mot de passe incorrect!"; return(RedirectToAction("Connexion", "Home")); } } else { ModelState.AddModelError("Erreur", "Erreur login erroné : " + login); Session["msgerr"] = "Login ou mot de passe incorrect!"; return(RedirectToAction("Connexion", "Home")); } } catch (MonException e) { ModelState.AddModelError("Erreur", "Erreur lors de l'authentification : " + e.Message); Session["msgerr"] = "Login ou mot de passe incorrect!"; return(RedirectToAction("Connexion", "Home")); } return(RedirectToAction("Index", "Home")); } catch (MonException e) { ModelState.AddModelError("Erreur", "Erreur lors de l'authentification : " + e.Message); Session["msgerr"] = "Login ou mot de passe incorrect!"; return(RedirectToAction("Connexion", "Home")); } }
protected void HeadForDestination() { if (animator.state != EnnemyAnimator.State.Chase) { animator.state = EnnemyAnimator.State.Chase; } Vector3 destination = target.transform.position; agent.SetDestination(destination); FonctionsUtiles.DebugRay(transform.position, destination, Color.yellow); }
/// <summary> /// Fonction qui met à jour un manga /// </summary> /// <param name="unM"></param> public static void UpdateManga(Manga unM) { Serreurs er = new Serreurs("Erreur sur l'écriture d'un manga.", "ServiceManga.update()"); String requete = "UPDATE Manga SET " + "id_scenariste = " + unM.Id_scenariste + ", id_dessinateur = " + unM.Id_dessinateur + "" + ", id_genre = " + +unM.Id_genre + ", titre = '" + unM.Titre + "'" + ", Prix = " + unM.Prix + ", dateParution = '" + FonctionsUtiles.DateToString(unM.DateParution) + "'" + ",couverture = '" + unM.Couverture + "'" + " WHERE id_manga =" + unM.Id_manga; try { DBInterface.Insertion_Donnees(requete); } catch (MonException erreur) { throw erreur; } }
public static void AddManga(Manga unM) { Serreurs er = new Serreurs("Erreur sur l'ajout d'un manga.", "ServiceManga.AddManga()"); String prix = unM.Prix.ToString().Replace(",", "."); String requete = "INSERT INTO manga (id_scenariste, id_dessinateur, id_genre, titre, Prix, dateParution, couverture) VALUES ( " + unM.Id_scenariste + ", " + unM.Id_dessinateur + ", '" + +unM.Id_genre + "'" + ", '" + unM.Titre + "'" + ", " + prix + ", '" + FonctionsUtiles.DateToString(unM.DateParution) + "'" + ", '" + unM.Couverture + "' )"; try { DBInterface.Insertion_Donnees(requete); } catch (MonException erreur) { throw erreur; } }