private void reset_order_money(Orders order)
 {
     var menu = db.Menu.FirstOrDefault(x => x.name == order.menu);
     if (menu != null)
     {
         if (order.priceType == "每小时")
             order.money = Convert.ToDouble(menu.addMoney);
         else if (order.comboId == null)
             order.money = menu.price;
         else if (order.comboId != null)
         {
             var combo = db.Combo.FirstOrDefault(x => x.id == order.comboId);
             if (combo == null)
                 return;
             var freeIds = BathClass.disAssemble(combo.freeMenuIds);
             var freeMenus = db.Menu.Where(x => freeIds.Contains(x.id)).Select(x => x.name);
             if (!freeMenus.Contains(order.menu))
                 order.money = menu.price;
         }
     }
     else
     {
         var combo = db.Combo.FirstOrDefault(x => x.id == order.comboId);
         order.money = BathClass.get_combo_price(db, combo);
     }
 }
Ejemplo n.º 2
0
        //确定
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (btnOk.Text == "读卡")
                get_member();
            else if (btnOk.Text == "充值" && money.Text != "")
            {
                CardCharge cardCharge = new CardCharge();

                cardCharge.CC_CardNo = m_member.CI_CardNo;
                cardCharge.CC_DebitSum = Convert.ToDouble(money.Text);
                cardCharge.CC_ItemExplain = "会员卡充值-收";
                cardCharge.CC_InputOperator = LogIn.m_User.id.ToString();
                cardCharge.CC_InputDate = GeneralClass.Now;
                cardCharge.systemId = m_Seat.systemId;
                db.CardCharge.InsertOnSubmit(cardCharge);

                int sale_money = find_card_sale();
                if (sale_money != 0)
                {
                    CardCharge cardChargeSale = new CardCharge();
                    cardChargeSale.CC_CardNo = m_member.CI_CardNo;
                    cardChargeSale.CC_ItemExplain = "优惠送";
                    cardChargeSale.CC_DebitSum = sale_money;
                    cardChargeSale.CC_LenderSum = 0;
                    cardChargeSale.CC_InputOperator = LogIn.m_User.id.ToString();
                    cardChargeSale.CC_InputDate = GeneralClass.Now;
                    cardChargeSale.systemId = m_Seat.systemId;
                    db.CardCharge.InsertOnSubmit(cardChargeSale);

                    BathClass.printInformation("送" + sale_money + "元");
                }

                //var menu = db.Menu.FirstOrDefault(x => x.name == type.Text+"充值");
                Orders order = new Orders();
                order.menu = "储值卡充值";
                order.text = m_Seat.text;
                order.systemId = m_Seat.systemId;
                order.number = 1;
                order.inputTime = BathClass.Now(LogIn.connectionString);
                order.inputEmployee = LogIn.m_User.id.ToString();
                order.paid = false;
                order.money = Convert.ToDouble(money.Text);
                db.Orders.InsertOnSubmit(order);

                db.SubmitChanges();
                this.DialogResult = DialogResult.OK;
            }
        }
Ejemplo n.º 3
0
        //加收过夜费
        private void order_guoye(HotelRoom seat, BathDBDataContext dc)
        {
            if (!BathClass.ToBool(m_Options.自动加收过夜费))
                return;

            if (dc.Orders.FirstOrDefault(x=>x.systemId==seat.systemId && x.menu=="过夜费") != null ||
                dc.HisOrders.FirstOrDefault(x => x.systemId == seat.systemId && x.menu == "过夜费") != null)
                return;

            var m_OverMenu = dc.Menu.FirstOrDefault(x => x.name == "过夜费");
            if (m_OverMenu == null)
                return;

            DateTime now = DateTime.Now;
            string year = now.Year.ToString();
            string month = now.Month.ToString();
            string day = now.Day.ToString();
            string date = year+"-"+month+"-"+day+" ";
            string time = ":00:00";

            DateTime st = DateTime.Parse(date + m_Options.过夜费起点 + time);
            DateTime et = DateTime.Parse(date + m_Options.过夜费终点 + time);

            DateTime open_time = seat.openTime.Value;
            if ((now >= et && open_time >= et) || (open_time <= st && now <= st))
                return;

            Orders order = new Orders();
            order.menu = m_OverMenu.name;
            order.text = seat.text;
            order.systemId = seat.systemId;
            order.number = 1;
            order.money = m_OverMenu.price;
            order.inputTime = now;
            order.inputEmployee = "过夜费";
            order.departmentId = 1;
            order.paid = false;
            dc.Orders.InsertOnSubmit(order);
            dc.SubmitChanges();
            find_combo(dc, order);
        }
