private void Search() { _projectDataContext = new ProjectDataContext(); _moldRepository = new MoldRepository(_projectDataContext); dgvDuLieu.DataSource = _moldRepository.GetAll().OrderBy(_ => _.MoldNo); Control(); }
/// <summary> /// gets the home of mold module /// </summary> /// <returns>returns the result to action</returns> public ActionResult Index() { MoldRepository objMold = new MoldRepository(SessionCustom); return(this.View(new Molde() { UserPrincipal = CustomUser, Module = this.Module, CollMold = objMold.GetAll(), ColModul = CustomMemberShipProvider.GetModuls(CustomUser.UserId, SessionCustom, HttpContext), CurrentLanguage = CurrentLanguage })); }
/// <summary> /// gets the home of news 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(this.SessionCustom); TagFacade tagFacade = new TagFacade(); objtemplate.Entity.Type = 0; MoldRepository objMold = new MoldRepository(this.SessionCustom); List <Domain.Entities.Mold> collMold = objMold.GetAll(); collMold.Insert( 0, new Domain.Entities.Mold() { Name = Resources.Global.Messages.SELECT }); return(this.View(new NewsModel() { 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, CollMold = collMold, Categories = objcontent.Categories(), Tags = tagFacade.GetAll().Select(t => new SelectListItem { Text = t.Name, Value = t.TagId.ToString() }) })); }
private void LoadMoldData() { cbbMold.DataSource = _moldRepository.GetAll().OrderBy(_ => _.MoldNo).ToList(); cbbMold.SelectedIndex = 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() }) })); }