Exemplo n.º 1
0
        public ActionResult ProfilDetails()
        {
            ProfilService ps = new ProfilService();
            user          u  = ps.GetById(User.Identity.GetUserId());

            profilModel p = new profilModel
            {
                firstName = u.firstName,
                lastName  = u.lastName,
                adress    = u.adress,
                email     = u.Email,
                age       = u.age,
                file      = u.file,
            };

            return(View(p));
        }
Exemplo n.º 2
0
        // GET: Event/Edit/5
        public ActionResult Edit()
        {
            ProfilService c  = new ProfilService();
            user          u  = c.GetById(User.Identity.GetUserId());
            profilModel   pm = new profilModel
            {
                firstName = u.firstName,
                lastName  = u.lastName,
                adress    = u.adress,
                email     = u.Email,
                age       = u.age,
                file      = u.file,
            };


            return(View(pm));
        }
Exemplo n.º 3
0
        public ActionResult Edit(profilModel E)
        {
            ProfilService c = new ProfilService();

            if (!ModelState.IsValid)
            {
                RedirectToAction("Edit");
            }
            user user = c.GetById(User.Identity.GetUserId());

            user.firstName = E.firstName;
            user.lastName  = E.lastName;
            user.adress    = E.adress;
            user.Email     = E.email;
            user.age       = E.age;
            user.file      = E.file;
            c.Update(user);
            c.Commit();


            return(RedirectToAction("Index"));
        }