Ejemplo n.º 1
0
        //消费录入
        private void orderTool_Click(object sender, EventArgs e)
        {
            //BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString);
            if (!dao.get_authority(LogIn.m_User, "完整点单") &&
                !dao.get_authority(LogIn.m_User, "可见本人点单"))
            {
                BathClass.printErrorMsg("权限不够!");
                return;
            }
            List <int> sLst = new List <int>();

            sLst.Add(2);
            sLst.Add(6);

            InputSeatForm inputSeatForm = new InputSeatForm(sLst);

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

            //var seat = dao.get_seat("text", inputSeatForm.m_Seat.text);
            //var seat = db_new.Seat.FirstOrDefault(x => x.text == inputSeatForm.m_Seat.text);
            //seat.ordering = true;
            //db_new.SubmitChanges();

            OrderForm orderForm = new OrderForm(inputSeatForm.m_Seat, LogIn.m_User, LogIn.connectionString, false);

            orderForm.ShowDialog();

            //seat.ordering = false;
            //db_new.SubmitChanges();
        }
Ejemplo n.º 2
0
        //停止消费
        private void btnOnClock_Click(object sender, EventArgs e)
        {
            InputSeatForm seatForm = new InputSeatForm(2);

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

            if (m_Seats.FirstOrDefault(x => x.text == seatForm.m_Seat.text) != null)
            {
                BathClass.printErrorMsg("转账手牌中已经包含该手牌,请重新输入");
                return;
            }

            string systemId = seatForm.m_Seat.systemId;

            foreach (Seat s in m_Seats)
            {
                var orderList = db.Orders.Where(x => x.systemId == s.systemId && x.deleteEmployee == null && !x.paid);
                foreach (Orders order in orderList)
                {
                    order.systemId = systemId;
                    if (order.priceType == "每小时")
                    {
                        order.priceType = "停止消费";
                        order.money     = order.money * Math.Ceiling((GeneralClass.Now - order.inputTime).TotalHours);
                    }
                }
                s.status = 3;
            }
            db.SubmitChanges();
            this.DialogResult = DialogResult.OK;
        }
Ejemplo n.º 3
0
        //更换手牌
        private void CtxChangeSeat_Click(object sender, EventArgs e)
        {
            BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString);
            Seat seat = getContextSenderSeat(db_new, sender);

            InputEmployeeByPwd inputEmployee = new InputEmployeeByPwd();

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

            if (!BathClass.getAuthority(db_new, inputEmployee.employee, "更换手牌"))
            {
                BathClass.printErrorMsg(inputEmployee.employee.id + "不具有更换手牌操作权限!");
                return;
            }

            if (seat.status != 2)
            {
                BathClass.printErrorMsg("该手牌目前不在使用中,不能换台!");
                return;
            }

            List <int> sLst = new List <int>();

            sLst.Add(1);
            sLst.Add(3);
            InputSeatForm inputSeatForm = new InputSeatForm(sLst);

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

            Seat newSeat = db_new.Seat.FirstOrDefault(x => x == inputSeatForm.m_Seat);
            var  orders  = db_new.Orders.Where(x => x.systemId == seat.systemId);

            foreach (Orders order in orders)
            {
                order.text = newSeat.text;
            }

            newSeat.systemId     = seat.systemId;
            newSeat.name         = seat.name;
            newSeat.population   = seat.population;
            newSeat.openTime     = BathClass.Now(LogIn.connectionString);
            newSeat.openEmployee = LogIn.m_User.name;
            newSeat.phone        = seat.phone;
            newSeat.chainId      = seat.chainId;
            newSeat.status       = seat.status;
            newSeat.note         = seat.note;
            newSeat.ordering     = seat.ordering;

            BathClass.reset_seat(seat);
            db_new.SubmitChanges();
        }
Ejemplo n.º 4
0
        //消费查看
        private void BtnExpense_Click(object sender, EventArgs e)
        {
            List<int> sList = new List<int>();
            sList.Add(2);
            sList.Add(6);

            InputSeatForm inputSeatForm = new InputSeatForm(sList);
            if (inputSeatForm.ShowDialog() == DialogResult.OK)
            {
                //修改
                //OrderCheckForm seatExpenseForm = new OrderCheckForm(inputSeatForm.m_Seat, connectionString);
                //seatExpenseForm.ShowDialog();
            }
        }
