Ejemplo n.º 1
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\r\n<html><body>\r\n<head>\r\n  <link rel=\"stylesheet\" type=\"text/css\" href=\"/Content/d" +
                       "ocument.css\">\r\n</head>\r\n");

            #line 14 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Invoice.tt"
            foreach (ILocation location in Locations)
            {
            #line default
            #line hidden
                this.Write("  \r\n\t<location>\r\n      <span><lbl1>location</lbl1>: ");

            #line 16 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Invoice.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(GetLocationDescription(location)));

            #line default
            #line hidden
                this.Write("</span>\r\n\t</location>\r\n");

            #line 18 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Invoice.tt"
            } // end of foreach

            #line default
            #line hidden
            this.Write("<br/>\r\n");

            #line 20 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Invoice.tt"
            if (LocationAddress != null)
            {
            #line default
            #line hidden
                this.Write(" \r\n\t<span>");

            #line 21 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Invoice.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(LocationAddress.ToShortAddressStr().Replace(", ", @"<br/>")));

            #line default
            #line hidden
                this.Write("</span>\r\n");

            #line 22 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Invoice.tt"
            }//end if

            #line default
            #line hidden
            this.Write(" \r\n<br/>\r\n<span><lbl1>invoice date</lbl1>: ");

            #line 24 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Invoice.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(GetCurrentTimeStr()));

            #line default
            #line hidden
            this.Write("</span>\r\n<br/>\r\n<span><lbl1>bill to</lbl1>: ");

            #line 26 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Invoice.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(User.FirstName));

            #line default
            #line hidden
            this.Write(" ");

            #line 26 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Invoice.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(User.LastName));

            #line default
            #line hidden
            this.Write("</span>\r\n<hr/>\r\n\r\n<center><h2>Invoice</h2></center>\r\n\r\n<table>\r\n");

            #line 32 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Invoice.tt"
            foreach (ProductCreditContract creditContract in Credits.Where(x => x.ProfileCredit.Ballance != 0))
            {
            #line default
            #line hidden
                this.Write("  \r\n      <tr>\r\n\t\t<td>");

            #line 34 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Invoice.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(creditContract.Product.Description));

            #line default
            #line hidden
                this.Write("</td>\r\n\t\t<td></td>\r\n\t\t<td>");

            #line 36 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Invoice.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(creditContract.ProfileCredit.Ballance.ToString("C")));

            #line default
            #line hidden
                this.Write("</td>  \r\n\t  </tr>  \r\n");

            #line 38 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Invoice.tt"
            } // end of foreach

            #line default
            #line hidden
            this.Write("\t<tr>\r\n\t\t<td></td>\r\n\t\t<td><lbl1>total:</lbl1></td>\r\n\t\t<td>");

            #line 42 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Invoice.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Credits.Sum(x => x.ProfileCredit.Ballance).ToString("C")));

            #line default
            #line hidden
            this.Write("</td>\r\n\t</tr>\r\n</table>\r\n\r\n</body></html>  ");
            return(this.GenerationEnvironment.ToString());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\r\n<html><body>\r\n<head>\r\n  <link rel=\"stylesheet\" type=\"text/css\" href=\"/Content/d" +
                       "ocument.css\">\r\n</head>\r\n\r\n");

            #line 15 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Receipt.tt"
            foreach (ILocation location in Locations)
            {
            #line default
            #line hidden
                this.Write("  \r\n\t<location>\r\n      <span><lbl1>location</lbl1>: ");

            #line 17 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Receipt.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(GetLocationDescription(location)));

            #line default
            #line hidden
                this.Write("</span>\r\n\t</location>\r\n");

            #line 19 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Receipt.tt"
            } // end of foreach

            #line default
            #line hidden
            this.Write("<br/>\r\n");

            #line 21 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Receipt.tt"
            if (LocationAddress != null)
            {
            #line default
            #line hidden
                this.Write(" \r\n\t<span>");

            #line 22 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Receipt.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(LocationAddress.ToShortAddressStr().Replace(", ", @"<br/>")));

            #line default
            #line hidden
                this.Write("</span>\r\n");

            #line 23 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Receipt.tt"
            }//end if

            #line default
            #line hidden
            this.Write(" \r\n<br/>\r\n<span><lbl1>invoice date</lbl1>: ");

            #line 25 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Receipt.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(GetCurrentTimeStr()));

            #line default
            #line hidden
            this.Write("</span>\r\n<br/>\r\n<span><lbl1>bill to</lbl1>: ");

            #line 27 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Receipt.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(User.FirstName));

            #line default
            #line hidden
            this.Write(" ");

            #line 27 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Receipt.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(User.LastName));

            #line default
            #line hidden
            this.Write("</span>\r\n<hr/>\r\n\r\n<center><h2>Receipt</h2></center>\r\n\r\n<table>\r\n");

            #line 33 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Receipt.tt"
            foreach (ICreditTransaction trn in CreditTransactions)
            {
            #line default
            #line hidden
                this.Write("  \r\n      <tr>\r\n\t\t<td>");

            #line 35 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Receipt.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(Products.First(x => x.ProductId == trn.ProductId).Description));

            #line default
            #line hidden
                this.Write("</td>\r\n\t\t<td>");

            #line 36 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Receipt.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(trn.BallanceUnits > 1 ? " x " + Convert.ToString(trn.BallanceUnits) : string.Empty));

            #line default
            #line hidden
                this.Write("</td>\r\n\t\t<td>");

            #line 37 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Receipt.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture((Prices.First(x => x.ProductId == trn.ProductId).Price *trn.BallanceUnits).ToString("C")));

            #line default
            #line hidden
                this.Write("</td>  \r\n\t  </tr>  \r\n");

            #line 39 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Receipt.tt"
            } // end of foreach

            #line default
            #line hidden
            this.Write("\t<tr>\r\n\t\t<td></td>\r\n\t\t<td><lbl1>total:</lbl1></td>\r\n\t\t<td>");

            #line 43 "C:\GIT\MembershipCashier\MembershipCashierW\Code\Documents\DocumentTemplates\Receipt.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(GetTotal().ToString("C")));

            #line default
            #line hidden
            this.Write("</td>\r\n\t</tr>\r\n</table>\r\n\r\n</body></html>  ");
            return(this.GenerationEnvironment.ToString());
        }