示例#1
0
        /// <summary>
        /// obtains the idea detail
        /// </summary>
        /// <param name="mod">identifier of module</param>
        /// <param name="id">identifier of section</param>
        /// <returns>returns the result to action</returns>
        public ActionResult Detail(int mod, int id)
        {
            QuestionRepository   objquestion   = new QuestionRepository(SessionCustom);
            ContentManagement    objcontentman = new ContentManagement(SessionCustom, HttpContext);
            ContentRepository    objcontent    = new ContentRepository(SessionCustom);
            IdeaRepository       objidea       = new IdeaRepository(SessionCustom);
            FileattachRepository objfiles      = new FileattachRepository(SessionCustom);
            TagRepository        objtag        = new TagRepository(SessionCustom);
            SectionRepository    objsection    = new SectionRepository(SessionCustom);
            TemplateRepository   objtemplate   = new TemplateRepository(SessionCustom);
            CommentRepository    objcomment    = new CommentRepository(SessionCustom);

            objtemplate.Entity.Type = 0;

            objidea.Entity.IdeaId        =
                objcomment.Entity.IdeaId = id;
            objidea.LoadByKey();

            objquestion.Entity.ContentId    =
                objcontent.Entity.ContentId = objidea.Entity.ContentId;
            objcontent.LoadByKey();
            objquestion.LoadByKey();

            if (objquestion.Entity != null && objquestion.Entity.Type.Equals(Domain.Entities.Question.TypeQuestion.Ubicacion))
            {
                ViewBag.Location = true;
            }
            else
            {
                ViewBag.Location = false;
            }

            int totalComments = 0;
            List <CommentsPaging> comments = objcomment.CommentsPaging(0, 50, out totalComments, id);

            ViewBag.TotalComments = totalComments;

            IEnumerable <Tag> SelectedTags = objtag.GetTagbycontent(id);

            this.ViewBag.SelectedTags = string.Join("|", SelectedTags.Select(t => t.TagId));
            this.ViewBag.NewsTags     = string.Empty;

            return(this.View(
                       "Detail",
                       new IdeaModel()
            {
                UserPrincipal = this.CustomUser,
                ColModul = CustomMemberShipProvider.GetModuls(this.CustomUser.UserId, this.SessionCustom, HttpContext),
                Module = this.Module,
                ListFiles = objfiles.GetAllReadOnly(),
                Idea = objidea.Entity,
                IContent = objcontent.Entity,
                Templates = objtemplate.GetAll().Select(t => t.TemplateId),
                ListContent = objcontent.GetContentRelation(CurrentLanguage.LanguageId.Value),
                ListTags = SelectedTags,
                DeepFollower = Business.Utils.GetDeepFollower(objsection.GetAll(), objcontent.Entity.SectionId.Value),
                CurrentLanguage = this.CurrentLanguage,
                ListComments = comments
            }));
        }
示例#2
0
        /// <summary>
        /// obtains the challenge detail
        /// </summary>
        /// <param name="mod">identifier of module</param>
        /// <param name="id">identifier of section</param>
        /// <param name="sectionId">seccion del molulo</param>
        /// <returns>returns the result to action</returns>
        public ActionResult Detail(int mod, int id, int?sectionId)
        {
            ContentManagement      objcontentman   = new ContentManagement(SessionCustom, HttpContext);
            ContentRepository      objcontent      = new ContentRepository(SessionCustom);
            SuccessStoryRepository objSuccessStory = new SuccessStoryRepository(SessionCustom);
            FileattachRepository   objfiles        = new FileattachRepository(SessionCustom);
            TagRepository          objtag          = new TagRepository(SessionCustom);
            SectionRepository      objsection      = new SectionRepository(SessionCustom);
            TemplateRepository     objtemplate     = new TemplateRepository(SessionCustom);
            CommentRepository      objcomment      = new CommentRepository(SessionCustom);
            TagFacade tagFacade = new TagFacade();

            objtemplate.Entity.Type = 0;

            objSuccessStory.Entity.ContentId        =
                objfiles.Entity.ContentId           =
                    objcomment.Entity.ContentId     =
                        objcontent.Entity.ContentId = id;

            objSuccessStory.LoadByKey();
            objcontent.LoadByKey();

            int totalComments = 0;
            List <CommentsPaging> comments = objcomment.CommentsPagingContent(0, 50, out totalComments, id);

            ViewBag.TotalComments = totalComments;

            IEnumerable <Tag> SelectedTags = objtag.GetTagbycontent(id);

            this.ViewBag.SelectedTags = string.Join("|", SelectedTags.Select(t => t.TagId));
            this.ViewBag.NewsTags     = string.Empty;

            return(this.View(
                       "Index",
                       new SuccessStoryModel()
            {
                UserPrincipal = this.CustomUser,
                ColModul = CustomMemberShipProvider.GetModuls(this.CustomUser.UserId, this.SessionCustom, HttpContext),
                Module = this.Module,
                ListFiles = objfiles.GetAllReadOnly(),
                SuccessStory = objSuccessStory.Entity,
                IContent = objcontent.Entity,
                Templates = objtemplate.GetAll().Select(t => t.TemplateId),
                ListContent = objcontent.GetContentRelation(CurrentLanguage.LanguageId.Value),
                ListTags = SelectedTags,
                DeepFollower = Business.Utils.GetDeepFollower(objsection.GetAll(), objcontent.Entity.SectionId.Value),
                CurrentLanguage = this.CurrentLanguage,
                ListComments = comments,
                Tags = tagFacade.GetAll().Select(t => new SelectListItem {
                    Text = t.Name, Value = t.TagId.ToString()
                })
            }));
        }
