示例#1
0
        //点击台位按钮
        private void btn_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;
            btn.Enabled = false;
            btn.Enabled = true;

            //BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString);
            var manuInput = MConvert<bool>.ToTypeOrDefault(LogIn.options.允许手工输入手牌号结账, false);
            //m_Seat = db_new.Seat.FirstOrDefault(x => x.text == btn.Text);
            m_Seat = dao.get_seat("text", btn.Text);
            var mtype = dao.get_seattype("id", m_Seat.typeId);
            //var mtype = db_new.SeatType.FirstOrDefault(x => x.id == m_Seat.typeId);

            switch (m_Seat.status)
            {
                case SeatStatus.AVILABLE://可用
                case SeatStatus.PAIED://已经结账
                case SeatStatus.RESERVE://预定客房
                    if (mtype.department == "客房部")
                    {
                        var form = new OpenRoomForm(m_Seat);
                        form.ShowDialog();
                    }
                    else if (mtype.menuId == null)
                    {
                        BathClass.printErrorMsg("手牌未开牌");
                        return;
                    }
                    else if (!manuInput && mtype.menuId != null)
                    {

                        BathClass.printErrorMsg("不允许手工输入手牌号结账!");
                        return;
                    }
                    break;
                case SeatStatus.USING://正在使用
                case SeatStatus.WARNING://警告
                case SeatStatus.DEPOSITLEFT://押金离场
                case SeatStatus.REPAIED://重新结账
                    if (MConvert<bool>.ToTypeOrDefault(m_Seat.ordering, false))
                    {
                        BathClass.printErrorMsg("正在录单!");
                        return;
                    }

                    if (mtype.department != "客房部" && !manuInput && mtype.menuId != null)
                    {
                        BathClass.printErrorMsg("不允许手工输入手牌号结账!");
                        return;
                    }
                    if (m_Seat.deposit != null)
                        BathClass.printInformation("交押金:" + m_Seat.deposit.ToString());

                    if (m_Seat.note != null && m_Seat.note != "")
                        BathClass.printInformation(m_Seat.note);

                    if (mtype.menuId == null)
                    {
                        SeatExpenseForm seatExpenseForm = new SeatExpenseForm(m_Seat, seat_length, false, false, dao);
                        seatExpenseForm.Show();
                    }
                    else
                    {
                        SeatExpenseForm seatExpenseForm = new SeatExpenseForm(m_Seat, seat_length, seatLock, auto_seat_card, dao);
                        seatExpenseForm.Show();
                    }

                    break;
                case SeatStatus.LOCKING://锁定
                    break;
                case SeatStatus.STOPPED://停用
                    BathClass.printErrorMsg("台位已经停用!");
                    break;
                default:
                    break;
            }
        }
示例#2
0
        //结账
        private void payTool_Click(object sender, EventArgs e)
        {
            m_Seat = read_seat_by_card();
            if (m_Seat == null)
            {
                BathClass.printErrorMsg("读取房卡数据失败或者房间未定义!");
                return;
            }

            var mtype = dao.get_seattype("id", m_Seat.typeId);

            switch (m_Seat.status)
            {
                case SeatStatus.AVILABLE://可用
                case SeatStatus.PAIED://已经结账
                case SeatStatus.RESERVE://预定客房
                    var form = new OpenRoomForm(m_Seat);
                    form.ShowDialog();
                    break;
                case SeatStatus.USING://正在使用
                case SeatStatus.WARNING://警告
                case SeatStatus.DEPOSITLEFT://押金离场
                case SeatStatus.REPAIED://重新结账
                    if (m_Seat.deposit != null || m_Seat.depositBank != null)
                    {
                        BathClass.printInformation("现金押金:" + m_Seat.deposit.ToString() + "\n银联预授:"
                            + m_Seat.depositBank.ToString());
                    }

                    if (m_Seat.note != null && m_Seat.note != "")
                        BathClass.printInformation(m_Seat.note);

                    SeatExpenseForm seatExpenseForm = new SeatExpenseForm(m_Seat, -1, false, false, dao);
                    seatExpenseForm.Show();
                    break;
                case SeatStatus.LOCKING://锁定
                    break;
                case SeatStatus.STOPPED://停用
                    BathClass.printErrorMsg("台位已经停用!");
                    break;
                default:
                    break;
            }
        }
