Ejemplo n.º 1
0
 public ActionDetails Update(Enums.SitePages type, string siteDomain, string content)
 {
     try
     {
         var res = dba.SitePages.Where(p => p.DomainId == siteDomain && p.PageType == (int)type).FirstOrDefault();
         if (res == null)
         {
             dba.SitePages.Add(new Poco.SitePage {
                 ContentInfo = content,
                 DomainId    = siteDomain,
                 PageType    = (int)type
             });
         }
         else
         {
             res.ContentInfo = content;
         }
         dba.SaveChanges();
         return(ResponseMessage.Success());
     }
     catch (Exception ex)
     {
         return(ResponseMessage.Error(ex));
     }
 }
Ejemplo n.º 2
0
 public JsonResult UpdateSitePageContent(Enums.SitePages type, string content)
 {
     return(new JsonContractResult
     {
         Data = siteService.Update(type, "446475", content)
     });
 }
Ejemplo n.º 3
0
 public JsonResult ReadSitePageContent(Enums.SitePages type)
 {
     return(new JsonContractResult
     {
         Data = siteService.ReadContent(type, "446475")
     });
 }
Ejemplo n.º 4
0
 public ActionDetails ReadContent(Enums.SitePages type, string siteDomain)
 {
     try
     {
         string content = string.Empty;
         var    res     = dba.SitePages.Where(p => p.DomainId == siteDomain && p.PageType == (int)type).FirstOrDefault();
         return(ResponseMessage.Success(content: (res == null) ? "" : res.ContentInfo.ToString()));
     }
     catch (Exception ex)
     {
         return(ResponseMessage.Error(ex));
     }
 }