示例#1
0
 public void Post([FromBody] HtmlTextInfo HtmlText)
 {
     if (ModelState.IsValid)
     {
         htmltext.AddHtmlText(HtmlText);
     }
 }
示例#2
0
 public HtmlTextInfo Post([FromBody] HtmlTextInfo HtmlText)
 {
     if (ModelState.IsValid && HtmlText.ModuleId == EntityId)
     {
         HtmlText = htmltext.AddHtmlText(HtmlText);
     }
     return(HtmlText);
 }
 public HtmlTextInfo Post([FromBody] HtmlTextInfo HtmlText)
 {
     if (ModelState.IsValid)
     {
         HtmlText = htmltext.AddHtmlText(HtmlText);
     }
     return(HtmlText);
 }
示例#4
0
        public void ImportModule(Module module, string content, string version)
        {
            content = WebUtility.HtmlDecode(content);
            var htmlText = new Models.HtmlText();

            htmlText.ModuleId = module.ModuleId;
            htmlText.Content  = content;
            _htmlText.AddHtmlText(htmlText);
        }
示例#5
0
 public Models.HtmlText Post([FromBody] Models.HtmlText htmlText)
 {
     if (ModelState.IsValid && AuthEntityId(EntityNames.Module) == htmlText.ModuleId)
     {
         htmlText = _htmlText.AddHtmlText(htmlText);
         _logger.Log(LogLevel.Information, this, LogFunction.Create, "Html/Text Added {HtmlText}", htmlText);
         return(htmlText);
     }
     else
     {
         _logger.Log(LogLevel.Error, this, LogFunction.Security, "Unauthorized HtmlText Post Attempt {HtmlText}", htmlText);
         HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
         return(null);
     }
 }
示例#6
0
 public HtmlTextInfo Post([FromBody] HtmlTextInfo HtmlText)
 {
     try
     {
         if (ModelState.IsValid && HtmlText.ModuleId == _entityId)
         {
             HtmlText = _htmlText.AddHtmlText(HtmlText);
             _logger.Log(LogLevel.Information, this, LogFunction.Create, "Html/Text Added {HtmlText}", HtmlText);
         }
         return(HtmlText);
     }
     catch (Exception ex)
     {
         _logger.Log(LogLevel.Error, this, LogFunction.Create, ex, "Post Error {Error}", ex.Message);
         throw;
     }
 }
 public Models.HtmlText Post([FromBody] Models.HtmlText htmlText)
 {
     try
     {
         if (ModelState.IsValid && htmlText.ModuleId == _authEntityId[EntityNames.Module])
         {
             htmlText = _htmlText.AddHtmlText(htmlText);
             _logger.Log(LogLevel.Information, this, LogFunction.Create, "Html/Text Added {HtmlText}", htmlText);
         }
         return(htmlText);
     }
     catch (Exception ex)
     {
         _logger.Log(LogLevel.Error, this, LogFunction.Create, ex, "Post Error {Error}", ex.Message);
         throw;
     }
 }
 public void ImportModule(Module Module, string Content, string Version)
 {
     Content = WebUtility.HtmlDecode(Content);
     HtmlTextInfo htmltext = htmltexts.GetHtmlText(Module.ModuleId);
     if (htmltext != null)
     {
         htmltext.Content = Content;
         htmltexts.UpdateHtmlText(htmltext);
     }
     else
     {
         htmltext = new HtmlTextInfo();
         htmltext.ModuleId = Module.ModuleId;
         htmltext.Content = Content;
         htmltexts.AddHtmlText(htmltext);
     }
 }
        public void ImportModule(Module module, string content, string version)
        {
            content = WebUtility.HtmlDecode(content);
            HtmlTextInfo htmltext = _htmlTexts.GetHtmlText(module.ModuleId);

            if (htmltext != null)
            {
                htmltext.Content = content;
                _htmlTexts.UpdateHtmlText(htmltext);
            }
            else
            {
                htmltext          = new HtmlTextInfo();
                htmltext.ModuleId = module.ModuleId;
                htmltext.Content  = content;
                _htmlTexts.AddHtmlText(htmltext);
            }
        }