Exemplo n.º 1
0
 partial void DeleteCombo(Combo instance);
Exemplo n.º 2
0
 partial void InsertCombo(Combo instance);
Exemplo n.º 3
0
 partial void UpdateCombo(Combo instance);
Exemplo n.º 4
0
        private static double get_seat_expense_for_combo(BathDbDataContext db, Combo combo, Seat seat)
        {
            IQueryable<string> menus = null;
            if (combo.menuIds != null)
            {
                var menuIds = disAssemble(combo.menuIds);
                menus = db.Menu.Where(x => menuIds.Contains(x.id)).Select(x => x.name);
            }

            var orders = db.Orders.Where(x => x.systemId == seat.systemId && x.deleteEmployee == null && !x.paid);

            double money = 0;
            DateTime now = DateTime.Now;
            foreach (var order in orders)
            {
                if (menus != null && menus.Contains(order.menu))
                    continue;

                if (order.priceType == null || order.priceType == "停止消费")
                    money += order.money;
                else
                    money += order.money * Math.Ceiling((DateTime.Now - order.inputTime).TotalHours);
            }

            return Math.Round(money, 0);
        }