本文整理汇总了C#中MerchantTribe.Commerce.Orders.Order类的典型用法代码示例。如果您正苦于以下问题:C# Order类的具体用法?C# Order怎么用?C# Order使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Order类属于MerchantTribe.Commerce.Orders命名空间,在下文中一共展示了Order类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: LoadOrder
private void LoadOrder()
{
o = MTApp.OrderServices.Orders.FindForCurrentStore(Request.QueryString["id"]);
if (o != null)
{
this.lblOrderNumber.Text = "Order " + o.OrderNumber + " ";
this.ShippingAddressField.Text = o.ShippingAddress.ToHtmlString();
this.ShippingTotalLabel.Text = o.TotalShippingAfterDiscounts.ToString("c");
this.ItemsGridView.DataSource = o.Items;
this.ItemsGridView.DataBind();
this.PackagesGridView.DataSource = o.FindShippedPackages();
this.PackagesGridView.DataBind();
//this.SuggestedPackagesGridView.DataSource = o.FindSuggestedPackages();
//this.SuggestedPackagesGridView.DataBind();
this.UserSelectedShippingMethod.Text = "User Selected Shipping Method: <b>" + o.ShippingMethodDisplayName + "</b>";
//if (this.lstShippingProvider.Items.FindByValue(o.ShippingProviderId) != null) {
// this.lstShippingProvider.ClearSelection();
// this.lstShippingProvider.Items.FindByValue(o.ShippingProviderId).Selected = true;
// LoadServiceCodes();
// this.lstServiceCode.SelectedValue = o.ShippingProviderServiceCode;
//}
}
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:28,代码来源:ShipOrder.aspx.cs
示例2: CanAddItemToOrderAndCalculate
public void CanAddItemToOrderAndCalculate()
{
RequestContext c = new RequestContext();
MerchantTribeApplication app = MerchantTribeApplication.InstantiateForMemory(c);
c.CurrentStore = new Accounts.Store();
c.CurrentStore.Id = 1;
Order target = new Order();
LineItem li = new LineItem() { BasePricePerItem = 19.99m,
ProductName = "Sample Product",
ProductSku = "ABC123",
Quantity = 2 };
target.Items.Add(li);
app.CalculateOrder(target);
Assert.AreEqual(39.98m, target.TotalOrderBeforeDiscounts, "SubTotal was Incorrect");
Assert.AreEqual(39.98m, target.TotalGrand, "Grand Total was incorrect");
bool upsertResult = app.OrderServices.Orders.Upsert(target);
Assert.IsTrue(upsertResult, "Order Upsert Failed");
Assert.AreEqual(c.CurrentStore.Id, target.StoreId, "Order store ID was not set correctly");
Assert.AreNotEqual(string.Empty, target.bvin, "Order failed to get a bvin");
Assert.AreEqual(1, target.Items.Count, "Item count should be one");
Assert.AreEqual(target.bvin, target.Items[0].OrderBvin, "Line item didn't receive order bvin");
Assert.AreEqual(target.StoreId, target.Items[0].StoreId, "Line item didn't recieve storeid");
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:27,代码来源:OrderTest.cs
示例3: OnLoad
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
// Tag an id to the querystring to support back button
if (Request.QueryString["id"] != null)
{
this.BvinField.Value = Request.QueryString["id"];
}
else
{
o = new Order();
MTApp.OrderServices.Orders.Create(o);
Response.Redirect("CreateOrder.aspx?id=" + o.bvin);
}
if (this.BvinField.Value.Trim() != string.Empty)
{
o = MTApp.OrderServices.Orders.FindForCurrentStore(this.BvinField.Value);
}
if (!Page.IsPostBack)
{
LoadOrder();
LoadPaymentMethods();
LoadCurrentUser();
}
//Me.UserPicker1.MessageBox = MessageBox1
//AddHandler Me.UserPicker1.UserSelected, AddressOf Me.UserSelected
//If Me.NewSkuField.Text <> String.Empty Then
//VariantsDisplay1.Initialize(False)
//End If
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:35,代码来源:CreateOrder.aspx.cs
示例4: OrderPaymentManager
public OrderPaymentManager(Order ord, MerchantTribeApplication app)
{
o = ord;
this.MTApp = app;
svc = MTApp.OrderServices;
this.contacts = this.MTApp.ContactServices;
this.content = this.MTApp.ContentServices;
Accounts.Store CurrentStore = app.CurrentRequestContext.CurrentStore;
pointsManager = CustomerPointsManager.InstantiateForDatabase(CurrentStore.Settings.RewardsPointsIssuedPerDollarSpent,
CurrentStore.Settings.RewardsPointsNeededPerDollarCredit,
app.CurrentRequestContext.CurrentStore.Id);
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:14,代码来源:OrderPaymentManager.cs
示例5: ReloadOrder
private void ReloadOrder(OrderShippingStatus previousShippingStatus)
{
o = MTApp.OrderServices.Orders.FindForCurrentStore(Request.QueryString["id"]);
o.EvaluateCurrentShippingStatus();
MTApp.OrderServices.Orders.Update(o);
MerchantTribe.Commerce.BusinessRules.OrderTaskContext context
= new MerchantTribe.Commerce.BusinessRules.OrderTaskContext(MTApp);
context.Order = o;
context.UserId = o.UserID;
context.Inputs.Add("bvsoftware", "PreviousShippingStatus", previousShippingStatus.ToString());
MerchantTribe.Commerce.BusinessRules.Workflow.RunByName(context, MerchantTribe.Commerce.BusinessRules.WorkflowNames.ShippingChanged);
LoadOrder();
this.OrderStatusDisplay1.LoadStatusForOrder(o);
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:14,代码来源:ShipOrder.aspx.cs
示例6: Calculate
public bool Calculate(Order o)
{
// reset values
o.TotalShippingBeforeDiscounts = 0;
o.TotalTax = 0;
o.TotalTax2 = 0;
o.TotalHandling = 0;
o.ClearDiscounts();
if (!SkipRepricing)
{
// Price items for current user
RepriceItemsForUser(o);
}
// Discount prices for volume ordered
ApplyVolumeDiscounts(o);
//Apply Offers to Line Items and Sub Total
ApplyOffersToOrder(o, PromotionActionMode.ForLineItems);
ApplyOffersToOrder(o, PromotionActionMode.ForSubTotal);
// Calculate Handling, Merge with Shipping For Display
o.TotalHandling = CalculateHandlingAmount(o);
OrdersCalculateShipping(o);
// Calculate Per Item shipping and handling portion
//CalculateShippingPortion(o);
// Apply shipping offers
ApplyOffersToOrder(o, PromotionActionMode.ForShipping);
// Calcaulte Taxes
o.ClearTaxes();
List<Taxes.ITaxSchedule> schedules = _app.OrderServices.TaxSchedules.FindAllAndCreateDefaultAsInterface(o.StoreId);
Contacts.Address destination = o.ShippingAddress;
ApplyTaxes(schedules, o.ItemsAsITaxable(), destination, o);
// Calculate Sub Total of Items
foreach (LineItem li in o.Items)
{
o.TotalTax += li.TaxPortion;
}
return true;
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:49,代码来源:OrderCalculator.cs
示例7: CartViewModel
public CartViewModel()
{
CurrentOrder = new Order();
this.AddCouponButtonUrl = string.Empty;
this.DeleteButtonUrl = string.Empty;
this.KeepShoppingButtonUrl = string.Empty;
this.KeepShoppingUrl = string.Empty;
this.CheckoutButtonUrl = string.Empty;
this.EstimateShippingButtonUrl = string.Empty;
this.DisplayTitle = "Shopping Cart";
this.DisplaySubTitle = string.Empty;
this.ItemListTitle = string.Empty;
this.CartEmpty = false;
this.LineItems = new List<CartLineItemViewModel>();
this.PayPalExpressAvailable = false;
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:16,代码来源:CartViewModel.cs
示例8: LoadStatusForOrder
public void LoadStatusForOrder(Order o)
{
if (o != null)
{
this.litPay.Text = EnumToString.OrderPaymentStatus(o.PaymentStatus);
this.litShip.Text = EnumToString.OrderShippingStatus(o.ShippingStatus);
if (lstStatus.Items.FindByValue(o.StatusCode) != null)
{
lstStatus.ClearSelection();
lstStatus.Items.FindByValue(o.StatusCode).Selected = true;
}
}
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:16,代码来源:OrderStatusDisplay.ascx.cs
示例9: RepriceItemsForUser
private void RepriceItemsForUser(Order o)
{
foreach (LineItem li in o.Items)
{
Catalog.UserSpecificPrice price = _app.PriceProduct(li.ProductId, o.UserID, li.SelectionData);
// Null check because if the item isn't in the catalog
// we will get back a null user specific price.
//
// In the future it may be a good idea to add an option
// allowing merchant to select if they would like to allow
// items not in the catalog to exist in carts or if we should
// just remove items from the cart with a warning here.
if (price != null)
{
li.BasePricePerItem = price.BasePrice;
foreach (Marketing.DiscountDetail discount in price.DiscountDetails)
{
li.DiscountDetails.Add(new Marketing.DiscountDetail() { Amount = discount.Amount * li.Quantity, Description = discount.Description });
}
}
}
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:22,代码来源:OrderCalculator.cs
示例10: OnLoad
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
orderId = Request.QueryString["id"];
o = MyPage.MTApp.OrderServices.Orders.FindForCurrentStore(orderId);
payManager = new OrderPaymentManager(o, MyPage.MTApp);
if (!Page.IsPostBack)
{
this.mvPayments.SetActiveView(this.viewCreditCards);
LoadCreditCardLists();
if (MyPage.MTApp.CurrentStore.PlanId < 2)
{
//this.lnkCash.Visible = false;
this.lnkCheck.Visible = false;
this.lnkPO.Visible = false;
}
}
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:23,代码来源:ReceivePaymentsControl.ascx.cs
示例11: PostAction
// Create or Update
public override string PostAction(string parameters, System.Collections.Specialized.NameValueCollection querystring, string postdata)
{
string data = string.Empty;
//string bvin = FirstParameter(parameters);
ApiResponse<OrderDTO> response = new ApiResponse<OrderDTO>();
OrderDTO postedItem = null;
try
{
postedItem = MerchantTribe.Web.Json.ObjectFromJson<OrderDTO>(postdata);
}
catch (Exception ex)
{
response.Errors.Add(new ApiError("EXCEPTION", ex.Message));
return MerchantTribe.Web.Json.ObjectToJson(response);
}
Order item = new Order();
item.FromDTO(postedItem);
Order existing = MTApp.OrderServices.Orders.FindForCurrentStore(item.bvin);
if (existing == null || existing.bvin == string.Empty)
{
item.StoreId = MTApp.CurrentStore.Id;
MTApp.OrderServices.Orders.Create(item);
}
else
{
MTApp.OrderServices.Orders.Update(item);
}
Order resultItem = MTApp.OrderServices.Orders.FindForCurrentStore(item.bvin);
if (resultItem != null) response.Content = resultItem.ToDto();
data = MerchantTribe.Web.Json.ObjectToJson(response);
return data;
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:37,代码来源:OrdersHandler.cs
示例12: CalculateHandlingAmount
private decimal CalculateHandlingAmount(Order o)
{
Accounts.Store currentStore = _app.CurrentStore;
if (currentStore == null) return 0;
if (currentStore.Settings.HandlingType == (int)HandlingMode.PerItem)
{
decimal amount = 0;
foreach (Orders.LineItem item in o.Items)
{
if (item.ShippingSchedule == -1)
{
if (currentStore.Settings.HandlingNonShipping)
{
amount += item.Quantity;
}
}
else
{
amount += item.Quantity;
}
}
return (currentStore.Settings.HandlingAmount * amount);
}
else if (currentStore.Settings.HandlingType == (int)HandlingMode.PerOrder)
{
//charge handling if there aren't non shipping items
if (currentStore.Settings.HandlingNonShipping)
{
foreach (Orders.LineItem item in o.Items)
{
return currentStore.Settings.HandlingAmount;
}
}
else
{
foreach (Orders.LineItem item in o.Items)
{
if (item.ShippingSchedule != -1)
{
return currentStore.Settings.HandlingAmount;
}
}
}
}
return 0;
}
开发者ID:thepaleone,项目名称:MerchantTribe,代码行数:48,代码来源:OrderCalculator.cs
示例13: OrdersCalculateShipping
private void OrdersCalculateShipping(Order o)
{
o.TotalShippingBeforeDiscounts = 0;
if (o.ShippingMethodId != string.Empty)
{
Shipping.ShippingRateDisplay r = _app.OrderServices.OrdersFindShippingRateByUniqueKey(o.ShippingMethodUniqueKey, o, _app.CurrentStore);
if (r != null)
{
o.ShippingMethodDisplayName = r.DisplayName;
o.ShippingProviderId = r.ProviderId;
o.ShippingProviderServiceCode = r.ProviderServiceCode;
o.TotalShippingBeforeDiscounts = Math.Round(r.Rate, 2);
//this.AddPackages(r.SuggestedPackages);
}
}
if (o.TotalShippingBeforeDiscountsOverride >= 0)
{
o.TotalShippingBeforeDiscounts = o.TotalShippingBeforeDiscountsOverride;
}
}
开发者ID:thepaleone,项目名称:MerchantTribe,代码行数:21,代码来源:OrderCalculator.cs
示例14: CalculateOrderWithoutRepricing
public bool CalculateOrderWithoutRepricing(Order o)
{
Orders.OrderCalculator calc = new OrderCalculator(this);
calc.SkipRepricing = true;
return calc.Calculate(o);
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:6,代码来源:MerchantTribeApplication.cs
示例15: ApplyVolumeDiscounts
private void ApplyVolumeDiscounts(Order o)
{
// Count up how many of each item in order
List<string> products = new List<string>();
Dictionary<string, int> quantities = new Dictionary<string, int>();
foreach (LineItem item in o.Items)
{
if (!products.Contains(item.ProductId))
{
products.Add(item.ProductId);
}
if (quantities.ContainsKey(item.ProductId))
{
quantities[item.ProductId] += (int)item.Quantity;
}
else
{
quantities.Add(item.ProductId, (int)item.Quantity);
}
}
// Check for discounts on each item
foreach (string id in products)
{
List<MerchantTribe.Commerce.Catalog.ProductVolumeDiscount> volumeDiscounts = _app.CatalogServices.VolumeDiscounts.FindByProductId(id);
int quantity = quantities[id];
MerchantTribe.Commerce.Catalog.ProductVolumeDiscount volumeDiscountToApply = null;
if (volumeDiscounts.Count > 0)
{
// Locate the correct discount in the chart of discounts
foreach (MerchantTribe.Commerce.Catalog.ProductVolumeDiscount volumeDiscount in volumeDiscounts)
{
if (quantity >= volumeDiscount.Qty)
{
volumeDiscountToApply = volumeDiscount;
}
}
//now we have to go through the entire order and discount all items
//that are this id
if (volumeDiscountToApply != null)
{
foreach (LineItem item in o.Items)
{
if (item.ProductId == id)
{
Catalog.Product p = _app.CatalogServices.Products.Find(item.ProductId);
if (p != null)
{
bool alreadyDiscounted = (p.SitePrice > item.AdjustedPricePerItem);
if (!alreadyDiscounted)
{
// item isn't discounted yet so apply the exact price the merchant set
decimal toDiscount = -1 * (item.AdjustedPricePerItem - volumeDiscountToApply.Amount);
toDiscount = toDiscount * item.Quantity;
item.DiscountDetails.Add(new Marketing.DiscountDetail() { Amount = toDiscount, Description = "Volume Discount" });
}
else
{
// item is already discounted (probably by user group) so figure out
// the percentage of volume discount instead
decimal originalPriceChange = p.SitePrice - volumeDiscountToApply.Amount;
decimal percentChange = originalPriceChange / p.SitePrice;
decimal newDiscount = -1 * (percentChange * item.AdjustedPricePerItem);
newDiscount = newDiscount * item.Quantity;
item.DiscountDetails.Add(new Marketing.DiscountDetail() { Amount = newDiscount, Description = percentChange.ToString("p0") + " Volume Discount" });
}
}
}
}
}
}
}
}
开发者ID:thepaleone,项目名称:MerchantTribe,代码行数:76,代码来源:OrderCalculator.cs
示例16: CheckForStockOnItems
public SystemOperationResult CheckForStockOnItems(Order o)
{
// Build a list of product quantities to check
Dictionary<string, ProductIdCombo> products = new Dictionary<string, ProductIdCombo>();
foreach (Orders.LineItem item in o.Items)
{
ProductIdCombo combo = new ProductIdCombo() { Bvin = item.ProductId, VariantId = item.VariantId, Quantity = item.Quantity };
if (products.ContainsKey(combo.Key()))
{
products[combo.Key()].Quantity += combo.Quantity;
}
else
{
products.Add(combo.Key(), combo);
}
}
// Now check each quantity for the order
foreach (string key in products.Keys)
{
Catalog.Product prod = null;
Orders.LineItem lineItem = null;
foreach (LineItem item in o.Items)
{
if (item.ProductId + item.VariantId == key)
{
//we just need this to get the product
//name if the product is not found
lineItem = item;
prod = item.GetAssociatedProduct(this);
break;
}
}
if (prod != null)
{
if (prod.Status == Catalog.ProductStatus.Disabled)
{
return new SystemOperationResult(false, Content.SiteTerms.ReplaceTermVariable(Content.SiteTerms.GetTerm(Content.SiteTermIds.ProductNotAvailable), "productName", prod.ProductName));
}
ProductIdCombo checkcombo = products[key];
Catalog.InventoryCheckData data = CatalogServices.InventoryCheck(prod, checkcombo.VariantId);
if (data.IsAvailableForSale)
{
if (data.IsInStock)
{
if (data.Qty < checkcombo.Quantity)
{
string message = Content.SiteTerms.GetTerm(Content.SiteTermIds.CartNotEnoughQuantity);
message = Content.SiteTerms.ReplaceTermVariable(message, "ProductName", prod.ProductName);
message = Content.SiteTerms.ReplaceTermVariable(message, "Quantity", data.Qty.ToString());
return new SystemOperationResult(false, message);
}
}
}
else
{
return new SystemOperationResult(false, Content.SiteTerms.ReplaceTermVariable(Content.SiteTerms.GetTerm(Content.SiteTermIds.CartOutOfStock), "productName", prod.ProductName));
}
}
else
{
return new SystemOperationResult(false, Content.SiteTerms.ReplaceTermVariable("{productname} is not availble at the moment.", "productName", lineItem.ProductName));
}
}
return new SystemOperationResult(true, string.Empty);
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:73,代码来源:MerchantTribeApplication.cs
示例17: RenderAnalytics
private void RenderAnalytics(Order o)
{
// Reset Analytics for receipt page
this.ViewData["PassedAnalyticsTop"] = string.Empty;
// Add Tracker and Maybe Ecommerce Tracker to Top
if (MTApp.CurrentStore.Settings.Analytics.UseGoogleTracker)
{
if (MTApp.CurrentStore.Settings.Analytics.UseGoogleEcommerce)
{
// Ecommerce + Page Tracker
this.ViewData["PassedAnalyticsTop"] = MerchantTribe.Commerce.Metrics.GoogleAnalytics.RenderLatestTrackerAndTransaction(
MTApp.CurrentStore.Settings.Analytics.GoogleTrackerId,
o,
MTApp.CurrentStore.Settings.Analytics.GoogleEcommerceStoreName,
MTApp.CurrentStore.Settings.Analytics.GoogleEcommerceCategory);
}
else
{
// Page Tracker Only
this.ViewData["PassedAnalyticsTop"] = MerchantTribe.Commerce.Metrics.GoogleAnalytics.RenderLatestTracker(MTApp.CurrentStore.Settings.Analytics.GoogleTrackerId);
}
}
// Adwords Tracker at bottom if needed
if (MTApp.CurrentStore.Settings.Analytics.UseGoogleAdWords)
{
this.ViewData["PassedAnalyticsBottom"] += MerchantTribe.Commerce.Metrics.GoogleAnalytics.RenderGoogleAdwordTracker(
o.TotalGrand,
MTApp.CurrentStore.Settings.Analytics.GoogleAdWordsId,
MTApp.CurrentStore.Settings.Analytics.GoogleAdWordsLabel,
MTApp.CurrentStore.Settings.Analytics.GoogleAdWordsBgColor,
Request.IsSecureConnection);
}
// Add Yahoo Tracker to Bottom if Needed
if (MTApp.CurrentStore.Settings.Analytics.UseYahooTracker)
{
this.ViewData["PassedAnalyticsBottom"] += MerchantTribe.Commerce.Metrics.YahooAnalytics.RenderYahooTracker(
o, MTApp.CurrentStore.Settings.Analytics.YahooAccountId);
}
//if (ViewBag.HideAnalytics != null)
//{
// if (!(bool)ViewBag.HideAnalytics)
// {
// System.Text.StringBuilder sbA = new System.Text.StringBuilder();
// sbA.Append("<script type=\"text/javascript\">");
// sbA.Append("MerchantTribeAnalytics.EventCode = '2';");
// sbA.Append("MerchantTribeAnalytics.EventAmount = '@Grand';");
// sbA.Append("MerchantTribeAnalytics.EventDescription = '@o.OrderNumber';");
// sbA.Append("</script>");
// this.ViewData["PassedAnalyticsBottom"] += sbA.ToString();
// }
//}
}
开发者ID:thepaleone,项目名称:MerchantTribe,代码行数:56,代码来源:CheckoutController.cs
示例18: 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();
}
开发者ID:KimRossey,项目名称:MerchantTribe,代码行数:70,代码来源:ViewOrder.aspx.cs
示例19: CalculateOrder
public bool CalculateOrder(Order o)
{
Orders.OrderCalculator calc = new OrderCalculator(this);
return calc.Calculate(o);
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:5,代码来源:MerchantTribeApplication.cs
示例20: OrdersUnshipItems
private bool OrdersUnshipItems(OrderPackage p, Order o)
{
bool result = true;
if (p.Items.Count > 0)
{
if (o != null)
{
if (o.bvin != string.Empty)
{
foreach (OrderPackageItem pi in p.Items)
{
if (pi.LineItemId > 0)
{
Orders.LineItem li = o.GetLineItem(pi.LineItemId);
if (li != null)
{
int quantityToUnship = 0;
if (li.QuantityShipped < pi.Quantity)
{
quantityToUnship = li.QuantityShipped;
}
else
{
quantityToUnship = pi.Quantity;
}
CatalogServices.InventoryLineItemUnShipQuantity(li, quantityToUnship);
}
}
}
}
}
}
return result;
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:36,代码来源:MerchantTribeApplication.cs
注:本文中的MerchantTribe.Commerce.Orders.Order类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论