Exemplo n.º 1
0
        public List <Object> GetProfilsAndUsers()
        {
            ProfilService        service     = ApplicationManager.Instance.ControllerFactory.ServiceFactory.GetProfilService();
            List <Domain.Profil> profils     = service.getAll();
            UserService          userservice = ApplicationManager.Instance.ControllerFactory.ServiceFactory.GetUserService();
            List <Domain.User>   users       = userservice.getAll();
            List <Object>        items       = new List <object>(profils);

            items.AddRange(users);
            return(items);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Gets ProfilService
 /// </summary>
 public ProfilService GetProfilService()
 {
     if (profilService == null)
     {
         profilService = new ProfilService();
         profilService.ResourcePath = AdministrationResourcePath.SECURITY_PROFIL_RESOURCE_PATH;
         profilService.GroupService = GetGroupService();
         configureService(profilService);
     }
     return(profilService);
 }
Exemplo n.º 3
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.º 4
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.º 5
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"));
        }
Exemplo n.º 6
0
 public void InitService(UserService userServic)
 {
     profilService = userServic.ProfilService;
     roleService   = userServic.RoleService;
     userService   = userServic;
 }