示例#1
0
        private string getHtmlDocument()
        {
            string template = File.ReadAllText("Printing/PlanDayPrinting.cshtml");
            var    model    = new ShippingListPrintModel()
            {
                Plan = Plan
            };

            string html;

            if (Engine.Razor.IsTemplateCached("planday", typeof(ShippingListPrintModel)))
            {
                html = Engine.Razor.RunCompile("planday", typeof(ShippingListPrintModel), model);
            }
            else
            {
                html = Engine.Razor.RunCompile(template, "planday", typeof(ShippingListPrintModel), model);
            }
            return(html);
        }
示例#2
0
        private string getHtmlDocument()
        {
            string template = File.ReadAllText("Printing/ShoppingListTemplate.cshtml");

            var model = new ShippingListPrintModel()
            {
                Items = Items
            };

            string html;

            if (Engine.Razor.IsTemplateCached("shopping", typeof(ShippingListPrintModel)))
            {
                html = Engine.Razor.RunCompile("shopping", typeof(ShippingListPrintModel), model);
            }
            else
            {
                html = Engine.Razor.RunCompile(template, "shopping", typeof(ShippingListPrintModel), model);
            }
            return(html);
        }