Example #1
0
        private void btnGuestPay_Click(object sender, EventArgs e)
        {
            //结账条件检查
            if (tabMain.TabCount <= 0)
            {
                md.MsgDivShow("sorry啊,店内装修,暂不营业", 1);
                return;
            }
            ListView lv = (ListView)tabMain.SelectedTab.Controls[0];

            if (lv.SelectedItems.Count <= 0)
            {
                md.MsgDivShow("亲,请先选择要结账的餐桌哦", 1);
                return;
            }
            RoomInfo room = (RoomInfo)tabMain.SelectedTab.Tag;
            DeskInfo desk = (DeskInfo)lv.SelectedItems[0].Tag;

            if (desk.DeskState == 0)
            {
                md.MsgDivShow("亲,请选择正在就餐的餐桌哦", 1);
                return;
            }
            //弹出结账窗体
            int         deskId  = (int)desk.DeskId;
            string      deskNum = desk.DeskName;
            int         orderId = new R_Order_DeskBLL().GetAliveOrderIdByDeskId((int)desk.DeskId);
            FrmGuestPay fcp     = FrmGuestPay.Single(deskId, deskNum, orderId);

            //刷新主窗体
            fcp.FormClosed += fb_FormClosed;
            fcp.Show();
        }
Example #2
0
        //上帝结账
        private void btnGuestPay_Click(object sender, EventArgs e)
        {
            ListView lv = (ListView)(tabMain.SelectedTab.Controls[0]);
            //房间的对象
            RoomInfo room = (RoomInfo)(tabMain.SelectedTab.Tag);

            //餐桌的对象
            if (lv.SelectedItems.Count <= 0)//没选中餐桌
            {
                md.MsgDivShow("请选中要结账的餐桌", 1);
                return;
            }
            DeskInfo dk = (lv.SelectedItems[0].Tag as DeskInfo);

            if (dk.DeskState == 0)//没有选中就餐的餐桌
            {
                md.MsgDivShow("请选择就餐的餐桌进行结账", 1);
                return;
            }
            //结账了--显示窗体
            //获取订单的id
            OrderInfoBll orderBll   = new OrderInfoBll();
            object       objOrderId = orderBll.GetOrderIdByDeskId(dk.DeskId);
            FrmGuestPay  fgp        = FrmGuestPay.Single(Convert.ToInt32(objOrderId), dk.DeskId, dk.DeskName);

            fgp.FormClosed += new FormClosedEventHandler(fbi_FormClosed); //刷新
            fgp.Show();                                                   //结账的窗体就显示出来
        }
Example #3
0
        //顾客结账了
        private void button3_Click(object sender, EventArgs e)
        {
            ListView lv = (ListView)tabMain.SelectedTab.Controls[0];
            //房间对象
            RoomInfo room = (RoomInfo)(tabMain.SelectedTab.Tag);

            if (lv.SelectedItems.Count <= 0)
            {
                msg.MsgDivShow("请选择要结账的餐桌", 1);
                return;
            }
            DeskInfo desk = (lv.SelectedItems[0].Tag as DeskInfo); //因为只允许单选,所以是tiems[0];

            if (desk.DeskState == 0)                               //0如果是空闲的餐桌
            {
                msg.MsgDivShow("请选择正在就餐的餐桌", 1);
                return;
            }
            OrderInfoBLL obll       = new OrderInfoBLL();
            object       objOrderId = obll.GetOrderIdByDeskId(desk.DeskId);
            FrmGuestPay  fgp        = FrmGuestPay.Single(Convert.ToInt32(objOrderId), desk.DeskName, desk.DeskId);

            fgp.FormClosed += f_FormClosed;
            fgp.Show();
        }
Example #4
0
 public static FrmGuestPay Single(int orderId, int deskId, string deskName)
 {
     if (_instance == null || _instance.IsDisposed)
     {
         _instance = new FrmGuestPay(orderId, deskId, deskName);
     }
     return(_instance);
 }
Example #5
0
 public static FrmGuestPay Single(int orderId, int deskId, string deskName)
 {
     if (_instance == null || _instance.IsDisposed)
     {
         _instance = new FrmGuestPay(orderId, deskId, deskName);
     }
     return _instance;
 }
Example #6
0
 public static FrmGuestPay Single(int deskId, string deskNum, int orderId)
 {
     if (instance == null || instance.IsDisposed)
     {
         instance = new FrmGuestPay(deskId, deskNum, orderId);
     }
     return(instance);
 }