Ejemplo n.º 4
0
        private void find_combo(BathDBDataContext dc, Orders theOrder)
        {
            dc.Orders.DeleteAllOnSubmit(dc.Orders.Where(x => x.systemId == theOrder.systemId && x.menu.Contains("套餐")));
            var orders = dc.Orders.Where(x => x.systemId == theOrder.systemId && x.deleteEmployee == null);
            orders = orders.Where(x => !x.inputEmployee.Contains("电脑"));
            foreach (Orders tmp_order in orders)
            {
                tmp_order.comboId = null;
            }
            dc.SubmitChanges();

            var order_menus = orders.Where(x => x.comboId == null).Select(x => x.menu);
            var menus = dc.Menu;
            var comboList = dc.Combo.OrderByDescending(x => x.originPrice - x.price);
            foreach (Combo combo in comboList)
            {
                List<int> menuIds = BathClass.disAssemble(combo.menuIds);
                var combo_menus = menus.Where(x => menuIds.Contains(x.id)).Select(x => x.name);
                if (combo_menus.All(x => order_menus.Any(y => y == x)))
                {
                    foreach (var combo_menu in combo_menus)
                    {
                        var tmp_order = orders.FirstOrDefault(x => x.menu == combo_menu);
                        tmp_order.comboId = combo.id;
                        if (combo.priceType == "免项目")
                        {
                            var freeIds = BathClass.disAssemble(combo.freeMenuIds);
                            var freeMenus = dc.Menu.Where(x => freeIds.Contains(x.id)).Select(x => x.name);
                            if (freeMenus.Contains(tmp_order.menu))
                                tmp_order.money = 0;
                        }
                    }
                    if (combo.priceType == "减金额")
                    {
                        Orders comboOrder = new Orders();
                        comboOrder.menu = "套餐" + combo.id.ToString() + "优惠";
                        comboOrder.text = theOrder.text;
                        comboOrder.systemId = theOrder.systemId;
                        comboOrder.number = 1;
                        comboOrder.inputTime = GeneralClass.Now;
                        comboOrder.inputEmployee = "套餐";
                        comboOrder.paid = false;
                        comboOrder.comboId = combo.id;
                        comboOrder.departmentId = 1;
                        comboOrder.money = Convert.ToDouble(combo.price) - combo.originPrice;

                        dc.Orders.InsertOnSubmit(comboOrder);
                    }
                    dc.SubmitChanges();
                }
            }
        }
Ejemplo n.º 5
0
        //确定重新结账
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (dgv.CurrentCell == null)
            {
                BathClass.printErrorMsg("未选中账单号");
                return;
            }

            var db_new = new BathDBDataContext(LogIn.connectionString);
            var act = db_new.Account.FirstOrDefault(x => x.id.ToString() == dgv.CurrentRow.Cells[0].Value.ToString());
            if (act == null)
            {
                if (BathClass.printAskMsg("手牌未结账,是否直接恢复手牌?") != DialogResult.Yes)
                    return;
            }

            var texts = act.text.Split('|');
            var ids = act.systemId.Split('|');
            //var seats = db_new.HotelRoom.Where(x => texts.Contains(x.text));
            for (int i = 0; i < texts.Count(); i++)
            {
                var s = db_new.HotelRoom.FirstOrDefault(x => x.text == texts[i]);
                if (s == null) continue;

                if (s.status == 2 || s.status == 6 || s.status == 7)
                {
                    BathClass.printErrorMsg("手牌: " + s.text + "已经重新开牌,请先更换手牌");
                    return;
                }
                s.status = 8;
                s.systemId = ids[i];
                var orders = db_new.HisOrders.Where(x => x.systemId == s.systemId);
                foreach (var order in orders)
                {
                    var ho = new Orders();
                    ho.menu = order.menu;
                    ho.text = order.text;
                    ho.systemId = order.systemId;
                    ho.number = order.number;
                    ho.priceType = order.priceType;
                    ho.money = order.money;
                    ho.technician = order.technician;
                    ho.techType = order.techType;
                    ho.inputTime = order.inputTime;
                    ho.inputEmployee = order.inputEmployee;
                    ho.deleteEmployee = order.deleteEmployee;
                    ho.donorEmployee = order.donorEmployee;
                    ho.comboId = order.comboId;
                    ho.paid = false;
                    ho.accountId = order.accountId;
                    ho.billId = order.billId;
                    ho.stopTiming = true;
                    ho.departmentId = 1;
                    db_new.HisOrders.DeleteOnSubmit(order);
                    db_new.Orders.InsertOnSubmit(ho);
                }
            }
            act.abandon = m_user.id;
            var cc = db_new.CardCharge.Where(x => act.id.ToString() == x.CC_AccountNo);
            if (cc.Any())
                db_new.CardCharge.DeleteAllOnSubmit(cc);
            db_new.SubmitChanges();

            this.DialogResult = DialogResult.OK;
        }
