public ActionResult SupprimerCompte()
        {
            CPersonnel user = (CPersonnel)Session["user"];

            user.SupprimerPersonnel();
            return(Redirect("../Login/Index"));
        }
Beispiel #2
0
        public ActionResult Register(string nom, string prenom, string tel, DateTime dateNaiss, string mail, string spec, string pass)
        {
            CPersonnel p;

            p = new CPersonnel(0, nom, prenom, tel, dateNaiss, mail, spec, "");
            if (p.AjoutPersonnel(pass))
            {
                return(View("Index"));
            }
            else
            {
                ViewBag.Message = "Erreur: émail déja existant";
                return(View("Register"));
            }
        }
Beispiel #3
0
        public ActionResult Index(string email, string pass)
        {
            CPersonnel p = new CPersonnel();

            object user = p.Connexion(email, pass);



            if (p.Role == "Admin")
            {
                CAdministrateur admin = (CAdministrateur)user;
                Session["user"] = admin;
                return(Redirect("GestionPoste"));
            }

            else if (p.Role == "Comptable")
            {
                CComptable comp = (CComptable)user;
                Session["user"] = comp;
                return(Redirect("Comptable"));
            }

            else
            if (p.Role == "Responsable")
            {
                CResponsable resp = (CResponsable)user;
                Session["user"] = resp;
                return(Redirect("Responsable"));
            }


            else if (p.Role == "Participant")
            {
                CParticipant part = (CParticipant)user;
                Session["user"] = part;
                return(Redirect("Participant"));
            }

            else if (p.Role == "Personnel")
            {
                Session["user"] = p;
                return(Redirect("Personnel"));
            }

            return(Redirect("Login?error=Login ou mot de passe incorrect"));
        }
Beispiel #4
0
        //Méthode d' ajout des participants
        public ActionResult AjouterParticipant(double salaire, int heureTravail)
        {
            int          id        = Convert.ToInt32(Request.Form["personnel"]);
            CResponsable resp      = (CResponsable)Session["user"];
            CPersonnel   persToAdd = ((List <CPersonnel>)Session["listPersonnel"]).ElementAt(id);
            CParticipant part      = (CParticipant)persToAdd;

            part.Salaire      = salaire;
            part.HeureTravail = heureTravail;
            //Test si le budget est suffisant
            if (resp.DemandeAjoutParticipant(part, ((CPoste)Session["poste"]).Id))
            {
                Session["listParticipant"] = null;
                return(Redirect("GestionParticipant"));
            }
            else
            {
                return(Redirect("GestionParticipant?error=Erreur: pas assez de fond"));
            }
        }
        public ActionResult ModifCompteForm()
        {
            CPersonnel user = (CPersonnel)Session["user"];

            return(View("ModifCompteForm", user));
        }
        // GET: Account
        public ActionResult Index()
        {
            CPersonnel user = (CPersonnel)Session["user"];

            return(View(user));
        }