public static string GetHtml(string key) { Durados.Web.Mvc.View htmlView = GetHtmlView(); DataRow htmlRow = htmlView.GetDataRow(key); if (htmlRow == null) { return(string.Empty); } return(HttpContext.Current.Server.HtmlDecode(htmlView.GetDisplayValue(GetHtmlFieldName(), htmlRow))); }
public static string GetContent(string key) { string content = GetHtml(key); if (string.IsNullOrEmpty(content)) { Durados.Web.Mvc.View htmlView = GetMainHtmlView(); DataRow htmlRow = htmlView.GetDataRow(key); if (htmlRow == null) { return(string.Empty); } content = HttpContext.Current.Server.HtmlDecode(htmlView.GetDisplayValue(GetHtmlFieldName(), htmlRow)); } return(content); }
public static void SetHtml(string key, string value) { Durados.Web.Mvc.View htmlView = GetHtmlView(); DataRow htmlRow = htmlView.GetDataRow(key); if (htmlRow == null) { if (htmlView.AllowCreate) { Dictionary <string, object> values = new Dictionary <string, object>(); values.Add("Name", key); values.Add("Text", value); htmlView.Create(values); } else { htmlView.AllowCreate = true; try { Dictionary <string, object> values = new Dictionary <string, object>(); values.Add("Name", key); values.Add("Text", value); htmlView.Create(values); } catch { }; htmlView.AllowCreate = false; } } else { Dictionary <string, object> values = new Dictionary <string, object>(); values.Add("Text", value); htmlView.Edit(values, key, null, null, null, null); } }