Ejemplo n.º 6
0
 partial void DeleteOrders(Orders instance);
Ejemplo n.º 7
0
 partial void UpdateOrders(Orders instance);
Ejemplo n.º 8
0
 partial void InsertOrders(Orders instance);
Ejemplo n.º 9
0
        private void find_combo()
        {
            TransactionOptions transOptions = new TransactionOptions() { IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted };
            {
                db.Orders.DeleteAllOnSubmit(db.Orders.Where(x => x.menu.Contains("套餐")));
                var orders = db.Orders.Where(x => x.systemId == m_Seat.systemId && x.deleteEmployee == null);
                orders = orders.Where(x => !x.inputEmployee.Contains("电脑"));
                foreach (Orders tmp_order in orders)
                {
                    tmp_order.comboId = null;
                }
                db.SubmitChanges();

                var order_menus = orders.Where(x => x.comboId == null).Select(x => x.menu);
                var menus = db.Menu;
                var comboList = db.Combo.OrderByDescending(x => x.originPrice - x.price);
                foreach (Combo combo in comboList)
                {
                    List<int> menuIds = BathClass.disAssemble(combo.menuIds);
                    var combo_menus = menus.Where(x => menuIds.Contains(x.id)).Select(x => x.name);
                    if (combo_menus.All(x => order_menus.Any(y => y == x)))
                    {
                        foreach (var combo_menu in combo_menus)
                        {
                            var tmp_order = orders.FirstOrDefault(x => x.menu == combo_menu);
                            tmp_order.comboId = combo.id;
                            if (combo.priceType == "免项目")
                            {
                                var freeIds = BathClass.disAssemble(combo.freeMenuIds);
                                var freeMenus = db.Menu.Where(x => freeIds.Contains(x.id)).Select(x => x.name);
                                if (freeMenus.Contains(tmp_order.menu))
                                    tmp_order.money = 0;
                            }
                        }
                        if (combo.priceType == "减金额")
                        {
                            Orders comboOrder = new Orders();
                            comboOrder.menu = "套餐" + combo.id.ToString() + "优惠";
                            comboOrder.text = m_Seat.text;
                            comboOrder.systemId = m_Seat.systemId;
                            comboOrder.number = 1;
                            comboOrder.inputTime = GeneralClass.Now;
                            comboOrder.inputEmployee = "套餐";
                            comboOrder.paid = false;
                            comboOrder.comboId = combo.id;
                            comboOrder.money = Convert.ToDouble(combo.price) - combo.originPrice;

                            db.Orders.InsertOnSubmit(comboOrder);
                            m_Orders.Add(comboOrder);
                        }
                        db.SubmitChanges();
                    }
                }
            }
        }
Ejemplo n.º 10
0
        //点击菜式
        private void btnMenu_Click(object sender, EventArgs e)
        {
            YouSoftBathGeneralClass.Menu menu = db.Menu.FirstOrDefault(x => x.name == ((Button)sender).Text);
            Orders order = new Orders();
            order.menu = menu.name;
            order.text = m_Seat.text;
            order.systemId = m_Seat.systemId;
            order.number = 1;
            order.money = menu.price;
            order.inputTime = GeneralClass.Now;
            order.inputEmployee = m_Employee.id.ToString();
            order.paid = false;
            //m_Seat.money += menu.price;
            if (menu.technician)
            {
                InputServerId techForm = new InputServerId("", false);
                if (techForm.ShowDialog() != DialogResult.OK)
                {
                    GeneralClass.printErrorMsg("需要选择技师!");
                    return;
                }
                order.technician = techForm.emplyee.id.ToString();
                //var tech = db.Employee.FirstOrDefault(x => x.id.ToString() == technicianForm.m_tId);
            }

            db.Orders.InsertOnSubmit(order);
            db.SubmitChanges();

            m_Orders.Add(order);
            //findComboOfOrder(order);
            find_combo();
            dgvExpense_show();
        }
