Пример #1
0
        public void ExportToHtml(string outputPath, bool overwrite)
        {
            File.Copy(@".\UI\Resource\HTML_Template\MyPopupStore_ReportTemplate.html", outputPath, overwrite);

            string textHtml = File.ReadAllText(outputPath);

            textHtml = textHtml.Replace("MyPopupStore_Title", InfoServices.GetPopupStoreInfo().PopupStoreName);
            textHtml = textHtml.Replace("MyPopupStore_Interval", $"{Start.ToString("dd MMMM yyyy")} - {End.ToString("dd MMMM yyyy")}");
            textHtml = textHtml.Replace("MyPopupStore_LineProduct", WriteLinesOfTable(CollectProduct()));
            textHtml = textHtml.Replace("MyPopupStore_Total", SaleServices.GetTotal(Start, End).ToString());

            File.WriteAllText(outputPath, textHtml);
        }