Пример #1
0
        //修改技师号
        private void dgvExpense_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvExpense.CurrentCell == null)
            {
                return;
            }

            string orderId = dgvExpense.CurrentRow.Cells[0].Value.ToString();
            string techId  = dgvExpense.CurrentRow.Cells[4].Value.ToString();

            //var order = db.Orders.FirstOrDefault(x => x.id.ToString() == dgvExpense.CurrentRow.Cells[0].Value.ToString());
            if (techId == null || techId == "")
            {
                return;
            }

            if (BathClass.printAskMsg("当前技师为" + techId + "确认更换技师?") != DialogResult.Yes)
            {
                return;
            }

            var form = new InputEmployee("请输入技师号...");

            if (form.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            if (!dao.execute_command("update [Orders] set technician='" + form.employee.id + "' where id=" + orderId))
            {
                BathClass.printErrorMsg("技师号修改失败,请重试!");
                return;
            }
            dgvExpense.CurrentRow.Cells[4].Value = form.employee.id;
            //var tech = form.employee;
            //order.technician = tech.id;
            //db.SubmitChanges();
            //dgvExpense_show();
        }
Пример #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();
        }
Пример #3
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();
        }
Пример #4
0
        //修改技师号
        private void dgvExpense_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvExpense.CurrentCell == null)
                return;

            string orderId = dgvExpense.CurrentRow.Cells[0].Value.ToString();
            string techId = dgvExpense.CurrentRow.Cells[4].Value.ToString();
            //var order = db.Orders.FirstOrDefault(x => x.id.ToString() == dgvExpense.CurrentRow.Cells[0].Value.ToString());
            if (techId == null || techId == "")
                return;

            if (BathClass.printAskMsg("当前技师为" + techId + "确认更换技师?") != DialogResult.Yes)
                return;

            var form = new InputEmployee("请输入技师号...");
            if (form.ShowDialog() != DialogResult.OK)
                return;

            if (!dao.execute_command("update [Orders] set technician='"+form.employee.id+"' where id="+orderId))
            {
                BathClass.printErrorMsg("技师号修改失败,请重试!");
                return;
            }
            dgvExpense.CurrentRow.Cells[4].Value = form.employee.id;
            //var tech = form.employee;
            //order.technician = tech.id;
            //db.SubmitChanges();
            //dgvExpense_show();
        }