예제 #1
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
            }));
        }
예제 #2
0
        /// <summary>
        /// gets the index of the idea report module
        /// </summary>
        /// <returns>returns the result to action</returns>
        public ActionResult Index()
        {
            IdeaReportRepository ideaReport = new IdeaReportRepository(SessionCustom);
            ModulRepository      modul      = new ModulRepository(SessionCustom);

            modul.Entity.ModulId    = 56;
            modul.Entity.LanguageId = CurrentLanguage.LanguageId;
            modul.Load();

            PaginInfo paginInfo = new PaginInfo()
            {
                PageIndex = 1
            };

            return(this.View(new Models.IdeaReport()
            {
                UserPrincipal = CustomUser,
                Module = modul.Entity,
                CollIdeaReport = ideaReport.GetAllPaging(null, paginInfo),
                ColModul = CustomMemberShipProvider.GetModuls(CustomUser.UserId, SessionCustom, HttpContext),
                Total = paginInfo.TotalCount,
                Controller = modul.Entity.Controller,
                CurrentLanguage = CurrentLanguage
            }));
        }
예제 #3
0
        public ActionResult Detail(int id, int?mod, int?sectionId)
        {
            SuccessStoryPostulateFacade successStoryPostulateFacade = new SuccessStoryPostulateFacade();
            TagFacade       tagFacade = new TagFacade();
            ModulRepository modul     = new ModulRepository(SessionCustom);

            modul.Entity.ModulId    = mod;
            modul.Entity.LanguageId = this.CurrentLanguage.LanguageId;
            modul.Load();
            this.ViewBag.SectionId = sectionId;

            SuccessStoryPostulate successStoryPostulate = successStoryPostulateFacade.GetById(id, (int)this.CurrentLanguage.LanguageId);

            successStoryPostulate.State = (byte)SuccessStoryPostulateStateEnum.Pending;
            successStoryPostulateFacade.Update(successStoryPostulate);

            return(this.View(new DetailModel
            {
                SuccessStoryPostulate = successStoryPostulate,
                TagsText = string.Join(", ", tagFacade.GetBySuccessStoryPostulate(id).Select(t => t.Name)),
                UserPrincipal = this.CustomUser,
                ColModul = CustomMemberShipProvider.GetModuls(this.CustomUser.UserId, this.SessionCustom, HttpContext),
                Module = modul.Entity,
                CurrentLanguage = this.CurrentLanguage,
            }));
        }
예제 #4
0
        /// <summary>
        /// Obtiene las postulaciones
        /// </summary>
        /// <param name="page">page index</param>
        /// <param name="mod">Identificador del modulo</param>
        /// <param name="sectionId">Identificador de la seccion</param>
        /// <returns>Vista de las postulaciones</returns>
        public ActionResult List(int?page, int?mod, int?sectionId)
        {
            int total      = 0;
            int pageSize   = 10;
            int pageNumber = page ?? 1;
            SuccessStoryPostulateFacade        postulates = new SuccessStoryPostulateFacade();
            ModulRepository                    modul      = new ModulRepository(SessionCustom);
            List <SuccessStoryPostulatePaging> paging     = postulates.GetPaging(pageNumber, pageSize, out total, this.CurrentLanguage.LanguageId.Value).ToList();

            modul.Entity.ModulId    = mod;
            modul.Entity.LanguageId = this.CurrentLanguage.LanguageId;
            modul.Load();
            decimal nropagesdec = decimal.Parse(total.ToString()) / decimal.Parse(pageSize.ToString());
            decimal nropagesint = (int)(total / pageSize);

            this.ViewBag.CurrentPage = pageNumber;
            this.ViewBag.TotalRows   = total;
            this.ViewBag.SizePage    = pageSize;
            this.ViewBag.NroPages    = nropagesdec > nropagesint ? nropagesint + 1 : nropagesint;
            this.ViewBag.SectionId   = sectionId;

            return(this.View(
                       "List",
                       new SuccessStoryPostulateModel()
            {
                UserPrincipal = this.CustomUser,
                ListaSuccessStoryPostulate = paging,
                ColModul = CustomMemberShipProvider.GetModuls(this.CustomUser.UserId, this.SessionCustom, HttpContext),

                Module = modul.Entity,
                CurrentLanguage = this.CurrentLanguage,
            }));
        }
