Exemplo n.º 1
0
 public ActionResult Article(int? id, string keywords, int? page)
 {
     ((dynamic) base.ViewBag).Keywords = Globals.HtmlDecode(keywords);
     if (this.WebSiteSet != null)
     {
         ((dynamic) base.ViewBag).Title = Globals.HtmlDecode(this.WebSiteSet.WebTitle) + "-" + Globals.HtmlDecode(this.WebSiteSet.WebName);
         ((dynamic) base.ViewBag).Description = Globals.HtmlDecode(this.WebSiteSet.Description);
     }
     ((dynamic) base.ViewBag).Domain = this.WebSiteSet.BaseHost;
     ((dynamic) base.ViewBag).WebName = this.WebSiteSet.WebName;
     ((dynamic) base.ViewBag).HotWordss = keywords;
     if (keywords == null)
     {
         return base.View();
     }
     if (keywords.Length > 0x19)
     {
         return base.View();
     }
     Maticsoft.BLL.CMS.Content content = new Maticsoft.BLL.CMS.Content();
     int pageSize = 10;
     page = new int?((page.HasValue && (page.Value > 1)) ? page.Value : 1);
     int startIndex = (page.Value > 1) ? (((page.Value - 1) * pageSize) + 1) : 0;
     int endIndex = page.Value * pageSize;
     int recordCount = content.GetRecordCount(id, keywords);
     PagedList<Maticsoft.Model.CMS.Content> model = null;
     List<Maticsoft.Model.CMS.Content> list2 = content.GetList(id, startIndex, endIndex, keywords);
     string valueByCache = ConfigSystem.GetValueByCache("ArticleIsStatic");
     List<Maticsoft.Model.CMS.Content> items = new List<Maticsoft.Model.CMS.Content>();
     string str2 = ConfigSystem.GetValueByCache("MainArea");
     if ((list2 != null) && (list2.Count > 0))
     {
         foreach (Maticsoft.Model.CMS.Content content2 in list2)
         {
             if (valueByCache == "true")
             {
                 content2.SeoUrl = PageSetting.GetCMSUrl(content2.ContentID, "CMS", ApplicationKeyType.CMS);
             }
             else if (str2 == "CMS")
             {
                 content2.SeoUrl = "/Article/Details/" + content2.ContentID;
             }
             else
             {
                 content2.SeoUrl = "/CMS/Article/Details/" + content2.ContentID;
             }
             items.Add(content2);
         }
     }
     if ((items != null) && (items.Count > 0))
     {
         int? nullable = page;
         model = new PagedList<Maticsoft.Model.CMS.Content>(items, nullable.HasValue ? nullable.GetValueOrDefault() : 1, pageSize, recordCount);
     }
     if (base.Request.IsAjaxRequest())
     {
         return this.PartialView("~/Areas/CMS/Themes/Default/Views/Partial/UCjQuerySearchList.cshtml", model);
     }
     return base.View(model);
 }
Exemplo n.º 2
0
 public ActionResult HotArticles()
 {
     List<Maticsoft.Model.CMS.Content> modelList = new Maticsoft.BLL.CMS.Content().GetModelList();
     List<Maticsoft.Model.CMS.Content> model = new List<Maticsoft.Model.CMS.Content>();
     if (modelList != null)
     {
         string valueByCache = ConfigSystem.GetValueByCache("ArticleIsStatic");
         string str2 = ConfigSystem.GetValueByCache("MainArea");
         foreach (Maticsoft.Model.CMS.Content content2 in modelList)
         {
             if (valueByCache == "true")
             {
                 content2.SeoUrl = PageSetting.GetCMSUrl(content2.ContentID, "CMS", ApplicationKeyType.CMS);
             }
             else if (str2 == "CMS")
             {
                 content2.SeoUrl = "/Article/Details/" + content2.ContentID;
             }
             else
             {
                 content2.SeoUrl = "/CMS/Article/Details/" + content2.ContentID;
             }
             model.Add(content2);
         }
     }
     return base.View(model);
 }
