Beispiel #1
0
        private static OrderDishPrintInfo ToOrderDishPrintInfo(JObject dataJObj)
        {
            if (dataJObj == null)
            {
                return(null);
            }

            var num  = GetJObjectDecimal(dataJObj, "dishnum");
            var unit = GetJObjectString(dataJObj, "dishunit");

            unit = InternationaHelper.FilterSeparatorFlag(unit);
            var dishName = GetJObjectString(dataJObj, "title");

            dishName = InternationaHelper.FilterSeparatorFlag(dishName);

            var item = new OrderDishPrintInfo
            {
                DishName    = dishName,
                Amount      = GetJObjectDecimal(dataJObj, "amount"),
                DishNumUnit = string.Format("{0}{1}", num, unit),
                DishPrice   = GetJObjectDecimal(dataJObj, "orderprice")
            };

            return(item);
        }
Beispiel #2
0
 public static DishSaleInfo ToDishSaleInfo(DishSaleInfoDataResponse response)
 {
     return(new DishSaleInfo
     {
         Name = InternationaHelper.FilterSeparatorFlag(response.dishName),
         SalesCount = response.dishCount,
         SalesAmount = response.totlePrice ?? 0m,
     });
 }