本文整理汇总了C#中MerchantTribe.Commerce.Orders.Order.TotalsAsTable方法的典型用法代码示例。如果您正苦于以下问题:C# Order.TotalsAsTable方法的具体用法?C# Order.TotalsAsTable怎么用?C# Order.TotalsAsTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MerchantTribe.Commerce.Orders.Order
的用法示例。
在下文中一共展示了Order.TotalsAsTable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PopulateFromOrder
private void PopulateFromOrder(Order o)
{
// Header
this.OrderNumberField.Text = o.OrderNumber;
this.TimeOfOrderField.Text = TimeZoneInfo.ConvertTimeFromUtc(o.TimeOfOrderUtc, MTApp.CurrentStore.Settings.TimeZone).ToString();
// Fraud Score Display
if (o.FraudScore < 0) this.lblFraudScore.Text = "No Fraud Score Data";
if (o.FraudScore >= 0 && o.FraudScore < 3) this.lblFraudScore.Text = o.FraudScore.ToString() + "<span class=\"fraud-low\"><b>low risk</b></span>";
if (o.FraudScore >= 3 && o.FraudScore <= 5) this.lblFraudScore.Text = "<span class=\"fraud-medium\"><b>medium risk</b></span>";
if (o.FraudScore > 5) this.lblFraudScore.Text = "<span class=\"fraud-high\"><b>high risk</b></span>";
// Billing
this.BillingAddressField.Text = o.BillingAddress.ToHtmlString();
//Email
this.EmailAddressField.Text = MerchantTribe.Commerce.Utilities.MailServices.MailToLink(o.UserEmail, "Order " + o.OrderNumber, o.BillingAddress.FirstName + ",");
// Shipping (hide if the same as billing address)
this.pnlShipTo.Visible = true;
this.ShippingAddressField.Text = o.ShippingAddress.ToHtmlString();
// Payment
OrderPaymentSummary paySummary = MTApp.OrderServices.PaymentSummary(o);
this.lblPaymentSummary.Text = paySummary.PaymentsSummary;
this.PaymentAuthorizedField.Text = string.Format("{0:C}", paySummary.AmountAuthorized);
this.PaymentChargedField.Text = string.Format("{0:C}", paySummary.AmountCharged);
this.PaymentDueField.Text = string.Format("{0:C}", paySummary.AmountDue);
this.PaymentRefundedField.Text = string.Format("{0:C}", paySummary.AmountRefunded);
//Items
this.ItemsGridView.DataSource = o.Items;
this.ItemsGridView.DataBind();
// Instructions
if (o.Instructions.Trim().Length > 0)
{
this.pnlInstructions.Visible = true;
this.InstructionsField.Text = o.Instructions.Replace("\r\n", "<br />").Replace("\r", "<br />").Replace("\n", "<br />");
}
// Totals
this.litTotals.Text = o.TotalsAsTable();
// Coupons
this.CouponField.Text = string.Empty;
for (int i = 0; i <= o.Coupons.Count - 1; i++)
{
this.CouponField.Text += o.Coupons[i].CouponCode.Trim().ToUpper() + "<br />";
}
// Notes
Collection<OrderNote> publicNotes = new Collection<OrderNote>();
Collection<OrderNote> privateNotes = new Collection<OrderNote>();
for (int i = 0; i <= o.Notes.Count - 1; i++)
{
if (o.Notes[i].IsPublic)
{
publicNotes.Add(o.Notes[i]);
}
else
{
privateNotes.Add(o.Notes[i]);
}
}
this.PublicNotesField.DataSource = publicNotes;
this.PublicNotesField.DataBind();
this.PrivateNotesField.DataSource = privateNotes;
this.PrivateNotesField.DataBind();
}
示例2: PopulateFromOrder
private void PopulateFromOrder(Order o)
{
// Header
this.OrderNumberField.Text = o.OrderNumber;
this.TimeOfOrderField.Text = TimeZoneInfo.ConvertTimeFromUtc(o.TimeOfOrderUtc, MTApp.CurrentStore.Settings.TimeZone).ToString();
// Billing
this.BillingAddressEditor.LoadFromAddress(o.BillingAddress);
//Email
this.UserPicker1.UserName = o.UserEmail;
// Shipping (hide if the same as billing address)
this.ShippingAddressEditor.LoadFromAddress(o.ShippingAddress);
// Payment
OrderPaymentSummary paySummary = MTApp.OrderServices.PaymentSummary(o);
this.lblPaymentSummary.Text = paySummary.PaymentsSummary;
this.PaymentAuthorizedField.Text = string.Format("{0:C}", paySummary.AmountAuthorized);
this.PaymentChargedField.Text = string.Format("{0:C}", paySummary.AmountCharged);
this.PaymentDueField.Text = string.Format("{0:C}", paySummary.AmountDue);
this.PaymentRefundedField.Text = string.Format("{0:C}", paySummary.AmountRefunded);
//Items
this.ItemsGridView.DataSource = o.Items;
this.ItemsGridView.DataBind();
// Instructions
this.pnlInstructions.Visible = true;
this.InstructionsField.Text = o.Instructions.Replace("\r\n", "<br />").Replace("\r", "<br />").Replace("\n", "<br />");
// Totals
this.litTotals.Text = o.TotalsAsTable();
if (o.TotalShippingBeforeDiscountsOverride >= 0)
{
this.ShippingOverride.Text = o.TotalShippingBeforeDiscountsOverride.ToString("C");
}
else
{
this.ShippingOverride.Text = string.Empty;
}
// Coupons
this.lstCoupons.DataSource = o.Coupons;
this.lstCoupons.DataBind();
LoadShippingMethods(o);
}