示例#3
0
        /// <summary>
        /// obtains the news detail
        /// </summary>
        /// <param name="mod">identifier of module</param>
        /// <param name="id">identifier of section</param>
        /// <returns>returns the result to action</returns>
        public ActionResult Detail(int mod, int id)
        {
            ContentManagement    objcontentman = new ContentManagement(SessionCustom, HttpContext);
            ContentRepository    objcontent    = new ContentRepository(SessionCustom);
            NewsRepository       objnews       = new NewsRepository(SessionCustom);
            FileattachRepository objfiles      = new FileattachRepository(SessionCustom);
            TagRepository        objtag        = new TagRepository(SessionCustom);
            SectionRepository    objsection    = new SectionRepository(SessionCustom);
            TemplateRepository   objtemplate   = new TemplateRepository(SessionCustom);
            MoldRepository       objMold       = new MoldRepository(SessionCustom);
            XmlNodeList          collXmlNode   = null;
            TagFacade            tagFacade     = new TagFacade();

            List <Domain.Entities.Mold> collMold = objMold.GetAll();

            collMold.Insert(
                0,
                new Domain.Entities.Mold()
            {
                Name = Resources.Global.Messages.SELECT
            });

            objtemplate.Entity.Type = 0;

            objnews.Entity.ContentId            =
                objfiles.Entity.ContentId       =
                    objcontent.Entity.ContentId = id;

            objnews.LoadByKey();
            objcontent.LoadByKey();

            if (objnews.Entity.MoldId != null)
            {
                XmlDocument objXmlDocument = new XmlDocument();
                objXmlDocument.LoadXml(objnews.Entity.Xmlcontent);
                collXmlNode = objXmlDocument.GetElementsByTagName("node");
            }

            IEnumerable <Tag> SelectedTags = objtag.GetTagbycontent(id);

            this.ViewBag.SelectedTags = string.Join("|", SelectedTags.Select(t => t.TagId));
            this.ViewBag.NewsTags     = string.Empty;

            return(this.View(
                       "Index",
                       new NewsModel()
            {
                UserPrincipal = this.CustomUser,
                ColModul = CustomMemberShipProvider.GetModuls(this.CustomUser.UserId, this.SessionCustom, HttpContext),
                Module = this.Module,
                ListFiles = objfiles.GetAllReadOnly(),
                News = objnews.Entity,
                IContent = objcontent.Entity,
                Templates = objtemplate.GetAll().Select(t => t.TemplateId),
                ListContent = objcontent.GetContentRelation(CurrentLanguage.LanguageId.Value),
                ListTags = SelectedTags,
                DeepFollower = Business.Utils.GetDeepFollower(objsection.GetAll(), objcontent.Entity.SectionId.Value),
                CurrentLanguage = this.CurrentLanguage,
                CollMold = collMold,
                CollXmlNode = collXmlNode,
                Categories = objcontent.Categories(),
                Tags = tagFacade.GetAll().Select(t => new SelectListItem {
                    Text = t.Name, Value = t.TagId.ToString()
                })
            }));
        }