Ejemplo n.º 11
0
        //确定
        private void btnOk_Click(object sender, EventArgs e)
        {
            var dc_new = new BathDBDataContext(LogIn.connectionString);
            if (m_open)
            {
                int i = 0;
                foreach (var seat in m_Seats)
                {
                    var seat_tmp = dc_new.HotelRoom.FirstOrDefault(x => x.text == seat.text);
                    var child = Convert.ToBoolean(dgv.Rows[i].Cells[2].Value);

                    if (!seatlock)
                        open_one_seat(seat_tmp, child, dc_new);
                    else
                    {
                        var mtype = dc_new.HotelRoomType.FirstOrDefault(x => x.id == seat_tmp.typeId);
                        if (mtype.menuId == null)
                        {
                            if (seat_tmp.status == 3)
                            {
                                BathClass.reset_seat(seat_tmp);
                                dc_new.SubmitChanges();
                            }

                            seat_tmp.openEmployee = LogIn.m_User.id.ToString();
                            seat_tmp.openTime = BathClass.Now(LogIn.connectionString);
                            seat_tmp.systemId = BathClass.systemId(db, LogIn.connectionString);
                            seat_tmp.status = 2;
                        }

                        seat_tmp.chainId = chainId;
                        HotelRoomType seatType = dc_new.HotelRoomType.FirstOrDefault(x => x.id == seat_tmp.typeId);

                        var menu = dc_new.Menu.FirstOrDefault(x => x.id == seatType.menuId);
                        var child_menu = dc_new.Menu.FirstOrDefault(x => x.name == "儿童浴资");

                        if (menu != null)
                        {
                            Orders order = new Orders();
                            order.menu = menu.name;
                            order.text = seat_tmp.text;
                            order.systemId = seat_tmp.systemId;
                            order.number = 1;
                            order.money = menu.price;
                            order.inputTime = BathClass.Now(LogIn.connectionString);
                            order.inputEmployee = LogIn.m_User.id.ToString();
                            order.paid = false;
                            order.departmentId = 1;
                            dc_new.Orders.InsertOnSubmit(order);

                            if (child)
                            {
                                Orders child_order = new Orders();
                                child_order.menu = child_menu.name;
                                child_order.text = seat_tmp.text;
                                child_order.systemId = seat_tmp.systemId;
                                child_order.number = 1;
                                child_order.money = child_menu.price;
                                child_order.inputTime = BathClass.Now(LogIn.connectionString);
                                child_order.inputEmployee = LogIn.m_User.id.ToString();
                                child_order.paid = false;
                                order.departmentId = 1;
                                dc_new.Orders.InsertOnSubmit(child_order);
                            }
                        }
                    }
                    i++;
                }
                dc_new.SubmitChanges();
            }
            else
            {
                foreach (var seat in m_Seats)
                    seat.chainId = chainId;
                db.SubmitChanges();
            }

            this.DialogResult = DialogResult.OK;
        }
Ejemplo n.º 12
0
        private void open_one_seat(HotelRoom seat, bool child, BathDBDataContext dc)
        {
            if (seat.status == 3)
            {
                BathClass.reset_seat(seat);
                dc.SubmitChanges();
            }

            seat.openEmployee = LogIn.m_User.id.ToString();
            seat.openTime = BathClass.Now(LogIn.connectionString);
            seat.systemId = BathClass.systemId(db, LogIn.connectionString);
            seat.status = 2;
            if (!seatlock)
                seat.chainId = chainId;

            HotelRoomType seatType = dc.HotelRoomType.FirstOrDefault(x => x.id == seat.typeId);

            var menu = dc.Menu.FirstOrDefault(x => x.id == seatType.menuId);
            if (menu != null)
            {
                Orders order = new Orders();
                order.menu = menu.name;
                order.text = seat.text;
                order.systemId = seat.systemId;
                order.number = 1;
                order.money = menu.price;
                order.inputTime = BathClass.Now(LogIn.connectionString);
                order.inputEmployee = LogIn.m_User.id.ToString();
                order.paid = false;
                dc.Orders.InsertOnSubmit(order);
            }

            if (child)
            {
                var child_menu = dc.Menu.FirstOrDefault(x => x.name == "儿童浴资");
                if (child_menu != null)
                {
                    Orders order = new Orders();
                    order.menu = child_menu.name;
                    order.text = seat.text;
                    order.systemId = seat.systemId;
                    order.number = 1;
                    order.money = child_menu.price;
                    order.inputTime = BathClass.Now(LogIn.connectionString);
                    order.inputEmployee = LogIn.m_User.id.ToString();
                    order.paid = false;
                    dc.Orders.InsertOnSubmit(order);
                }
            }

            dc.SubmitChanges();
        }
