Created the first version of HTML code for the front form. Changed to the Pechkin HTML to PDF library. Removed the string tester. Fixed a bug with the main form where the APC tables would not be sorted by row position.

This commit is contained in:
2017-05-02 23:38:00 -05:00
parent ba5808443b
commit 218d5be4d6
36 changed files with 560 additions and 1502 deletions
+26 -5
View File
@@ -3,8 +3,8 @@ using System.Data;
using System.Windows.Forms;
using System.IO;
using System.Drawing.Imaging;
using System.Linq;
using System.Web.UI;
using TheArtOfDev.HtmlRenderer.WinForms;
namespace AdvertsingProfitControl
{
@@ -22,9 +22,9 @@ namespace AdvertsingProfitControl
try
{
var imageFromHtml = HtmlRender.RenderToImage(code);
imageFromHtml.Save(Application.StartupPath + "\\BackPage.png", ImageFormat.Png);
imageFromHtml.Dispose();
//var imageFromHtml = HtmlRender.RenderToImage(code);
//imageFromHtml.Save(Application.StartupPath + "\\BackPage.png", ImageFormat.Png);
//imageFromHtml.Dispose();
}
catch (Exception e)
{
@@ -36,7 +36,28 @@ namespace AdvertsingProfitControl
}
}
public void GenerateWeeklyInventoryControlPage(int dateId)
public void RenderHtmlCodeToImage(string path, string targetPath)
{
var htmlCode = File.ReadAllLines(path);
var code = htmlCode.Aggregate("", (current, line) => current + "\r\n" + line);
try
{
//var imageFromHtml = HtmlRender.RenderToImage(code);
//imageFromHtml.Save(targetPath, ImageFormat.Png);
//imageFromHtml.Dispose();
}
catch (Exception e)
{
_console.WriteToLog(FrmLogConsole.Level.Critical,
"Failed to generate an updated image for the back page of Advertising Profit Control.");
_console.WriteToLog(FrmLogConsole.Level.Debug, e.Message);
_console.WriteToLog(FrmLogConsole.Level.Info, "This is most likely a screw you from the GDI+ subsystem of Windows.");
}
}
public void GenerateWeeklyInventoryControlPage(int dateId)
{
//var databaseTracker = new DatabaseTracker();
//var databaseReader = new DatabaseReader();