Beispiel #1
0
        /// <summary>
        /// gets the home of challenge module
        /// </summary>
        /// <param name="mod">identifier of module</param>
        /// <param name="sectionId">identifier of section</param>
        /// <returns>returns the result to action</returns>
        public ActionResult Index(int mod, int?sectionId)
        {
            ContentManagement  objcontentman = new ContentManagement(this.SessionCustom, HttpContext);
            SectionRepository  objsection    = new SectionRepository(this.SessionCustom);
            TemplateRepository objtemplate   = new TemplateRepository(this.SessionCustom);
            ContentRepository  objcontent    = new ContentRepository(SessionCustom);
            TagFacade          tagFacade     = new TagFacade();

            objtemplate.Entity.Type = 0;

            return(this.View(new ChallengeModel()
            {
                UserPrincipal = this.CustomUser,
                Module = this.Module,
                ColModul = CustomMemberShipProvider.GetModuls(this.CustomUser.UserId, this.SessionCustom, HttpContext),
                Templates = objtemplate.GetAll().Select(t => t.TemplateId),
                DeepFollower = sectionId != null ? Business.Utils.GetDeepFollower(objsection.GetAll(), sectionId.Value) : null,
                IContent = new Domain.Entities.Content()
                {
                    ModulId = mod,
                    SectionId = sectionId
                },
                CurrentLanguage = this.CurrentLanguage,
                Categories = objcontent.Categories(),
                Tags = tagFacade.GetAll().Select(t => new SelectListItem {
                    Text = t.Name, Value = t.TagId.ToString()
                })
            }));
        }
Beispiel #2
0
        /// <summary>
        /// obtains the question 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);
            QuestionRepository   objquestion   = new QuestionRepository(SessionCustom);
            FileattachRepository objfiles      = new FileattachRepository(SessionCustom);
            TagRepository        objtag        = new TagRepository(SessionCustom);
            SectionRepository    objsection    = new SectionRepository(SessionCustom);
            TemplateRepository   objtemplate   = new TemplateRepository(SessionCustom);
            AnswerRepository     objanswer     = new AnswerRepository(SessionCustom);
            TagFacade            tagFacade     = new TagFacade();

            objtemplate.Entity.Type = 0;

            objquestion.Entity.ContentId           =
                objfiles.Entity.ContentId          =
                    objcontent.Entity.ContentId    =
                        objanswer.Entity.ContentId = id;

            objquestion.LoadByKey();
            objcontent.LoadByKey();

            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 QuestionModel()
            {
                UserPrincipal = this.CustomUser,
                ColModul = CustomMemberShipProvider.GetModuls(this.CustomUser.UserId, this.SessionCustom, HttpContext),
                Module = this.Module,
                ListFiles = objfiles.GetAllReadOnly(),
                Question = objquestion.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,
                ListAnswers = objanswer.GetAllReadOnly(),
                Categories = objcontent.Categories(),
                Tags = tagFacade.GetAll().Select(t => new SelectListItem {
                    Text = t.Name, Value = t.TagId.ToString()
                })
            }));
        }
Beispiel #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()
                })
            }));
        }