Ejemplo n.º 13
0
        //自动滚项目
        private void order_auto_add_thread()
        {
            while (true)
            {
                try
                {
                    var dc = new BathDBDataContext(connectionString);
                    TransactionOptions transOptions = new TransactionOptions() { IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted };
                    using (new TransactionScope(TransactionScopeOption.Required, transOptions))
                    {
                        var all_menus = dc.Menu.Where(x => x.addAutomatic);
                        var menus = all_menus.Select(x => x.name).ToList();//需要自动续费的项目名称
                        var orders = dc.Orders.Where(x => menus.Contains(x.menu) && !x.paid && x.deleteEmployee == null &&
                            x.stopTiming == null);
                        var seats = dc.Seat.Where(x => x.status == 2 || x.status == 6 || x.status == 7);
                        seats = seats.Where(x => x.ordering == null || !x.ordering.Value);
                        seats = seats.Where(x => x.paying == null || !x.paying.Value);
                        foreach (var seat in seats)
                        {
                            var seat_orders = orders.Where(x => x.text == seat.text);
                            var add_menus = seat_orders.Select(x => x.menu).Distinct();
                            foreach (var add_menu in add_menus)
                            {
                                var add_orders = seat_orders.Where(x => x.menu == add_menu && (x.priceType == null || x.priceType != "停止消费"));
                                if (add_orders.Count() == 0)
                                    continue;

                                var max_time = add_orders.Max(x => x.inputTime);
                                var max_order = add_orders.OrderByDescending(x => x.inputTime).FirstOrDefault();
                                if (max_order == null || max_order.priceType == "每小时")
                                    continue;

                                var the_menu = all_menus.FirstOrDefault(x => x.name == add_menu);
                                double menu_time = the_menu.timeLimitHour.Value * 60 + the_menu.timeLimitMiniute.Value;
                                if ((the_menu.timeLimitType == null || the_menu.timeLimitType == "限时长") &&
                                    (DateTime.Now - max_order.inputTime).TotalMinutes < menu_time)
                                    continue;
                                else if ((the_menu.timeLimitType != null && the_menu.timeLimitType == "限时间"))
                                {
                                    DateTime dt = DateTime.Parse(DateTime.Now.ToLongDateString() + " "
                                        + the_menu.timeLimitHour.ToString() + ":"
                                        + the_menu.timeLimitMiniute.ToString() + ":00");

                                    DateTime dt_st = DateTime.Parse(DateTime.Now.ToLongDateString() + " 8:00:00");

                                    if (!(max_order.inputTime <= dt_st && DateTime.Now >= dt))
                                        continue;
                                }

                                if (the_menu.addType == "按项目单位")
                                {
                                    Orders new_order = new Orders();
                                    new_order.menu = max_order.menu;
                                    new_order.text = max_order.text;
                                    new_order.systemId = seat.systemId;
                                    new_order.number = 1;
                                    new_order.money = the_menu.price;
                                    new_order.technician = max_order.technician;
                                    new_order.techType = max_order.techType;
                                    new_order.inputTime = DateTime.Now;
                                    new_order.inputEmployee = "电脑加收";
                                    new_order.paid = false;

                                    //如果这个检查手牌的状态在进SeatExpenseForm之前,但是subitchanges在进SeatExpenseForm之后,
                                    //那么dgvExpense将会看不到超时浴资
                                    dc.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, seat);
                                    if ((seat.status == 2 || seat.status == 6 || seat.status == 7) &&
                                        (seat.paying == null || !seat.paying.Value) &&
                                        (seat.ordering == null || !seat.ordering.Value))
                                    {
                                        dc.Orders.InsertOnSubmit(new_order);
                                    }
                                }
                                else if (the_menu.addType == "按时间")
                                {
                                    Orders new_order = new Orders();
                                    new_order.menu = max_order.menu;
                                    new_order.text = max_order.text;
                                    new_order.systemId = seat.systemId;
                                    new_order.number = 1;
                                    new_order.priceType = "每小时";
                                    new_order.money = Convert.ToDouble(the_menu.addMoney);
                                    new_order.technician = max_order.technician;
                                    new_order.techType = max_order.techType;
                                    new_order.inputTime = DateTime.Now;
                                    new_order.inputEmployee = "电脑加收";
                                    new_order.paid = false;

                                    dc.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, seat);
                                    if ((seat.status == 2 || seat.status == 6 || seat.status == 7) &&
                                        (seat.paying == null || !seat.paying.Value) &&
                                        (seat.ordering == null || !seat.ordering.Value))
                                    {
                                        dc.Orders.InsertOnSubmit(new_order);
                                        //dc.SubmitChanges();
                                    }
                                }
                            }
                        }
                    }
                    dc.SubmitChanges();
                }
                catch
                {
                }
            }
        }
