/// <summary> /// 单独开台操作 /// </summary> private void BtnOpenTables_Click(object sender, EventArgs e) { PassValue.count_select_idle = 0; PassValue.selectedtableid.Clear(); if (CurrentChooseDesk.Count > 0) { foreach (Control ct in this.panelDesk.Controls) { if (ct is DeskControl.DeskControl) { DeskControl.DeskControl dc = (DeskControl.DeskControl)ct; if (CurrentChooseDesk.Keys.Contains(dc.lbTableID.Text) && dc.lbStatus.Text == "idle") { PassValue.count_select_idle = CurrentChooseDesk.Count; PassValue.selectedtableid.Add(dc.lbTableID.Text); } } } } if (PassValue.count_select_idle > 0) { if (string.IsNullOrEmpty(PassValue.consumptionid)) { PassValue.desk = PassValue.selectedtableid.ToArray();//将集合转换为string数组 OpenTables ot = new OpenTables(); ot.Owner = this; ot.ShowDialog(); } else { Messagebox mb = new Messagebox(); PassValue.MessageInfor = "请选择空桌!"; mb.Show(); } } else { Messagebox mb = new Messagebox(); PassValue.MessageInfor = "请选择空桌!"; mb.Show(); } //选中默认 ChooseCurrent(); }
/// <summary> /// 组合开台操作 /// </summary> private void toolStripMenuItem1_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(PassValue.consumptionid)) { Messagebox mb = new Messagebox(); PassValue.MessageInfor = "请选择空桌!"; mb.Show(); return; } LastIsidle = false; PassValue.selectedtableid.Clear(); PassValue.count_select_idle = 0; foreach (KeyValuePair <string, string> item in CurrentChooseDesk) { PassValue.selectedtableid.Add(item.Key); } PassValue.count_select_idle = CurrentChooseDesk.Count; if (PassValue.count_select_idle > 0) { PassValue.desk = PassValue.selectedtableid.ToArray();//将集合转换为string数组 OpenTables ot = new OpenTables(); ot.Owner = this; if (ot.ShowDialog() == DialogResult.Cancel) { LastIsidle = true; } } else { Messagebox mb = new Messagebox(); PassValue.MessageInfor = "请先选择桌子!"; mb.Show(); } //选中默认 ChooseCurrent(); }
public void btnorders() { if (TitleId == 1)//当前为开桌界面 { if (!string.IsNullOrEmpty(PassValue.consumptionid)) { TitleId = 2; SetUp(); this.BtnOrders.Image = Properties.Resources.点菜2;//选中点菜 frmOrder frmorder = new frmOrder(PassValue.consumptionid); frmorder.Owner = this; frmorder.TopLevel = false; frmorder.FormBorderStyle = FormBorderStyle.None; frmorder.Dock = DockStyle.Fill; this.panelMain.Controls.Clear(); this.panelMain.Controls.Add(frmorder); frmorder.Show(); PassValue.consumptionid = ""; } else { Messagebox mb = new Messagebox(); PassValue.MessageInfor = "请先选择已开台的桌子!"; mb.Show(); } } else { if (TitleId != 2) { Messagebox mb = new Messagebox(); PassValue.MessageInfor = "您还未选桌,不能点菜!"; mb.Show(); } } }
/// <summary> /// 组合开台操作 /// </summary> private void toolStripMenuItem1_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(PassValue.consumptionid)) { Messagebox mb = new Messagebox(); PassValue.MessageInfor = "请选择空桌!"; mb.Show(); return; } LastIsidle = false; PassValue.selectedtableid.Clear(); PassValue.count_select_idle = 0; foreach (KeyValuePair<string, string> item in CurrentChooseDesk) { PassValue.selectedtableid.Add(item.Key); } PassValue.count_select_idle = CurrentChooseDesk.Count; if (PassValue.count_select_idle > 0) { PassValue.desk = PassValue.selectedtableid.ToArray();//将集合转换为string数组 OpenTables ot = new OpenTables(); ot.Owner = this; if (ot.ShowDialog() == DialogResult.Cancel) { LastIsidle = true; } } else { Messagebox mb = new Messagebox(); PassValue.MessageInfor = "请先选择桌子!"; mb.Show(); } //选中默认 ChooseCurrent(); }
public void ShowView(string p_Name) { if (m_CurrentView != null && (m_CurrentView.GetName() == p_Name)) //点击的是当前的,不做处理 { return; } if (m_RegisteredView != null) { frmMessageBox frmMessageBox = new frmMessageBox(System.Windows.MessageBoxButton.OK, "请先点击右下方的确定或者取消按钮,才能进行其他操作。"); frmMessageBox.ShowDialog(); return; } bool isneedactive = false; IView view = FindView(p_Name); switch (p_Name) { case "开桌": { if (view == null) { view = new Desk(); m_ViewList.Add(view); } else { isneedactive = true; } } break; case "点菜": { if (m_CurrentView.GetName() == "开桌") { if (string.IsNullOrEmpty(PassValue.consumptionid)) { Messagebox mb = new Messagebox(); PassValue.MessageInfor = "请先选择已开台的桌子!"; mb.Show(); } else { view = new frmOrder(PassValue.consumptionid); isneedactive = true; } } } break; case "收银": { view = new frmCashier(PassValue.consumptionid); isneedactive = true; } break; case "预定": { view = new frmReserveDishes(); } break; case "会员": { if (view == null) { view = new MemberSystem(); } } break; case "交接班": { view = new Transfer(); } break; case "历史查询": { view = new frmQuery(PassValue.consumptionid); isneedactive = true; } break; case "菜品": { if (view == null) { view = new frmWebDishes(); m_ViewList.Add(view); } } break; case "库管": { if (view == null) { view = new frmWebWarehouse(); m_ViewList.Add(view); } } break; case "设置": { History hs = new History(); hs.ShowDialog(); } break; case "报表": { if (view == null) { view = new frmWebReport(); m_ViewList.Add(view); } } break; case "TT100": { if (view == null) { view = new frmWebTT100(); m_ViewList.Add(view); } } break; case "锁屏": { LockWindows lw = new LockWindows(); lw.ShowDialog(); } break; } if (view == null) //前面没有生成view { } else { //先关闭之前的view if (m_CurrentView != null && FindView(m_CurrentView.GetName()) == null) { Form frm = m_CurrentView as Form; frm.Close(); } //显示现在的view Form form = view as Form; form.Owner = this; form.TopLevel = false; form.Dock = DockStyle.Fill; this.panelMain.Controls.Clear(); this.panelMain.Controls.Add(form); form.Show(); if (isneedactive) { view.Active(); } m_CurrentView = view; //设置按钮状态 SetButtonActived(p_Name); } }
public void ShowView(string p_Name) { if (m_CurrentView !=null && (m_CurrentView.GetName() == p_Name)) //点击的是当前的,不做处理 { return; } if (m_RegisteredView != null) { frmMessageBox frmMessageBox = new frmMessageBox(System.Windows.MessageBoxButton.OK, "请先点击右下方的确定或者取消按钮,才能进行其他操作。"); frmMessageBox.ShowDialog(); return; } bool isneedactive = false; IView view= FindView(p_Name); switch (p_Name) { case "开桌": { if (view == null) { view = new Desk(); m_ViewList.Add(view); } else { isneedactive = true; } } break; case "点菜": { if (m_CurrentView.GetName() == "开桌") { if (string.IsNullOrEmpty(PassValue.consumptionid)) { Messagebox mb = new Messagebox(); PassValue.MessageInfor = "请先选择已开台的桌子!"; mb.Show(); } else { view = new frmOrder(PassValue.consumptionid); isneedactive = true; } } } break; case "收银": { view = new frmCashier(PassValue.consumptionid); isneedactive = true; } break; case "预定": { view = new frmReserveDishes(); } break; case "会员": { if (view == null) { view = new MemberSystem(); } } break; case "交接班": { view = new Transfer(); } break; case "历史查询": { view = new frmQuery(PassValue.consumptionid); isneedactive = true; } break; case "菜品": { if (view == null) { view = new frmWebDishes(); m_ViewList.Add(view); } } break; case "库管": { if (view == null) { view = new frmWebWarehouse(); m_ViewList.Add(view); } } break; case "设置": { History hs = new History(); hs.ShowDialog(); } break; case "报表": { if (view == null) { view = new frmWebReport(); m_ViewList.Add(view); } } break; case "TT100": { if (view == null) { view = new frmWebTT100(); m_ViewList.Add(view); } } break; case "锁屏": { LockWindows lw = new LockWindows(); lw.ShowDialog(); } break; } if (view == null) //前面没有生成view { } else { //先关闭之前的view if (m_CurrentView != null && FindView(m_CurrentView.GetName()) == null) { Form frm = m_CurrentView as Form; frm.Close(); } //显示现在的view Form form = view as Form; form.Owner = this; form.TopLevel = false; form.Dock = DockStyle.Fill; this.panelMain.Controls.Clear(); this.panelMain.Controls.Add(form); form.Show(); if (isneedactive) { view.Active(); } m_CurrentView = view; //设置按钮状态 SetButtonActived(p_Name); } }