예제 #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;
            }

            OrderForm orderForm = new OrderForm(m_Seat, LogIn.m_User, LogIn.connectionString, false);
            orderForm.ShowDialog();
            dgvExpense_show();
        }
예제 #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_Seat = db_new.Seat.FirstOrDefault(x => x.text == btn.Text);
            m_Seat = dao.get_seat("text", btn.Text);

            SeatStatus status = m_Seat.status;
            switch (status)
            {
                case SeatStatus.AVILABLE://可用
                case SeatStatus.PAIED://已经结账
                    BathClass.printErrorMsg("手牌未开牌");
                    break;
                case SeatStatus.USING://正在使用
                case SeatStatus.DEPOSITLEFT://押金离场
                    if (!dao.get_authority(LogIn.m_User, "完整点单") &&
                        !dao.get_authority(LogIn.m_User, "可见本人点单"))
                    {
                        BathClass.printErrorMsg("权限不够!");
                        break;
                    }

                    if (MConvert<bool>.ToTypeOrDefault(m_Seat.paying, false))
                    {
                        BathClass.printErrorMsg("正在结账!");
                        break;
                    }
                    //if (BathClass.ToBool(m_Seat.ordering))
                    //{
                    //    BathClass.printErrorMsg("正在录单!");
                    //    break;
                    //}

                    //m_Seat.ordering = true;
                    //db_new.SubmitChanges();

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

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

                    break;
                case SeatStatus.LOCKING://锁定
                    BathClass.printErrorMsg("手牌已经锁定!");
                    break;
                case SeatStatus.STOPPED://停用
                    BathClass.printErrorMsg("台位已经停用!");
                    break;
                case SeatStatus.WARNING://警告
                    OrderCheckForm orderCheckForm = new OrderCheckForm(m_Seat, LogIn.connectionString, LogIn.options);
                    orderCheckForm.ShowDialog();
                    break;
                case SeatStatus.REPAIED:
                    BathClass.printErrorMsg("补救台位不能录单");
                    break;
                default:
                    break;
            }
        }
예제 #3
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(seat, LogIn.m_User, LogIn.connectionString, false);
            orderForm.ShowDialog();

            //seat.ordering = false;
            //db_new.SubmitChanges();
        }
예제 #4
0
        //F6开牌
        private void tool_open_seat()
        {
            //BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString);
            string text = tSeat.Text;
            m_Seat = dao.get_seat("text='" + text + "' or oId='" + text + "'");
            //m_Seat = db_new.Seat.FirstOrDefault(x => x.text == text || x.oId == text);
            if (m_Seat == null)
            {
                BathClass.printErrorMsg("手牌不可用!");
                return;
            }

            switch (m_Seat.status)
            {
                case SeatStatus.AVILABLE://可用
                case SeatStatus.PAIED://已经结账
                    BathClass.printErrorMsg("手牌未开牌");
                    break;
                case SeatStatus.USING://正在使用
                case SeatStatus.DEPOSITLEFT://押金离场
                    if (!dao.get_authority(LogIn.m_User, "完整点单") &&
                        !dao.get_authority(LogIn.m_User, "可见本人点单"))
                    {
                        BathClass.printErrorMsg("权限不够!");
                        break;
                    }
                    if (MConvert<bool>.ToTypeOrDefault(m_Seat.paying, false))
                    {
                        BathClass.printErrorMsg("正在结账!");
                        break;
                    }
                    //if (BathClass.ToBool(m_Seat.ordering))
                    //{
                    //    BathClass.printErrorMsg("正在录单!");
                    //    break;
                    //}

                    //m_Seat.ordering = true;
                    //db_new.SubmitChanges();

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

                    //m_Seat.ordering = false;
                    //db_new.SubmitChanges();
                    break;
                case SeatStatus.LOCKING://锁定
                    BathClass.printErrorMsg("手牌已经锁定!");
                    break;
                case SeatStatus.STOPPED://停用
                    BathClass.printErrorMsg("手牌已经停用!");
                    break;
                case SeatStatus.WARNING://警告
                    OrderCheckForm orderCheckForm = new OrderCheckForm(m_Seat, LogIn.connectionString,LogIn.options);
                    orderCheckForm.ShowDialog();
                    break;
                case SeatStatus.REPAIED:
                    BathClass.printErrorMsg("补救台位不能录单");
                    break;
                default:
                    break;
            }

            tSeat.Text = "";
        }
예제 #5
0
        //消费录入
        private void orderTool_Click(object sender, EventArgs e)
        {
            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;

            OrderForm orderForm = new OrderForm(inputSeatForm.m_Seat, LogIn.m_User, LogIn.connectionString, false);
            orderForm.ShowDialog();
        }
예제 #6
0
 private void orderform_show(CSeat seat)
 {
     OrderForm orderForm = new OrderForm(seat, LogIn.m_User, LogIn.connectionString, false);
     orderForm.ShowDialog();
 }