Ejemplo n.º 14
0
        public static void find_combo_duplicated(string con_str, string systemId, string text)
        {
            var db = new BathDBDataContext(con_str);
            db.Orders.DeleteAllOnSubmit(db.Orders.Where(x => x.systemId == systemId && x.menu.Contains("套餐")));
            var orders = db.Orders.Where(x => x.systemId == systemId && x.deleteEmployee == null);
            orders = orders.Where(x => !x.inputEmployee.Contains("电脑") && !x.menu.Contains("套餐"));
            foreach (Orders tmp_order in orders)
            {
                if (tmp_order.comboId != null)
                {
                    tmp_order.comboId = null;
                    tmp_order.money = db.Menu.FirstOrDefault(x => x.name == tmp_order.menu).price * tmp_order.number;
                }
            }
            db.SubmitChanges();

            var menus = db.Menu;
            var comboList = db.Combo.OrderByDescending(x => x.freePrice);

            List<int> ids = new List<int>();
            foreach (Combo combo in comboList)
            {
                if (combo.priceType == "消费满免项目")
                {
                    if (get_seat_expense_for_combo(db, combo, systemId) < combo.expenseUpTo)
                        continue;

                    var freeIds = BathClass.disAssemble(combo.freeMenuIds);
                    var combo_menus = menus.Where(x => freeIds.Contains(x.id)).Select(x => x.name);
                    foreach (var combo_menu in combo_menus)
                    {
                        var tmp_order = orders.FirstOrDefault(x => x.menu == combo_menu && !ids.Contains(x.id));
                        if (tmp_order == null) continue;
                        tmp_order.comboId = combo.id;
                        tmp_order.money = 0;
                        ids.Add(tmp_order.id);
                    }
                }
                else
                {
                    List<int> menuIds = disAssemble(combo.menuIds);
                    var combo_menus = menus.Where(x => menuIds.Contains(x.id)).Select(x => x.name);
                    var order_menus = orders.Where(x => !ids.Contains(x.id)).Select(x => x.menu);
                    if (combo_menus.All(x => order_menus.Any(y => y == x)))
                    {
                        foreach (var combo_menu in combo_menus)
                        {
                            var tmp_order = orders.FirstOrDefault(x => x.menu == combo_menu);
                            tmp_order.comboId = combo.id;
                            ids.Add(tmp_order.id);
                            if (combo.priceType == "免项目")
                            {
                                var freeIds = BathClass.disAssemble(combo.freeMenuIds);
                                var freeMenus = db.Menu.Where(x => freeIds.Contains(x.id)).Select(x => x.name);
                                if (freeMenus.Contains(tmp_order.menu))
                                    tmp_order.money = 0;
                            }
                        }
                        if (combo.priceType == "减金额")
                        {
                            Orders comboOrder = new Orders();
                            comboOrder.menu = "套餐" + combo.id.ToString() + "优惠";
                            comboOrder.text = text;
                            comboOrder.systemId = systemId;
                            comboOrder.number = 1;
                            comboOrder.inputTime = DateTime.Now;
                            comboOrder.inputEmployee = "套餐";
                            comboOrder.paid = false;
                            comboOrder.comboId = combo.id;
                            comboOrder.money = Convert.ToDouble(combo.price) - combo.originPrice;

                            db.Orders.InsertOnSubmit(comboOrder);
                        }
                    }
                }
            }
            db.SubmitChanges();
        }