Beispiel #1
0
        /// <summary>
        /// obtains the role detail
        /// </summary>
        /// <param name="id">identifier of role</param>
        /// <returns>returns the result to action</returns>
        public ActionResult Detail(int?id)
        {
            RolRepository      objrol      = new RolRepository(SessionCustom);
            ModulRepository    objmod      = new ModulRepository(SessionCustom);
            RolmodulRepository objrolmodul = new RolmodulRepository(SessionCustom);

            objmod.Entity.LanguageId = CurrentLanguage.LanguageId.Value;
            Domain.Entities.Rol rol = null;

            if (id != null)
            {
                objrolmodul.Entity.RolId = objrol.Entity.RolId = id;
                objrol.Load();
                rol        = objrol.Entity;
                ViewBag.id = id;
            }

            return(this.View(new Roles()
            {
                UserPrincipal = CustomUser,
                Module = this.Module,
                RolCustom = rol,
                ColModul = CustomMemberShipProvider.GetModuls(CustomUser.UserId, SessionCustom, HttpContext),
                CollModuls = objmod.GetAllReadOnly(),
                CollRolmodul = id != null ? objrolmodul.GetAllReadOnly() : null,
                CurrentLanguage = CurrentLanguage
            }));
        }
Beispiel #2
0
        /// <summary>
        /// obtains a detail of modules module
        /// </summary>
        /// <param name="id">identifier of module</param>
        /// <returns>returns the result to action</returns>
        public ActionResult Detail(int?id)
        {
            ModulRepository objmod = new ModulRepository(SessionCustom);

            Domain.Entities.Modul objmodul = null;
            objmod.Entity.LanguageId = CurrentLanguage.LanguageId;

            if (id != null)
            {
                objmod.Entity.ModulId = id;
                objmod.Load();
                objmodul      = objmod.Entity;
                objmod.Entity = new Domain.Entities.Modul()
                {
                    LanguageId = CurrentLanguage.LanguageId
                };
                ViewBag.id = id;
            }

            return(this.View(new Modulos()
            {
                UserPrincipal = CustomUser,
                Module = this.Module,
                Modul = objmodul,
                ColModul = CustomMemberShipProvider.GetModuls(CustomUser.UserId, SessionCustom, HttpContext),
                CollModuls = objmod.GetAllReadOnly(),
                CurrentLanguage = CurrentLanguage
            }));
        }