Exemple #1
0
 public void Put(int id, [FromBody] HtmlTextInfo HtmlText)
 {
     if (ModelState.IsValid)
     {
         htmltext.UpdateHtmlText(HtmlText);
     }
 }
Exemple #2
0
 public HtmlTextInfo Put(int id, [FromBody] HtmlTextInfo HtmlText)
 {
     if (ModelState.IsValid && HtmlText.ModuleId == EntityId)
     {
         HtmlText = htmltext.UpdateHtmlText(HtmlText);
     }
     return(HtmlText);
 }
Exemple #3
0
 public Models.HtmlText Put(int id, [FromBody] Models.HtmlText htmlText)
 {
     if (ModelState.IsValid && AuthEntityId(EntityNames.Module) == htmlText.ModuleId)
     {
         htmlText = _htmlText.UpdateHtmlText(htmlText);
         _logger.Log(LogLevel.Information, this, LogFunction.Update, "Html/Text Updated {HtmlText}", htmlText);
         return(htmlText);
     }
     else
     {
         _logger.Log(LogLevel.Error, this, LogFunction.Security, "Unauthorized HtmlText Put Attempt {HtmlText}", htmlText);
         HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
         return(null);
     }
 }
Exemple #4
0
 public HtmlTextInfo Put(int id, [FromBody] HtmlTextInfo HtmlText)
 {
     try
     {
         if (ModelState.IsValid && HtmlText.ModuleId == _entityId)
         {
             HtmlText = _htmlText.UpdateHtmlText(HtmlText);
             _logger.Log(LogLevel.Information, this, LogFunction.Update, "Html/Text Updated {HtmlText}", HtmlText);
         }
         return(HtmlText);
     }
     catch (Exception ex)
     {
         _logger.Log(LogLevel.Error, this, LogFunction.Update, ex, "Put Error {Error}", ex.Message);
         throw;
     }
 }
 public Models.HtmlText Put(int id, [FromBody] Models.HtmlText htmlText)
 {
     try
     {
         if (ModelState.IsValid && htmlText.ModuleId == _authEntityId[EntityNames.Module])
         {
             htmlText = _htmlText.UpdateHtmlText(htmlText);
             _logger.Log(LogLevel.Information, this, LogFunction.Update, "Html/Text Updated {HtmlText}", htmlText);
         }
         return(htmlText);
     }
     catch (Exception ex)
     {
         _logger.Log(LogLevel.Error, this, LogFunction.Update, ex, "Put 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);
            }
        }