Пример #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            = BathClass.ToBool(db_new.Options.FirstOrDefault().允许手工输入手牌号结账);

            m_Seat = db_new.HotelRoom.FirstOrDefault(x => x.text == btn.Text);
            var mtype = db_new.HotelRoomType.FirstOrDefault(x => x.id == m_Seat.typeId);

            if (!manuInput && mtype.menuId != null)
            {
                BathClass.printErrorMsg("不允许手工输入手牌号结账!");
                return;
            }

            switch (m_Seat.status)
            {
            case 1:    //可用
            case 3:    //已经结账
                break;

            case 2:    //正在使用
            case 6:    //警告
            case 7:    //押金离场
            case 8:    //重新结账
                if (m_Seat.note != null && m_Seat.note != "")
                {
                    BathClass.printInformation(m_Seat.note);
                }

                SeatExpenseForm seatExpenseForm = new SeatExpenseForm(m_Seat);
                seatExpenseForm.ShowDialog();
                break;

            case 4:    //锁定
                break;

            case 5:    //停用
                BathClass.printErrorMsg("台位已经停用!");
                break;

            default:
                break;
            }
        }
Пример #2
0
 private void show_seat_expense_form(CSeat seat)
 {
     SeatExpenseForm seatExpenseForm = new SeatExpenseForm(seat, seat_length, seatLock, auto_seat_card, dao);
     seatExpenseForm.ShowDialog();
 }
Пример #3
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 = BathClass.ToBool(db_new.Options.FirstOrDefault().允许手工输入手牌号结账);
            m_Seat = db_new.HotelRoom.FirstOrDefault(x => x.text == btn.Text);
            var mtype = db_new.HotelRoomType.FirstOrDefault(x => x.id == m_Seat.typeId);
            if (!manuInput && mtype.menuId != null)
            {
                BathClass.printErrorMsg("不允许手工输入手牌号结账!");
                return;
            }

            switch (m_Seat.status)
            {
                case 1://可用
                case 3://已经结账
                    break;
                case 2://正在使用
                case 6://警告
                case 7://押金离场
                case 8://重新结账
                    if (m_Seat.note != null && m_Seat.note != "")
                        BathClass.printInformation(m_Seat.note);

                    SeatExpenseForm seatExpenseForm = new SeatExpenseForm(m_Seat);
                    seatExpenseForm.ShowDialog();
                    break;
                case 4://锁定
                    break;
                case 5://停用
                    BathClass.printErrorMsg("台位已经停用!");
                    break;
                default:
                    break;
            }
        }
Пример #4
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 manuInput = BathClass.ToBool(db_new.Options.FirstOrDefault().允许手工输入手牌号结账);

            var seat1 = db_new.HotelRoom.FirstOrDefault(x => x.text == text);
            var seat2 = db_new.HotelRoom.FirstOrDefault(x => x.oId == text);
            if (seat1 == null && seat2 == null)
            {
                BathClass.printErrorMsg("手牌不可用!");
                return;
            }

            if (seat1 != null)
            {
                var mtype = db_new.HotelRoomType.FirstOrDefault(x => x.id == seat1.typeId);
                if (!manuInput && mtype.menuId != null)
                {
                    BathClass.printErrorMsg("不允许手工输入手牌号结账!");
                    return;
                }
                int status = seat1.status;
                if (status == 2 || status == 6 || status == 7 || status == 8)
                {
                    if (seat1.note != null && seat1.note != "")
                        BathClass.printInformation(seat1.note);

                    SeatExpenseForm seatExpenseForm = new SeatExpenseForm(seat1);
                    seatExpenseForm.ShowDialog();
                }
                else if (status == 4)
                    BathClass.printErrorMsg("台位已经锁定!");
                else if (status == 5)
                    BathClass.printErrorMsg("台位已经停用!");
            }
            else if (seat2 != null)
            {
                var mtype = db_new.HotelRoomType.FirstOrDefault(x => x.id == seat2.typeId);
                if (!manuInput && mtype.menuId != null)
                {
                    BathClass.printErrorMsg("不允许手工输入手牌号结账!");
                    return;
                }

                int status = seat2.status;
                if (status == 2 || status == 6 || status == 7 || status == 8)
                {
                    if (seat2.note != null && seat2.note != "")
                        BathClass.printInformation(seat2.note);

                    SeatExpenseForm seatExpenseForm = new SeatExpenseForm(seat2);
                    seatExpenseForm.ShowDialog();
                }
                else if (status == 4)
                    BathClass.printErrorMsg("台位已经锁定!");
                else if (status == 5)
                    BathClass.printErrorMsg("台位已经停用!");
            }
        }
