public ActionResult Index() { IDal dal = new Dal(); CongesViewModel vm = new CongesViewModel { _Authentifie = HttpContext.User.Identity.IsAuthenticated }; if (HttpContext.User.Identity.IsAuthenticated) { vm._Collaborateur = dal.ObtenirCollaborateur(HttpContext.User.Identity.Name); } return(View(vm)); }
public ActionResult Index(CongesViewModel vm) { IDal dal = new Dal(); Collaborateur col = dal.ObtenirCollaborateur(HttpContext.User.Identity.Name); vm._Collaborateur = col; System.Diagnostics.Debug.WriteLine(vm._Collaborateur.Nom); string txt = "Service : " + vm._Collaborateur.Service.Nom + "\n"; Message notif = new Message(TypeMessage.NotifCongeAller, col.Prenom + col.Nom + " - " + col.Service.Nom, vm._Conge); if (HttpContext.User.Identity.IsAuthenticated) { dal.AjoutNotif(col.Service.Chef().Id, notif); dal.AjoutConge(col.Id, vm._Conge); dal.EnvoiCongeChef(col.Service.Id, col.Id, vm._Conge.Id); } return(View(vm)); }
public ActionResult Index(CongesViewModel vm) { IDal dal = new Dal(); Collaborateur col = dal.ObtenirCollaborateur(HttpContext.User.Identity.Name); vm._Collaborateur = col; System.Diagnostics.Debug.WriteLine(vm._Collaborateur.Nom); string txt = "Service : " + vm._Collaborateur.Service.Nom + "\n"; Message notif = new Message { Titre = "Demande de validation congé", Date = DateTime.Now, Contenu = txt }; if (HttpContext.User.Identity.IsAuthenticated) { dal.AjoutNotif(col.Service.Chef().Id, notif); dal.AjoutConge(col.Id, vm._Conge); dal.EnvoiCongeChef(col.Service.Id, col.Id, vm._Conge.Id); } return(View(vm)); }
public ActionResult Index() { IDal dal = new Dal(); CongesViewModel vm = new CongesViewModel { /*_Authentifie = HttpContext.User.Identity.IsAuthenticated */ }; if (HttpContext.User.Identity.IsAuthenticated) { vm._Collaborateur = dal.ObtenirCollaborateur(HttpContext.User.Identity.Name); } foreach (Conge c in vm._Collaborateur.Conges) { if (c.Statut == StatutConge.Refuse) { Debug.WriteLine("Refusé"); } if (c.Statut == StatutConge.ValideChef) { Debug.WriteLine("Validé"); } } return(View(vm)); }