예제 #7
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_Seat = db_new.Seat.FirstOrDefault(x => x.text == btn.Text);
            m_Seat = dao.get_seat("text", btn.Text);
            //var seat_menu = dao.get_seat_menu(m_Seat.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://已经结账
                    if (!MConvert<bool>.ToTypeOrDefault(LogIn.options.允许手工输入手牌号开牌, false) && mtype.menuId != null)
                    {
                        BathClass.printErrorMsg("不允许手工输入手牌号开牌!");
                        break;
                    }
                    if (MConvert<bool>.ToTypeOrDefault(mtype.depositeRequired, false))
                    {
                        OpenDepositForm form = new OpenDepositForm(m_Seat);
                        if (form.ShowDialog() != DialogResult.OK)
                            return;
                    }
                    open_seat(m_Seat);
                    break;
                case SeatStatus.USING://正在使用
                case SeatStatus.DEPOSITLEFT://押金离场
                    if (MConvert<bool>.ToTypeOrDefault(m_Seat.paying, false))
                    {
                        BathClass.printErrorMsg("正在结账!");
                        break;
                    }
                    //if (BathClass.ToBool(m_Seat.ordering))
                    //{
                    //    BathClass.printErrorMsg("正在录单!");
                    //    break;
                    //}
                    if (!dao.get_authority(LogIn.m_User, "完整点单") &&
                        !dao.get_authority(LogIn.m_User, "可见本人点单"))
                    {
                        BathClass.printErrorMsg("权限不够");
                        break;
                    }
                    //m_Seat.ordering = true;
                    //db_new.SubmitChanges();

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

                    //m_Seat.ordering = false;
                    //db_new.SubmitChanges();
                    break;
                case SeatStatus.LOCKING://锁定
                    break;
                case SeatStatus.STOPPED://停用
                    BathClass.printErrorMsg("台位已经停用!");
                    break;
                case SeatStatus.WARNING://警告
                    break;
                case SeatStatus.REPAIED://重新结账
                    BathClass.printErrorMsg("补救台位不能录单");
                    break;
                case SeatStatus.RESERVE://客房预定
                    BathClass.printErrorMsg("预定台位不能录单");
                    break;
                default:
                    break;
            }
        }
예제 #8
0
        //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 = dao.get_seat("text", text);
            var seat2 = dao.get_seat("oId", text);
            //var seat1 = db_new.Seat.FirstOrDefault(x => x.text == text);
            //var seat2 = db_new.Seat.FirstOrDefault(x => x.oId == text);
            if (seat1 == null && seat2 == null)
            {
                BathClass.printErrorMsg("手牌不可用!");
                return;
            }

            if (seat1 != null)
            {
                //var mtype = db_new.SeatType.FirstOrDefault(x => x.id == seat1.typeId);
                var mtype = dao.get_seattype("id", seat1.typeId);
                switch (seat1.status)
                {
                    case SeatStatus.AVILABLE://可用
                    case SeatStatus.PAIED://已经结账
                        if (!MConvert<bool>.ToTypeOrDefault(LogIn.options.允许手工输入手牌号开牌, false) && mtype.menuId != null)
                        {
                            BathClass.printErrorMsg("不允许手工输入手牌号开牌!");
                            break;
                        }
                        open_seat(seat1);
                        //update_seats_ui();
                        break;
                    case SeatStatus.USING://正在使用
                    case SeatStatus.DEPOSITLEFT://押金离场
                        if (MConvert<bool>.ToTypeOrDefault(seat1.paying, false))
                        {
                            BathClass.printErrorMsg("正在结账!");
                            break;
                        }
                        //if (BathClass.ToBool(seat1.ordering))
                        //{
                        //    BathClass.printErrorMsg("正在录单!");
                        //    break;
                        //}
                        if (!dao.get_authority(LogIn.m_User, "完整点单") &&
                            !dao.get_authority(LogIn.m_User, "可见本人点单"))
                        {
                            BathClass.printErrorMsg("权限不够");
                            break;
                        }

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

                        OrderForm orderForm = new OrderForm(seat1, LogIn.m_User, LogIn.connectionString, false);
                        orderForm.ShowDialog();

                        //seat1.ordering = false;
                        //db_new.SubmitChanges();
                        break;
                    case SeatStatus.LOCKING://锁定
                        BathClass.printErrorMsg("台位已经锁定!");
                        break;
                    case SeatStatus.STOPPED://停用
                        BathClass.printErrorMsg("台位已经停用!");
                        break;
                    case SeatStatus.WARNING://警告
                        BathClass.printErrorMsg("台位已经警告!");
                        break;
                    case SeatStatus.REPAIED:
                        BathClass.printErrorMsg("补救台位不能录单");
                        break;
                    default:
                        break;
                }
            }
            else if (seat2 != null)
            {
                //var mtype = db_new.SeatType.FirstOrDefault(x => x.id == seat2.typeId);
                var mtype = dao.get_seattype("id", seat2.typeId);
                switch (seat2.status)
                {
                    case SeatStatus.AVILABLE://可用
                    case SeatStatus.PAIED://已经结账
                        open_seat(seat2);
                        break;
                    case SeatStatus.USING://正在使用
                    case SeatStatus.DEPOSITLEFT://押金离场
                        if (MConvert<bool>.ToTypeOrDefault(seat2.paying, false))
                        {
                            BathClass.printErrorMsg("正在结账!");
                            break;
                        }
                        //if (BathClass.ToBool(seat2.ordering))
                        //{
                        //    BathClass.printErrorMsg("正在录单!");
                        //    break;
                        //}
                        if (!dao.get_authority(LogIn.m_User, "完整点单") &&
                            !dao.get_authority(LogIn.m_User, "可见本人点单"))
                        {
                            BathClass.printErrorMsg("权限不够");
                            break;
                        }

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

                        OrderForm orderForm = new OrderForm(seat2, LogIn.m_User, LogIn.connectionString, false);
                        orderForm.ShowDialog();

                        //seat2.ordering = false;
                        //db_new.SubmitChanges();
                        break;
                    case SeatStatus.LOCKING://锁定
                        BathClass.printErrorMsg("台位已经锁定!");
                        break;
                    case SeatStatus.STOPPED://停用
                        BathClass.printErrorMsg("台位已经停用!");
                        break;
                    case SeatStatus.WARNING://警告
                        BathClass.printErrorMsg("台位已经警告!");
                        break;
                    case SeatStatus.REPAIED:
                        BathClass.printErrorMsg("补救台位不能录单");
                        break;
                    default:
                        break;
                }
            }
        }