예제 #5
0
        /// <summary>
        /// Creates an action invoker.
        /// </summary>
        /// <returns>An action invoker.</returns>
        protected override IActionInvoker CreateActionInvoker()
        {
            string controller = HttpContext.Request.RequestContext.RouteData.Values["controller"].ToString();

            if (HttpContext.User.Identity.IsAuthenticated)
            {
                string     cookieName = FormsAuthentication.FormsCookieName;
                HttpCookie authCookie = HttpContext.Request.Cookies[cookieName];
                FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value);

                string[] data = authTicket.UserData.Split('|');

                FormsIdentity id = new FormsIdentity(authTicket);
                HttpContext.User = this.CustomUser = new CustomPrincipal(id, data);

                if (HttpContext.Session["lang"] != null)
                {
                    this.CurrentLanguage = (Language)HttpContext.Session["lang"];
                }
                else
                {
                    LanguageRepository languagerepo = new LanguageRepository(this.SessionCustom);
                    languagerepo.GetByUser(this.CustomUser.UserId);
                    this.CurrentLanguage = languagerepo.Entity;
                    HttpContext.Session.Add("lang", this.CurrentLanguage);
                }

                Thread.CurrentThread.CurrentCulture   = new CultureInfo(this.CurrentLanguage.Culturename);
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(this.CurrentLanguage.Culturename);
            }
            else
            {
                this.CustomUser = new CustomPrincipal(HttpContext.User.Identity);
                LanguageRepository languagerepo = new LanguageRepository(this.SessionCustom);
                languagerepo.Entity.IsDefault = true;
                languagerepo.Load();
            }

            if (controller != null)
            {
                ModulRepository modulrepo = new ModulRepository(this.SessionCustom);
                modulrepo.Entity.Controller = controller;
                if (this.CurrentLanguage != null)
                {
                    modulrepo.Entity.LanguageId = this.CurrentLanguage.LanguageId;
                }

                modulrepo.Load();
                this.Module = modulrepo.Entity;
            }

            return(base.CreateActionInvoker());
        }
예제 #6
0
        public ActionResult Index(int mod)
        {
            ContentRepository content    = new ContentRepository(SessionCustom);
            ModulRepository   modul      = new ModulRepository(SessionCustom);
            SectionRepository objsection = new SectionRepository(SessionCustom);

            PaginInfo paginInfo = new PaginInfo()
            {
                PageIndex = 1
            };

            content.Entity.ModulId    = mod;
            modul.Entity.ModulId      = content.Entity.ModulId = mod;
            content.Entity.LanguageId = modul.Entity.LanguageId = CurrentLanguage.LanguageId;
            modul.Load();

            ////objsection.Entity.Active = true;
            objsection.Entity.LanguageId = CurrentLanguage.LanguageId;

            if (HttpContext.Session["CollClones"] != null)
            {
                ViewBag.CollClone = (List <int>)HttpContext.Session["CollClones"];
            }

            return(this.View(new Models.Content()
            {
                UserPrincipal = CustomUser,
                Module = modul.Entity,
                CollSection = objsection.GetAll().Where(t => t.ParentId == null),
                ColModul = CustomMemberShipProvider.GetModuls(CustomUser.UserId, SessionCustom, HttpContext),
                CollContent = content.GetAllPaging(null, paginInfo),
                Total = paginInfo.TotalCount,
                Controller = modul.Entity.Controller,
                CurrentLanguage = CurrentLanguage
            }));
        }