updated wrapper

updated SQLBase to add new HTML formatting functions
net6.0
Don Oerkfitz 4 years ago
parent 52f0f8f52c
commit bdaeac6f3e

@ -26,7 +26,7 @@ namespace Common.Library.DataLayer.DAO.Websites.JasonNeumannAudio.com
item = new() item = new()
{ {
AboutPageID = GetInt("AboutPageID").Value, AboutPageID = GetInt("AboutPageID").Value,
AboutPageText = GetString("AboutPageText").Replace("\\r\\n", "<br/><br/>") AboutPageText = FormatNewLineForHTML(GetString("AboutPageText"), 2)
}; };
} }

@ -30,7 +30,7 @@ namespace Common.Library.DataLayer.DAO.Websites.JasonNeumannAudio.com
WorkPageTypeID = (WorkPageDTO.WorkPageType)GetInt("WorkPageTypeID").Value, WorkPageTypeID = (WorkPageDTO.WorkPageType)GetInt("WorkPageTypeID").Value,
WorkPageName = GetString("WorkPageName"), WorkPageName = GetString("WorkPageName"),
WorkPageLink = GetString("WorkPageLink"), WorkPageLink = GetString("WorkPageLink"),
WorkPageValue = GetString("WorkPageValue") WorkPageValue = FormatBoldForHTML(GetString("WorkPageValue"))
}; };
} }
@ -66,7 +66,7 @@ namespace Common.Library.DataLayer.DAO.Websites.JasonNeumannAudio.com
WorkPageTypeID = (WorkPageDTO.WorkPageType)GetInt("WorkPageTypeID").Value, WorkPageTypeID = (WorkPageDTO.WorkPageType)GetInt("WorkPageTypeID").Value,
WorkPageName = GetString("WorkPageName"), WorkPageName = GetString("WorkPageName"),
WorkPageLink = GetString("WorkPageLink"), WorkPageLink = GetString("WorkPageLink"),
WorkPageValue = GetString("WorkPageValue") WorkPageValue = FormatBoldForHTML(GetString("WorkPageValue"))
}; };
items.Add(item); items.Add(item);

@ -1,4 +1,5 @@
using System; using System;
using System.Text;
namespace Common.Library.SQL.Base namespace Common.Library.SQL.Base
{ {
@ -51,6 +52,27 @@ namespace Common.Library.SQL.Base
// free native resources if there are any. // free native resources if there are any.
} }
protected string FormatNewLineForHTML(string input)
{
return input.Replace("\\r\\n", "<br/>");
}
protected string FormatNewLineForHTML(string input, int numberOfBreaksToAdd)
{
StringBuilder breaks = new();
for (int x = 0; x < numberOfBreaksToAdd; x++)
{
breaks.Append("<br/>");
}
return input.Replace("\\r\\n", breaks.ToString());
}
protected string FormatBoldForHTML(string input)
{
return input.Replace("[b]", "<strong>").Replace("[/b]", "</strong>");
}
protected abstract void InitConnection(); protected abstract void InitConnection();
protected abstract void DisposeConnection(); protected abstract void DisposeConnection();

@ -32,7 +32,7 @@ namespace Common.Library.TMDB
posterLink = container.TvResults[0].PosterPath; posterLink = container.TvResults[0].PosterPath;
} }
return $"https://www.themoviedb.org/t/p/original{posterLink}"; return !string.IsNullOrWhiteSpace(posterLink) ? $"https://www.themoviedb.org/t/p/original{posterLink}" : null;
} }
public List<string> GetPosterLinks(List<string> imdbIDs) public List<string> GetPosterLinks(List<string> imdbIDs)

Loading…
Cancel
Save