Exemplo n.º 3
0
 public ActionResult List(int? cid, int? page)
 {
     Maticsoft.BLL.CMS.Content content = new Maticsoft.BLL.CMS.Content();
     ((dynamic) base.ViewBag).Domain = this.WebSiteSet.BaseHost;
     ((dynamic) base.ViewBag).WebName = this.WebSiteSet.WebName;
     Maticsoft.BLL.CMS.ContentClass class2 = new Maticsoft.BLL.CMS.ContentClass();
     if (cid.HasValue)
     {
         Maticsoft.Model.CMS.ContentClass modelByCache = class2.GetModelByCache(cid.Value);
         if (modelByCache != null)
         {
             ((dynamic) base.ViewBag).Title = Globals.HtmlDecode(modelByCache.ClassName);
             ((dynamic) base.ViewBag).Keywords = Globals.HtmlDecode(modelByCache.Keywords);
             ((dynamic) base.ViewBag).Description = Globals.HtmlDecode(modelByCache.Description);
             if (this.WebSiteSet != null)
             {
                 dynamic viewBag = base.ViewBag;
                 string str3 = "-" + Globals.HtmlDecode(this.WebSiteSet.WebName);
                 if (<List>o__SiteContainer0.<>p__Site6 == null)
                 {
Exemplo n.º 4
0
 public ActionResult List()
 {
     if (this.WebSiteSet == null)
     {
         return base.View();
     }
     SyndicationFeed feed = new SyndicationFeed(Globals.HtmlDecode(this.WebSiteSet.WebTitle) + "-" + Globals.HtmlDecode(this.WebSiteSet.WebName), Globals.HtmlDecode(this.WebSiteSet.Description), new Uri(Globals.HtmlDecode(this.WebSiteSet.BaseHost)), "Maticsoft", DateTime.Now);
     DataSet rssList = new Content().GetRssList();
     if (!DataSetTools.DataSetIsNull(rssList))
     {
         List<SyndicationItem> list = new List<SyndicationItem>();
         foreach (DataRow row in rssList.Tables[0].Rows)
         {
             string id = Globals.SafeString(row["ContentID"], "");
             SyndicationItem item = new SyndicationItem(Globals.HtmlDecode(Globals.SafeString(row["Title"], "")), Globals.SafeString(row["Description"], ""), new Uri(string.Format(Globals.HtmlDecode(this.WebSiteSet.BaseHost) + "/Article/Details/{0}", id)), id, Globals.SafeDateTime(Globals.SafeString(row["CreatedDate"], ""), DateTime.Now));
             list.Add(item);
         }
         feed.Items = list;
     }
     return new RssActionResult { Feed = feed };
 }
Exemplo n.º 5
0
 public static string GetCMSUrl(int NewId, string pageName = "CMS", ApplicationKeyType applicationType = 4)
 {
     Maticsoft.BLL.CMS.Content content = new Maticsoft.BLL.CMS.Content();
     Maticsoft.Model.CMS.Content modelByCache = content.GetModelByCache(NewId);
     Maticsoft.BLL.CMS.ContentClass class2 = new Maticsoft.BLL.CMS.ContentClass();
     if (modelByCache != null)
     {
         string str = content.GetContentUrl(modelByCache) + ".html";
         string valueByCache = ConfigSystem.GetValueByCache("ArticleStaticRoot");
         valueByCache = (valueByCache.LastIndexOf("/") > -1) ? valueByCache : (valueByCache + "/");
         return (valueByCache + class2.GetClassUrl(modelByCache.ClassID) + "/" + str).Replace("--", "-").ToLower();
     }
     return "";
 }
Exemplo n.º 6
0
 public PartialViewResult NewsList(string viewName, int ClassID, int Top)
 {
     List<Content> modelList = new Content().GetModelList(ClassID, Top);
     return this.PartialView(viewName, modelList);
 }
Exemplo n.º 7
0
 public ActionResult Details(int id)
 {
     Maticsoft.BLL.CMS.Content content = new Maticsoft.BLL.CMS.Content();
     Maticsoft.Model.CMS.Content modelExByCache = content.GetModelExByCache(id);
     if (modelExByCache != null)
     {
         ((dynamic) base.ViewBag).ArticleId = id;
         ((dynamic) base.ViewBag).Title = Globals.HtmlDecode(modelExByCache.Title);
         if (this.WebSiteSet != null)
         {
             dynamic viewBag = base.ViewBag;
             string str = "-" + Globals.HtmlDecode(this.WebSiteSet.WebName);
             if (<Details>o__SiteContainer9.<>p__Sitec == null)
             {
Exemplo n.º 8
0
 public ActionResult ArticleLeft()
 {
     int classID = Globals.SafeInt(ConfigSystem.GetValueByCache("SNSHelpCenter"), 1);
     List<Maticsoft.Model.CMS.Content> modelList = new Maticsoft.BLL.CMS.Content().GetModelList(classID);
     return base.View(modelList);
 }
Exemplo n.º 9
0
 private void DeleteAttachment(HttpRequest Request, HttpResponse Response)
 {
     Response.Charset = "utf-8";
     if (!string.IsNullOrWhiteSpace(Request.Params["ContentID"]))
     {
         int contentID = 0;
         if (!string.IsNullOrWhiteSpace(Request.Params["ContentID"]))
         {
             contentID = Globals.SafeInt(Request.Params["ContentID"], 0);
         }
         Maticsoft.BLL.CMS.Content content = new Maticsoft.BLL.CMS.Content();
         Maticsoft.Model.CMS.Content model = content.GetModel(contentID);
         if (model != null)
         {
             model.Attachment = null;
             if (content.Update(model))
             {
                 Response.Write("SUCCESS");
             }
             else
             {
                 Response.Write("FAILED");
             }
         }
         else
         {
             Response.Write("FAILED");
         }
     }
 }
Exemplo n.º 10
0
 public PartialViewResult HotComment(int ClassId = 0, int Top = 10, string comType = "day", string ViewName = "_HotComment")
 {
     List<Maticsoft.Model.CMS.Content> hotCom = new Maticsoft.BLL.CMS.Content().GetHotCom(comType, Top);
     return this.PartialView(ViewName, hotCom);
 }
Exemplo n.º 11
0
 public PartialViewResult CMSArticle(int ClassId = 0, Maticsoft.Model.CMS.EnumHelper.ContentRec Rec = 0, int Top = 6, string ViewName = "_CMSArticle")
 {
     List<Maticsoft.Model.CMS.Content> model = new Maticsoft.BLL.CMS.Content().GetRecList(ClassId, Rec, Top, true);
     return this.PartialView(ViewName, model);
 }
Exemplo n.º 12
0
 public PartialViewResult ContentList(string viewName, int ClassID, int Top)
 {
     List<Content> modelList = new Content().GetModelList(ClassID, Top);
     ((dynamic) base.ViewBag).contentclassName = this.contentclassBll.GetClassnameById(ClassID);
     return this.PartialView(viewName, modelList);
 }