コード例 #1
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 = "";
        }
コード例 #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;
            }
        }
コード例 #3
0
ファイル: MainWindow.cs プロジェクト: zanderphh/yousoftbath
        //F6开牌
        private void tool_open_seat()
        {
            if (tSeat.Text == "")
            {
                return;
            }

            BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString);
            string            text   = tSeat.Text;

            tSeat.Text = "";

            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);

                switch (seat1.status)
                {
                case 1:    //可用
                case 3:    //已经结账
                    if (!BathClass.ToBool(db_new.Options.FirstOrDefault().允许手工输入手牌号开牌) && mtype.menuId != null)
                    {
                        BathClass.printErrorMsg("不允许手工输入手牌号开牌!");
                        break;
                    }
                    open_seat(seat1, db_new);
                    break;

                case 2:    //正在使用
                case 7:    //押金离场
                    if (!BathClass.getAuthority(db_new, LogIn.m_User, "完整点单") &&
                        !BathClass.getAuthority(db_new, LogIn.m_User, "可见本人点单"))
                    {
                        BathClass.printErrorMsg("权限不够");
                        break;
                    }

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

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

                    seat1.ordering = false;
                    db_new.SubmitChanges();
                    break;

                case 4:    //锁定
                    BathClass.printErrorMsg("台位已经锁定!");
                    break;

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

                case 6:    //警告
                    var orderCheckForm = new HotelRoomOrderCheckForm(m_Seat);
                    orderCheckForm.ShowDialog();
                    break;

                case 8:
                    BathClass.printErrorMsg("补救台位不能录单");
                    break;

                default:
                    break;
                }
            }
            else if (seat2 != null)
            {
                var mtype = db_new.HotelRoomType.FirstOrDefault(x => x.id == seat2.typeId);

                switch (seat2.status)
                {
                case 1:    //可用
                case 3:    //已经结账
                    open_seat(seat2, db_new);
                    break;

                case 2:    //正在使用
                case 7:    //押金离场
                    if (!BathClass.getAuthority(db_new, LogIn.m_User, "完整点单") &&
                        !BathClass.getAuthority(db_new, LogIn.m_User, "可见本人点单"))
                    {
                        BathClass.printErrorMsg("权限不够");
                        break;
                    }

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

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

                    seat2.ordering = false;
                    db_new.SubmitChanges();
                    break;

                case 4:    //锁定
                    BathClass.printErrorMsg("台位已经锁定!");
                    break;

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

                case 6:    //警告
                    var orderCheckForm = new HotelRoomOrderCheckForm(m_Seat);
                    orderCheckForm.ShowDialog();
                    break;

                case 8:
                    BathClass.printErrorMsg("补救台位不能录单");
                    break;

                default:
                    break;
                }
            }
        }
コード例 #4
0
ファイル: MainWindow.cs プロジェクト: zanderphh/yousoftbath
        //点击台位按钮
        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_Seat = db_new.HotelRoom.FirstOrDefault(x => x.text == btn.Text);
            var mtype = db_new.HotelRoomType.FirstOrDefault(x => x.id == m_Seat.typeId);

            switch (m_Seat.status)
            {
            case 1:    //可用
            case 3:    //已经结账
                if (!BathClass.ToBool(db_new.Options.FirstOrDefault().允许手工输入手牌号开牌) && mtype.menuId != null)
                {
                    BathClass.printErrorMsg("不允许手工输入手牌号开牌!");
                    break;
                }
                open_seat(m_Seat, db_new);
                break;

            case 2:    //正在使用
            case 7:    //押金离场
                if (!BathClass.getAuthority(db_new, LogIn.m_User, "完整点单") &&
                    !BathClass.getAuthority(db_new, LogIn.m_User, "可见本人点单"))
                {
                    BathClass.printErrorMsg("权限不够");
                    break;
                }
                m_Seat.ordering = true;
                db_new.SubmitChanges();

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


                m_Seat.ordering = false;
                db_new.SubmitChanges();
                break;

            case 4:    //锁定
                break;

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

            case 6:    //警告
                var orderCheckForm = new HotelRoomOrderCheckForm(m_Seat);
                orderCheckForm.ShowDialog();
                break;

            case 8:    //重新结账
                BathClass.printErrorMsg("补救台位不能录单");
                break;

            default:
                break;
            }
        }
コード例 #5
0
ファイル: MainForm.cs プロジェクト: huaminglee/yousoftbath
        //点击台位按钮
        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;
            }
        }
コード例 #6
0
ファイル: MainForm.cs プロジェクト: huaminglee/yousoftbath
        //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 = "";
        }