Exemple #1
0
 public static SectionModel ToSectionModel(this BllSection bllSection)
 {
     return(new SectionModel()
     {
         Id = bllSection.Id,
         Name = bllSection.Name
     });
 }
Exemple #2
0
        public ActionResult _Topics(int id, int?page)
        {
            ViewBag.IsShowStatus = false;
            BllSection section = sectionService.GetSection(id);

            return(PartialView(this.GetItemsOnPage(section.Topics, page, TOPICS_PER_PAGE)
                               .Select(bllTopic => bllTopic.ToTopicListModel())));
        }
Exemple #3
0
 public static DalSection ToDalSection(this BllSection bllSection)
 {
     return(new DalSection()
     {
         Id = bllSection.Id,
         Name = bllSection.Name
     });
 }
Exemple #4
0
 public void UpdateSection(BllSection section)
 {
     try
     {
         sectionRepository.Update(section.ToDalSection());
     }
     catch (InvalidOperationException e)
     {
         logger.Warn(e.Message);
         throw;
     }
 }
Exemple #5
0
        public ActionResult TopicsInSection(int id, int?page)
        {
            ViewBag.AjaxId       = id;
            ViewBag.IsShowStatus = false;
            ViewBag.SectionId    = id;

            BllSection section = sectionService.GetSection(id);

            section.Topics = section.Topics.Where(t => t.Status.Id == (int)StatusEnum.Accepted);
            return(View("Topics", this.GetItemsOnPage(section.Topics, page, TOPICS_PER_PAGE)
                        .Select(bllTopic => bllTopic.ToTopicListModel())));
        }