Ejemplo n.º 1
0
        //消费录入
        private void toolOrder_Click(object sender, EventArgs e)
        {
            if (m_Seat == null)
            {
                BathClass.printErrorMsg("先选择手牌!");
                return;
            }

            var dc = new BathDBDataContext(LogIn.connectionString);
            if (!BathClass.getAuthority(dc, LogIn.m_User, "完整点单") &&
                !BathClass.getAuthority(dc, LogIn.m_User, "可见本人点单"))
            {
                BathClass.printErrorMsg("权限不够!");
                return;
            }

            var orderForm = new HotelRoomOrderForm(m_Seat);
            orderForm.ShowDialog();
            dgvExpense_show(dc);
            setStatus(dc);
        }
Ejemplo n.º 2
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);

            m_HotelRoom = db_new.HotelRoom.FirstOrDefault(x => x.text == btn.Text);
            int status = m_HotelRoom.status;
            switch (status)
            {
                case 1://可用
                case 3://已经结账
                    BathClass.printErrorMsg("手牌未开牌");
                    break;
                case 2://正在使用
                case 7://押金离场
                    if (!BathClass.getAuthority(db_new, LogIn.m_User, "完整点单") &&
                        !BathClass.getAuthority(db_new, LogIn.m_User, "可见本人点单"))
                    {
                        BathClass.printErrorMsg("权限不够!");
                        break;
                    }

                    if (m_HotelRoom.paying.HasValue && m_HotelRoom.paying.Value)
                    {
                        BathClass.printErrorMsg("正在结账!");
                        break;
                    }

                    m_HotelRoom.ordering = true;
                    db_new.SubmitChanges();

                    var orderForm = new HotelRoomOrderForm(m_HotelRoom);
                    orderForm.ShowDialog();

                    m_HotelRoom.ordering = false;
                    db_new.SubmitChanges();

                    break;
                case 4://锁定
                    BathClass.printErrorMsg("手牌已经锁定!");
                    break;
                case 5://停用
                    BathClass.printErrorMsg("台位已经停用!");
                    break;
                case 6://警告
                    var orderCheckForm = new HotelRoomOrderCheckForm(m_HotelRoom);
                    orderCheckForm.ShowDialog();
                    break;
                case 8:
                    BathClass.printErrorMsg("补救台位不能录单");
                    break;
                default:
                    break;
            }
        }
Ejemplo n.º 3
0
        //消费录入
        private void orderTool_Click(object sender, EventArgs e)
        {
            BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString);
            if (!BathClass.getAuthority(db_new, LogIn.m_User, "完整点单") &&
                !BathClass.getAuthority(db_new, LogIn.m_User, "可见本人点单"))
            {
                BathClass.printErrorMsg("权限不够!");
                return;
            }
            List<int> sLst = new List<int>();
            sLst.Add(2);
            sLst.Add(6);

            var inputSeatForm = new InputRoomForm(sLst);
            if (inputSeatForm.ShowDialog() != DialogResult.OK)
                return;

            var seat = db_new.HotelRoom.FirstOrDefault(x => x.text == inputSeatForm.m_Seat.text);
            seat.ordering = true;
            db_new.SubmitChanges();

            var orderForm = new HotelRoomOrderForm(inputSeatForm.m_Seat);
            orderForm.ShowDialog();

            seat.ordering = false;
            db_new.SubmitChanges();
        }
Ejemplo n.º 4
0
        //F6开牌
        private void tool_open_seat()
        {
            BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString);
            string text = tSeat.Text;
            tSeat.Text = "";
            m_HotelRoom = db_new.HotelRoom.FirstOrDefault(x => x.text == text || x.oId == text);
            if (m_HotelRoom == null)
            {
                BathClass.printErrorMsg("手牌不可用!");
                return;
            }

            switch (m_HotelRoom.status)
            {
                case 1://可用
                case 3://已经结账
                    BathClass.printErrorMsg("手牌未开牌");
                    break;
                case 2://正在使用
                case 7://押金离场
                    if (!BathClass.getAuthority(db_new, LogIn.m_User, "完整点单") &&
                        !BathClass.getAuthority(db_new, LogIn.m_User, "可见本人点单"))
                    {
                        BathClass.printErrorMsg("权限不够!");
                        break;
                    }
                    if (m_HotelRoom.paying.HasValue && m_HotelRoom.paying.Value)
                    {
                        BathClass.printErrorMsg("正在结账!");
                        break;
                    }

                    m_HotelRoom.ordering = true;
                    db_new.SubmitChanges();

                    HotelRoomOrderForm orderForm = new HotelRoomOrderForm(m_HotelRoom);
                    orderForm.ShowDialog();

                    m_HotelRoom.ordering = false;
                    db_new.SubmitChanges();
                    break;
                case 4://锁定
                    BathClass.printErrorMsg("手牌已经锁定!");
                    break;
                case 5://停用
                    BathClass.printErrorMsg("手牌已经停用!");
                    break;
                case 6://警告
                    HotelRoomOrderCheckForm orderCheckForm = new HotelRoomOrderCheckForm(m_HotelRoom);
                    orderCheckForm.ShowDialog();
                    break;
                case 8:
                    BathClass.printErrorMsg("补救台位不能录单");
                    break;
                default:
                    break;
            }

            tSeat.Text = "";
        }