Пример #5
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 manuInput            = BathClass.ToBool(db_new.Options.FirstOrDefault().允许手工输入手牌号结账);

            var seat1 = db_new.HotelRoom.FirstOrDefault(x => x.text == text);
            var seat2 = db_new.HotelRoom.FirstOrDefault(x => x.oId == text);

            if (seat1 == null && seat2 == null)
            {
                BathClass.printErrorMsg("手牌不可用!");
                return;
            }

            if (seat1 != null)
            {
                var mtype = db_new.HotelRoomType.FirstOrDefault(x => x.id == seat1.typeId);
                if (!manuInput && mtype.menuId != null)
                {
                    BathClass.printErrorMsg("不允许手工输入手牌号结账!");
                    return;
                }
                int status = seat1.status;
                if (status == 2 || status == 6 || status == 7 || status == 8)
                {
                    if (seat1.note != null && seat1.note != "")
                    {
                        BathClass.printInformation(seat1.note);
                    }

                    SeatExpenseForm seatExpenseForm = new SeatExpenseForm(seat1);
                    seatExpenseForm.ShowDialog();
                }
                else if (status == 4)
                {
                    BathClass.printErrorMsg("台位已经锁定!");
                }
                else if (status == 5)
                {
                    BathClass.printErrorMsg("台位已经停用!");
                }
            }
            else if (seat2 != null)
            {
                var mtype = db_new.HotelRoomType.FirstOrDefault(x => x.id == seat2.typeId);
                if (!manuInput && mtype.menuId != null)
                {
                    BathClass.printErrorMsg("不允许手工输入手牌号结账!");
                    return;
                }

                int status = seat2.status;
                if (status == 2 || status == 6 || status == 7 || status == 8)
                {
                    if (seat2.note != null && seat2.note != "")
                    {
                        BathClass.printInformation(seat2.note);
                    }

                    SeatExpenseForm seatExpenseForm = new SeatExpenseForm(seat2);
                    seatExpenseForm.ShowDialog();
                }
                else if (status == 4)
                {
                    BathClass.printErrorMsg("台位已经锁定!");
                }
                else if (status == 5)
                {
                    BathClass.printErrorMsg("台位已经停用!");
                }
            }
        }
Пример #6
0
        //F6开牌
        private void tool_open_seat()
        {
            if (tSeat.Text == "")
                return;

            string text = tSeat.Text;
            tSeat.Text = "";
            var use_idCard = MConvert<bool>.ToTypeOrDefault(LogIn.options.启用ID手牌锁, false);
            var manuInput = MConvert<bool>.ToTypeOrDefault(LogIn.options.允许手工输入手牌号结账, false);
            var manuOpen = MConvert<bool>.ToTypeOrDefault(LogIn.options.允许手工输入手牌号开牌, false);

            var seat1 = dao.get_seat("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
                {

                    SeatStatus status = seat1.status;
                    if (status == SeatStatus.USING || status == SeatStatus.WARNING ||
                        status == SeatStatus.DEPOSITLEFT || status == SeatStatus.REPAIED)
                    {
                        if (seat1.deposit != null)
                            BathClass.printInformation("交押金:" + seat1.deposit.ToString());

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

                        SeatExpenseForm seatExpenseForm = new SeatExpenseForm(seat1, -1, seatLock, auto_seat_card, dao);
                        seatExpenseForm.ShowDialog();
                    }
                    else if (status==SeatStatus.AVILABLE||status==SeatStatus.PAIED)
                    {
                        if (!manuOpen && mtype.menuId != null)
                        {
                            BathClass.printErrorMsg("不允许手工输入手牌号开牌!");
                            return;
                        }
                        open_seat(seat1);
                    }
                    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);
                if (seat2 == null)
                {
                    BathClass.printErrorMsg("手牌不存在!");
                    return;
                }
                var mtype = dao.get_seattype("id", seat2.typeId);
                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);

                    SeatExpenseForm seatExpenseForm = new SeatExpenseForm(seat2, -1, seatLock, auto_seat_card, dao);
                    seatExpenseForm.ShowDialog();
                }
                else if (status==SeatStatus.AVILABLE || status==SeatStatus.PAIED)
                {
                    if (!manuOpen && mtype.menuId != null)
                    {
                        BathClass.printErrorMsg("不允许手工输入手牌号开牌!");
                        return;
                    }
                    open_seat(seat2);
                }
                else if (status == SeatStatus.LOCKING)
                    BathClass.printErrorMsg("台位已经锁定!");
                else if (status == SeatStatus.STOPPED)
                    BathClass.printErrorMsg("台位已经停用!");
            }
        }