Ejemplo n.º 5
0
        //消费查看
        private void BtnExpense_Click(object sender, EventArgs e)
        {
            List <int> sList = new List <int>();

            sList.Add(2);
            sList.Add(6);
            sList.Add(7);

            InputSeatForm inputSeatForm = new InputSeatForm(sList);

            if (inputSeatForm.ShowDialog() == DialogResult.OK)
            {
                //修改
                //OrderCheckForm seatExpenseForm = new OrderCheckForm(inputSeatForm.m_Seat, connectionString);
                //seatExpenseForm.ShowDialog();
            }
        }
Ejemplo n.º 6
0
        //宾客转账
        private void transferTool_Click(object sender, EventArgs e)
        {
            InputSeatForm seatForm = new InputSeatForm(2);

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

            if (m_Seats.FirstOrDefault(x => x.text == seatForm.m_Seat.text) != null)
            {
                BathClass.printErrorMsg("转账手牌中已经包含该手牌,请重新输入");
                return;
            }

            var    dc       = new BathDBDataContext(LogIn.connectionString);
            string systemId = seatForm.m_Seat.systemId;

            foreach (HotelRoom s in m_Seats)
            {
                var orderList = dc.Orders.Where(x => x.systemId == s.systemId && x.deleteEmployee == null && !x.paid);
                foreach (Orders order in orderList)
                {
                    order.systemId = systemId;
                    if (order.priceType == "每小时")
                    {
                        order.priceType = "停止消费";
                        order.money     = order.money * Math.Ceiling((GeneralClass.Now - order.inputTime).TotalHours);
                    }
                    order.stopTiming = true;
                }
                dc.HotelRoom.FirstOrDefault(x => x.text == s.text).status = 3;
            }
            dc.SubmitChanges();

            List <string> printCols = new List <string>();

            printCols.Add("手牌");
            printCols.Add("项目名称");
            printCols.Add("技师");
            printCols.Add("单价");
            printCols.Add("数量");
            printCols.Add("金额");
            PrintSeatBill.Print_DataGridView(m_Seats, "转账确认单", dgvExpense, printCols, moneyPayable.Text, companyName);
            this.DialogResult = DialogResult.OK;
        }
Ejemplo n.º 7
0
        //会员自助结账
        private void btnPay_Click(object sender, EventArgs e)
        {
            List<int> sList = new List<int>();
            sList.Add(2);
            sList.Add(6);
            sList.Add(7);

            InputSeatForm inputSeatForm = new InputSeatForm(sList, connectionString);
            if (inputSeatForm.ShowDialog() != DialogResult.OK)
                return;

            SeatExpenseForm seatExpenseForm = new SeatExpenseForm(inputSeatForm.m_Seat);
            seatExpenseForm.ShowDialog();
        }
Ejemplo n.º 8
0
        //自动点单
        private void ExpenseOrder_Click(object sender, EventArgs e)
        {
            var db = new BathDBDataContext(connectionString);
            InputEmployee inputEmployee = new InputEmployee(db);
            if (inputEmployee.ShowDialog() != DialogResult.OK)
                return;

            Employee server = inputEmployee.emplyee;

            if (!BathClass.getAuthority(db, server, "完整点单") &&
                !BathClass.getAuthority(db, server, "可见本人点单"))
            {
                BathClass.printErrorMsg("权限不够,不能访问!");
                return;
            }
            List<int> sList = new List<int>();
            sList.Add(2);
            sList.Add(6);

            InputSeatForm inputSeatForm = new InputSeatForm(sList);
            if (inputSeatForm.ShowDialog() != DialogResult.OK)
                return;

            //var m_Seat = db.Seat.FirstOrDefault(x => x.Equals(inputSeatForm.m_Seat));
            //m_Seat.ordering = true;
            //db.SubmitChanges();

            //修改
            //OrderForm orderForm = new OrderForm(inputSeatForm.m_Seat, server, connectionString, true);
            //orderForm.ShowDialog();

            //m_Seat.ordering = false;
            //db.SubmitChanges();
        }