当前位置: 首页>>代码示例>>C#>>正文


C# Order.GetPortionDesc方法代码示例

本文整理汇总了C#中Samba.Domain.Models.Tickets.Order.GetPortionDesc方法的典型用法代码示例。如果您正苦于以下问题:C# Order.GetPortionDesc方法的具体用法?C# Order.GetPortionDesc怎么用?C# Order.GetPortionDesc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Samba.Domain.Models.Tickets.Order的用法示例。


在下文中一共展示了Order.GetPortionDesc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateSelector

 private void UpdateSelector(Order order, decimal serviceAmount, decimal sum, bool taxIncluded)
 {
     var selector = Selectors.FirstOrDefault(x => x.Key == GetKey(order));
     if (selector == null)
     {
         selector = new Selector { Key = GetKey(order), Description = order.MenuItemName + order.GetPortionDesc() };
         Selectors.Add(selector);
     }
     selector.Quantity += order.Quantity;
     selector.Price = GetPrice(order, serviceAmount, sum, ExchangeRate, taxIncluded);
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:11,代码来源:OrderSelector.cs

示例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;
 }
开发者ID:betology,项目名称:SambaPOS-3,代码行数:23,代码来源:PaymentEditorViewModel.cs

示例3: 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;
        }
开发者ID:betology,项目名称:SambaPOS-3,代码行数:39,代码来源:TicketFormatter.cs


注:本文中的Samba.Domain.Models.Tickets.Order.GetPortionDesc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。