本文整理汇总了C#中Samba.Domain.Models.Tickets.Order.GetItemPrice方法的典型用法代码示例。如果您正苦于以下问题:C# Order.GetItemPrice方法的具体用法?C# Order.GetItemPrice怎么用?C# Order.GetItemPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Samba.Domain.Models.Tickets.Order
的用法示例。
在下文中一共展示了Order.GetItemPrice方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPrice
private decimal GetPrice(Order order, decimal serviceAmount, decimal sum, decimal exchangeRate)
{
var result = order.GetItemPrice();
if (serviceAmount != 0 && sum != 0) result += (result * serviceAmount) / sum;
if (!order.TaxIncluded) result += order.TaxAmount;
result = result / exchangeRate;
return result;
}
示例2: CreateMergedItem
private void CreateMergedItem(decimal sum, Order item, decimal serviceAmount)
{
var price = item.GetItemPrice();
price += (price * serviceAmount) / sum;
if (!item.TaxIncluded) price += item.TaxAmount;
var mitem = MergedItems.SingleOrDefault(x => x.MenuItemId == item.MenuItemId && x.Price == price);
if (mitem == null)
{
mitem = new MergedItem();
try
{
mitem.Description = item.MenuItemName + item.GetPortionDesc();
mitem.Price = price;
mitem.MenuItemId = item.MenuItemId;
MergedItems.Add(mitem);
}
finally
{
mitem.Dispose();
}
}
mitem.Quantity += item.Quantity;
}
示例3: GetKey
private static string GetKey(Order order)
{
return string.Format(Keyformat, order.MenuItemId, order.GetItemPrice());
}
示例4: ReplaceLineVars
private static string ReplaceLineVars(string line, Order order)
{
string result = line;
if (order != null)
{
result = FormatData(result, TagNames.Quantity, () => order.Quantity.ToString("#,#0.##"));
result = FormatData(result, TagNames.Name, () => order.MenuItemName + order.GetPortionDesc());
result = FormatData(result, TagNames.Price, () => order.Price.ToString("#,#0.00"));
result = FormatData(result, TagNames.Total, () => order.GetItemPrice().ToString("#,#0.00"));
result = FormatData(result, TagNames.TotalAmount, () => order.GetItemValue().ToString("#,#0.00"));
result = FormatData(result, TagNames.Cents, () => (order.Price * 100).ToString("#,##"));
result = FormatData(result, TagNames.LineAmount, () => order.GetTotal().ToString("#,#0.00"));
result = FormatData(result, TagNames.OrderNo, () => order.OrderNumber.ToString());
result = FormatData(result, TagNames.PriceTag, () => order.PriceTag);
result = _settingReplacer.ReplaceSettingValue("{SETTING:([^}]+)}", result);
if (result.Contains(TagNames.Properties.Substring(0, TagNames.Properties.Length - 1)))
{
string lineFormat = result;
if (order.OrderTagValues.Count > 0)
{
string label = "";
foreach (var property in order.OrderTagValues)
{
var itemProperty = property;
var lineValue = FormatData(lineFormat, TagNames.Properties, () => itemProperty.Name);
lineValue = FormatData(lineValue, TagNames.PropQuantity, () => itemProperty.Quantity.ToString("#.##"));
lineValue = FormatData(lineValue, TagNames.PropPrice, () => itemProperty.AddTagPriceToOrderPrice ? "" : itemProperty.Price.ToString("#,#0.00"));
label += lineValue + "\r\n";
}
result = "\r\n" + label;
}
else result = "";
}
result = result.Replace("<", "\r\n<");
}
return result;
}