示例#3
0
        //F6开牌
        private void tool_open_seat()
        {
            if (tSeat.Text == "")
                return;

            string text = tSeat.Text;
            tSeat.Text = "";
            //BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString);
            //var ops = db_new.Options.FirstOrDefault();
            var manuInput = MConvert<bool>.ToTypeOrDefault(LogIn.options.允许手工输入手牌号结账, false);
            var use_idCard = MConvert<bool>.ToTypeOrDefault(LogIn.options.启用ID手牌锁, false);

            var seat1 = dao.get_seat("text", text);
            //var seat1 = db_new.Seat.FirstOrDefault(x => x.text == text);
            if (seat1 != null)
            {
                var mtype = dao.get_seattype("id", seat1.typeId);
                //var seatType = db_new.SeatType.FirstOrDefault(x => x.id == seat1.typeId);
                if (mtype.department == "客房部")
                {
                    var form = new OpenRoomForm(seat1);
                    form.ShowDialog();
                }
                else
                {
                    if (manuInput)
                    {
                        //var mtype = dao.get_seattype("id", seat1.typeId);
                        //var mtype = db_new.SeatType.FirstOrDefault(x => x.id == seat1.typeId);
                        if (!manuInput && mtype.menuId != null)
                        {
                            BathClass.printErrorMsg("不允许手工输入手牌号结账!");
                            return;
                        }
                        SeatStatus status = seat1.status;
                        if (status == SeatStatus.USING || status == SeatStatus.WARNING ||
                            status == SeatStatus.DEPOSITLEFT || status == SeatStatus.REPAIED)
                        {
                            if (MConvert<bool>.ToTypeOrDefault(seat1.ordering, false))
                            {
                                BathClass.printErrorMsg("正在录单!");
                                return;
                            }

                            if (seat1.deposit != null)
                                BathClass.printInformation("交押金:" + seat1.deposit.ToString());

                            if (seat1.note != null && seat1.note != "")
                                BathClass.printInformation(seat1.note);

                            if (mtype.menuId == null)
                            {
                                SeatExpenseForm seatExpenseForm = new SeatExpenseForm(seat1, seat_length, false, false, dao);
                                seatExpenseForm.Show();
                            }
                            else
                            {
                                SeatExpenseForm seatExpenseForm = new SeatExpenseForm(seat1, seat_length, seatLock, auto_seat_card, dao);
                                seatExpenseForm.Show();
                            }
                        }
                        else if (status == SeatStatus.LOCKING)
                            BathClass.printErrorMsg("台位已经锁定!");
                        else if (status == SeatStatus.STOPPED)
                            BathClass.printErrorMsg("台位已经停用!");
                    }
                }
            }
            else if (use_idCard)
            {
                var seat2 = dao.get_seat("oId", text);
                var mtype = dao.get_seattype("id", seat2.typeId);
                //var seat2 = db_new.Seat.FirstOrDefault(x => x.oId == text);
                SeatStatus status = seat2.status;
                if (status == SeatStatus.USING || status == SeatStatus.WARNING ||
                            status == SeatStatus.DEPOSITLEFT || status == SeatStatus.REPAIED)
                {
                    if (MConvert<bool>.ToTypeOrDefault(seat2.ordering, false))
                    {
                        BathClass.printErrorMsg("正在录单!");
                        return;
                    }

                    if (seat2.deposit != null)
                        BathClass.printInformation("交押金:" + seat2.deposit.ToString());

                    if (seat2.note != null && seat2.note != "")
                        BathClass.printInformation(seat2.note);

                    if (mtype.menuId == null)
                    {
                        SeatExpenseForm seatExpenseForm = new SeatExpenseForm(seat2, seat_length, false, false, dao);
                        seatExpenseForm.Show();
                    }
                    else
                    {
                        SeatExpenseForm seatExpenseForm = new SeatExpenseForm(seat2, seat_length, seatLock, auto_seat_card, dao);
                        seatExpenseForm.Show();
                    }
                }
                else if (status == SeatStatus.LOCKING)
                    BathClass.printErrorMsg("台位已经锁定!");
                else if (status == SeatStatus.STOPPED)
                    BathClass.printErrorMsg("台位已经停用!");
            }
        }
示例#4
0
        private void btn_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;
            btn.Enabled = false;
            btn.Enabled = true;

            m_Seat = dao.get_seat("text", btn.Text);
            var mtype = dao.get_seattype("id", m_Seat.typeId);

            switch (m_Seat.status)
            {
                case SeatStatus.AVILABLE://可用
                case SeatStatus.PAIED://已经结账
                case SeatStatus.RESERVE://预定客房
                    var form = new OpenRoomForm(m_Seat);
                    form.ShowDialog();
                    break;
                case SeatStatus.USING://正在使用
                case SeatStatus.WARNING://警告
                case SeatStatus.DEPOSITLEFT://押金离场
                case SeatStatus.REPAIED://重新结账
                    if (m_Seat.deposit != null || m_Seat.depositBank != null)
                    {
                        BathClass.printInformation("现金押金:" + m_Seat.deposit.ToString() + "\n银联预授:"
                            + m_Seat.depositBank.ToString());
                    }

                    if (m_Seat.note != null && m_Seat.note != "")
                        BathClass.printInformation(m_Seat.note);

                    SeatExpenseForm seatExpenseForm = new SeatExpenseForm(m_Seat, -1, false, false, dao);
                    seatExpenseForm.Show();
                    break;
                case SeatStatus.LOCKING://锁定
                    break;
                case SeatStatus.STOPPED://停用
                    BathClass.printErrorMsg("台位已经停用!");
                    break;
                default:
                    break;
            }
        }