Ejemplo n.º 1
0
 public List <Navigation> GetTopMenu()
 {
     using (var context = new Entity.pycloudinEntities())
         return((from _content in context.AppMenus
                 where _content.MeneType == "Top"
                 select new Navigation
         {
             MenuLink = _content.MenuLink,
             MenuText = _content.MenuText,
         }).ToList());
 }
Ejemplo n.º 2
0
 public TopicContent GetContent(string url)
 {
     using (var context = new Entity.pycloudinEntities())
     {
         var result = (from _content in context.AppMenus
                       join _blog in context.AppBlogs on _content.MenuId equals _blog.MenuId
                       where _content.MenuLink == url
                       select new { _content, _blog }).FirstOrDefault();
         TopicContent topicContent = new TopicContent();
         FileStorage  fileStorage  = new FileStorage(AppSetting.StorageConnectionString, this.ShareName.ToLower());
         var          folderpath   = result._content.MenuSection.ToLower();
         var          filename     = $"{result._content.MenuLink.Replace("-", "").ToLower()}.html";
         var          content      = fileStorage.ReadFile(folderpath, filename);
         topicContent.ContentText = content;
         topicContent.HeaderText  = result._blog.BlogTitle;
         return(topicContent);
     }
 }
Ejemplo n.º 3
0
 public List <Navigation> GetSideMenu(string section)
 {
     using (var context = new Entity.pycloudinEntities())
     {
         var result = (from _content in context.AppMenus
                       where _content.MeneType == "Side" && _content.MenuSection == section
                       select new Navigation
         {
             MenuId = _content.MenuId,
             MenuLink = string.IsNullOrEmpty(_content.MenuLink) ? "NA" : _content.MenuLink,
             MenuText = _content.MenuText,
             MenuSection = _content.MenuSection,
             MeneType = _content.MeneType,
             ParentMenuId = _content.ParentMenuId
         }).ToList();
         return(result);
     }
 }
Ejemplo n.º 4
0
        public List <ListItem> GetArea()
        {
            List <ListItem> returnResult = new List <ListItem>();

            returnResult.Add(new ListItem {
                Text = "Select", Value = ""
            });
            using (var context = new Entity.pycloudinEntities())
            {
                var result = (from _content in context.AppMenus
                              select new { _content.MenuSection }).ToList().Distinct();
                foreach (var item in result)
                {
                    returnResult.Add(new ListItem {
                        Text = item.MenuSection, Value = item.MenuSection
                    });
                }
            }
            return(returnResult);
        }
Ejemplo n.º 5
0
        public List <ListItem> GetBlog(string section)
        {
            List <ListItem> returnResult = new List <ListItem>();

            returnResult.Add(new ListItem {
                Text = "Select", Value = ""
            });
            using (var context = new Entity.pycloudinEntities())
            {
                var result = (from _content in context.AppMenus
                              where _content.MenuLink != null && _content.MenuSection == section
                              select new { _content.MenuText, _content.MenuLink }).ToList().Distinct();
                foreach (var item in result)
                {
                    returnResult.Add(new ListItem {
                        Text = item.MenuText, Value = item.MenuLink
                    });
                }
            }
            return(returnResult);
        }