Ejemplo n.º 1
0
        //点击付款
        private void menuOrder_Click(object sender, EventArgs e)
        {
            //先找到选中的标签页,再找到listView,再找到选中的项,项中存储了餐桌编号,由餐桌编号查到订单编号
            var listView = tcHallInfo.SelectedTab.Controls[0] as ListView;

            if (listView.SelectedItems.Count < 1)
            {
                MessageBox.Show("请选择餐桌");
                return;
            }
            var lvTable = listView.SelectedItems[0];

            if (lvTable.ImageIndex == 0)
            {
                MessageBox.Show("餐桌还未使用,无法结账");
                return;
            }
            int        tableId     = Convert.ToInt32(lvTable.Tag);
            List <int> orderIdList = orderInfoBLL.GetOrderIdByTableId(tableId);

            //打开付款窗体
            FormOrderPay formOrderPay = new FormOrderPay();

            formOrderPay.Tag      = orderIdList;
            formOrderPay.Refresh += LoadHallInfo;
            formOrderPay.Show();
        }
Ejemplo n.º 2
0
        private void menuOrder_Click(object sender, EventArgs e)
        {
            var listView = tcHallInfo.SelectedTab.Controls[0] as ListView;
            var lvTable  = listView.SelectedItems[0];

            if (lvTable.ImageIndex == 0)
            {
                MessageBox.Show("还未使用,无法结账");
                return;
            }
            int          tableId      = Convert.ToInt32(lvTable.Tag);
            int          orderId      = oiBll.GetOrderIdByTableId(tableId);
            FormOrderPay formOrderPay = new FormOrderPay();

            formOrderPay.Tag = orderId;
            formOrderPay.Show();
        }
Ejemplo n.º 3
0
        private void MoneyMenu_Click(object sender, EventArgs e)
        {
            var listView = tabControl1.SelectedTab.Controls[0] as ListView;

            try
            {
                var lvTable = listView.SelectedItems[0];
                if (lvTable.ImageIndex == 0)
                {
                    MessageBox.Show("餐桌还未使用,无法结账");
                    return;
                }
                OrderInfoBll bll     = new OrderInfoBll();
                int          tableId = Convert.ToInt32(lvTable.Tag);
                int          orderId = bll.GetOrderIdByTableId(tableId);

                #region 显示结账界面
                TabPage tabPage = new TabPage();
                tabPage.Text = "结账付款";
                tabPage.Name = "page5";

                if (!IsInto(tabPage.Name))
                {
                    FormOrderPay page = new FormOrderPay();
                    //注册关闭事件
                    page.close          += Close;
                    page.Refresh        += LoadHallInfo;
                    page.Name            = "formpage";
                    page.TopLevel        = false;
                    page.FormBorderStyle = FormBorderStyle.None;
                    tabPage.Controls.Add(page);
                    page.Tag = orderId;
                    page.Show();
                    tabControl1.TabPages.Add(tabPage);
                }
                //选中该选项卡
                this.tabControl1.SelectedTab = tabControl1.TabPages["page5"];
                #endregion
            }
            catch
            {
                MessageBox.Show("请选择要结账的厅包");
            }
        }
Ejemplo n.º 4
0
        private void menuOrder_Click(object sender, EventArgs e)
        {
            //先找到选中的标签页,再找到listView,再找到选中的项,项中存储了餐桌编号,由餐桌编号查到订单编号
            var listView = tcHallInfo.SelectedTab.Controls[0] as ListView;
            var lvtable  = listView.SelectedItems[0];

            if (lvtable.ImageIndex == 0)
            {
                MessageBox.Show("餐桌还未使用,无法结账!");
                return;
            }

            int tableid = Convert.ToInt32(lvtable.Tag);
            int orderid = oiBll.GetOrderById(tableid);

            //打开付款窗体
            FormOrderPay formOrderPay = new FormOrderPay();

            formOrderPay.Tag      = orderid;
            formOrderPay.Refresh += LoadHallInfo;
            formOrderPay.Show();
        }
Ejemplo n.º 5
0
        private void menuOrder_Click(object sender, EventArgs e)
        {
            //现在到选中的标签页,在找到listview,找到选中的项,相中存储了餐桌编号,由餐桌编号查找到订单编号
            OrderInfoBll oiBll    = new OrderInfoBll();
            ListView     listview = tcHallInfo.SelectedTab.Controls[0] as ListView;

            var lvtable = listview.SelectedItems[0];

            if (lvtable.ImageIndex == 0)
            {
                MessageBox.Show("餐桌还未使用,无法结账.");
                return;
            }

            int tableId = Convert.ToInt32(listview.SelectedItems[0].Tag);
            int orderId = oiBll.GetOrderIdByTableTid(tableId);

            FormOrderPay formOrderPay = new FormOrderPay();

            formOrderPay.Tag      = orderId;
            formOrderPay.Refresh += LoadHallInfo;
            formOrderPay.ShowDialog();
        }