Beispiel #1
0
        private void order_menu(CMenu menu)
        {
            string pars = "menu,text,systemId,number,money,inputTime,paid";
            string vals = "'" + menu.name + "','" + m_Seat.text + "','" + m_Seat.systemId + "',1," + menu.price + ",getdate(),'False'";

            if (inputBillId)
            {
                var form = new InputNumberStr("输入单据编号");
                if (form.ShowDialog() != DialogResult.OK)
                {
                    BathClass.printErrorMsg("需要输入单据编号");
                    return;
                }
                pars += ",billId";
                vals += ",'" + form.str + "'";
            }

            if (menu.technician)
            {
                pars += ",technician";
                if (!m_has_user)
                {
                    InputEmployee techForm = new InputEmployee("请输入技师号...");
                    if (techForm.ShowDialog() != DialogResult.OK)
                    {
                        BathClass.printErrorMsg("需要选择技师!");
                        return;
                    }
                    vals += ",'" + techForm.employee.id + "'";
                }
                else
                {
                    vals += ",'" + m_user.id + "'";
                }

                //是否需要输入点钟轮钟
                if (inputTechType)
                {
                    var form = new DianLunForm();
                    if (form.ShowDialog() != DialogResult.OK)
                    {
                        BathClass.printErrorMsg("需要输入上钟类型!");
                        return;
                    }
                    pars += ",techType";
                    vals += ",'" + form.tech_type + "'";
                }
            }
            if (!m_has_user && MConvert <bool> .ToTypeOrDefault(menu.waiter, false))
            {
                InputEmployee techForm = new InputEmployee("请输入服务员工号...");
                if (techForm.ShowDialog() != DialogResult.OK)
                {
                    BathClass.printErrorMsg("需要输入录单员!");
                    return;
                }
                pars += ",inputEmployee";
                vals += ",'" + techForm.employee.id + "'";
            }
            else
            {
                pars += ",inputEmployee";
                vals += ",'" + m_user.id + "'";
            }

            string cmd_str = @"insert into [Orders](" + pars + ") values(" + vals + ")";

            if (!dao.execute_command(cmd_str))
            {
                BathClass.printErrorMsg("录单失败,请重试!");
                return;
            }

            //BathClass.find_combo_duplicated(m_con_str, m_Seat.systemId, m_Seat.text);
            BathClass.find_combo(m_con_str, m_Seat.systemId, m_Seat.text);
            dgvExpense_show();
            Thread td = new Thread(delegate() { print_kitchen(menu); });

            td.Start();
        }
Beispiel #2
0
        private void order_menu(CMenu menu)
        {
            string pars = "menu,text,systemId,number,money,inputTime,paid";
            string vals = "'" + menu.name + "','" + m_Seat.text + "','" + m_Seat.systemId + "',1," + menu.price + ",getdate(),'False'";

            if (inputBillId)
            {
                var form = new InputNumberStr("输入单据编号");
                if (form.ShowDialog() != DialogResult.OK)
                {
                    BathClass.printErrorMsg("需要输入单据编号");
                    return;
                }
                pars += ",billId";
                vals += ",'" + form.str + "'";
            }

            if (menu.technician)
            {
                pars += ",technician";
                if (!m_has_user)
                {
                    InputEmployee techForm = new InputEmployee("请输入技师号...");
                    if (techForm.ShowDialog() != DialogResult.OK)
                    {
                        BathClass.printErrorMsg("需要选择技师!");
                        return;
                    }
                    vals += ",'" + techForm.employee.id + "'";
                }
                else
                    vals += ",'" + m_user.id + "'";

                //是否需要输入点钟轮钟
                if (inputTechType)
                {
                    var form = new DianLunForm();
                    if (form.ShowDialog() != DialogResult.OK)
                    {
                        BathClass.printErrorMsg("需要输入上钟类型!");
                        return;
                    }
                    pars += ",techType";
                    vals += ",'" + form.tech_type + "'";
                }
            }
            if (!m_has_user && MConvert<bool>.ToTypeOrDefault(menu.waiter, false))
            {
                InputEmployee techForm = new InputEmployee("请输入服务员工号...");
                if (techForm.ShowDialog() != DialogResult.OK)
                {
                    BathClass.printErrorMsg("需要输入录单员!");
                    return;
                }
                pars += ",inputEmployee";
                vals += ",'" + techForm.employee.id + "'";
            }
            else
            {
                pars += ",inputEmployee";
                vals += ",'" + m_user.id + "'";
            }

            string cmd_str = @"insert into [Orders](" + pars + ") values(" + vals + ")";
            if (!dao.execute_command(cmd_str))
            {
                BathClass.printErrorMsg("录单失败,请重试!");
                return;
            }

            //BathClass.find_combo_duplicated(m_con_str, m_Seat.systemId, m_Seat.text);
            BathClass.find_combo(m_con_str, m_Seat.systemId, m_Seat.text);
            dgvExpense_show();
            Thread td = new Thread(delegate() { print_kitchen(menu); });
            td.Start();
        }