Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>My Report</title>
- </head>
- <body>
- <% foreach (ReportRow r in ReportData) { %>
- <!-- Markup and Code for Report -->
- <% } %>
- </body>
- </html>
- <viewdata products="IEnumerable[[Product]]"/>
- <ul if="products.Any()">
- <li each="var p in products">${p.Name}</li>
- </ul>
- <else>
- <p>No products available</p>
- </else>
- <script type="text/html" id="item_tmpl">
- <div id="<%=id%>" class="<%=(i % 2 == 1 ? " even" : "")%>">
- <div class="grid_1 alpha right">
- <img class="righted" src="<%=profile_image_url%>"/>
- </div>
- <div class="grid_6 omega contents">
- <p><b><a href="/<%=from_user%>"><%=from_user%></a>:</b> <%=text%></p>
- </div>
- </div>
- </script>
- Dear $User.FullName$,
- {%set orders=User.GetOrders() /}
- Thank you for your order of $orders.Length$ items, We believe you will be very satisfied with the quality of costume pieces included in each. It is this quality that makes our imaginative play apparel so unique.
- We created an account for you to track your orders. Here is the login information:
- Email: $User.EmailAddress$
- Password: $User.Password$
- Following is the details of your order (OrderId: $OrderId$):
- # Part ID Name Quantity Price(per unit) Sub Total
- {%set Total=0.0 /}{%foreach orderproduct,i in orders%}{%set Total = Total + orderproduct.Price * orderproduct.Quantity/}
- {%rendertemplate orderproducttemplate item=orderproduct/}{$foreach%}
- Total: $PadLeft(Format(Total,"$$#.##"),11)$
- If you have any concern, please call us at 913-555-0115.
- Sincerely,
- $CompanyName$
- {%template orderproducttemplate%}$PadLeft(i,4)$$PadLeft(item.PartId, 7)$ $PadRight(item.ProductName, 15)$ $PadRight(item.Quantity, 5)$ $PadLeft(Format(item.Price,"$$#.##"), 7)$ $PadLeft(Format(item.Price*item.Quantity,"$$#.##"), 12)${$template%}
- Dear John Borders,
- Thank you for your order of 3 items, We believe you will be very satisfied with the quality of costume pieces included in each. It is this quality that makes our imaginative play apparel so unique.
- We created an account for you to track your orders. Here is the login information:
- Email: [email protected]
- Password: 123abc
- Following is the details of your order (OrderId: 1625DGHJ):
- # Part ID Name Quantity Price(per unit) Sub Total
- 0 1239 Product A 3 $104.09 $312.27
- 1 22 Product B 1 $134.09 $134.09
- 2 167 Product C 5 $14.7 $73.5
- Total: $519.86
- If you have any concern, please call us at 913-555-0115.
- Sincerely,
- My Company Name
- class OrderProduct
- {
- private int _partId;
- private string _productName;
- private int _quantity;
- private float _price;
- public int PartId
- {
- get { return _partId; }
- set { _partId = value; }
- }
- public string ProductName
- {
- get { return _productName; }
- set { _productName = value; }
- }
- public int Quantity
- {
- get { return _quantity; }
- set { _quantity = value; }
- }
- public float Price
- {
- get { return _price; }
- set { _price = value; }
- }
- }
- class User
- {
- private string _fullName;
- private string _emailAddress;
- private string _password;
- public string FullName
- {
- get { return _fullName; }
- set { _fullName = value; }
- }
- public string EmailAddress
- {
- get { return _emailAddress; }
- set { _emailAddress = value; }
- }
- public string Password
- {
- get { return _password; }
- set { _password = value; }
- }
- public OrderProduct[] GetOrders()
- {
- OrderProduct[] ops = new OrderProduct[3];
- ops[0] = new OrderProduct();
- ops[0].PartId = 1239;
- ops[0].Price = 104.09f;
- ops[0].ProductName = "Product A";
- ops[0].Quantity = 3;
- ops[1] = new OrderProduct();
- ops[1].PartId = 22;
- ops[1].Price = 134.09f;
- ops[1].ProductName = "Product B";
- ops[1].Quantity = 1;
- ops[2] = new OrderProduct();
- ops[2].PartId = 167;
- ops[2].Price = 14.7f;
- ops[2].ProductName = "Product C";
- ops[2].Quantity = 5;
- return ops;
- }
- }
- private void btnRun_Click(object sender, EventArgs e)
- {
- try
- {
- dt.LoadFromString(txtSource.Text);
- dt.SetValue("CompanyName", "My Company Name");
- User u = new User();
- u.EmailAddress = "[email protected]";
- u.FullName = "John Borders";
- u.Password = "123abc";
- dt.SetValue("User", u);
- dt.SetValue("OrderId", "1625DGHJ");
- txtOutput.Text = dt.Run();
- }
- catch (Exception exc)
- {
- MessageBox.Show("An error occurred: " + exc.Message);
- }
- }
Add Comment
Please, Sign In to add comment