void fs_FormClosed(object sender, FormClosedEventArgs e) { ListView lvi = tabControl1.SelectedTab.Controls[0] as ListView; if (CBState.isTrue) { //MessageBox.Show("开单成功"); lvi.SelectedItems[0].ImageIndex = 1; if (CBState.isCheknd) { CBState.isCheknd = false; FrmAddConsumer af = new FrmAddConsumer(); af.TableID = Convert.ToInt32(lvi.SelectedItems[0].Tag); af.TableName = lvi.SelectedItems[0].Text; af.FormClosed += new FormClosedEventHandler(af_FormClosed); af.Show(); } } }
private void pictureBox3_Click(object sender, EventArgs e) { //添加消费 ListView lvi = (tabControl1.SelectedTab.Controls[0] as ListView); if ((tabControl1.SelectedTab.Controls[0] as ListView).SelectedItems.Count <= 0) { new Warning("选择一张餐桌进行消费", 图标.Erro).Show(); return; } 餐台状态 c = (餐台状态)lvi.SelectedItems[0].ImageIndex; switch (c) { case 餐台状态.可用: new Warning("此餐桌还没有开单", 图标.Erro).Show(); break; case 餐台状态.占用: FrmAddConsumer af = new FrmAddConsumer(); af.TableID = Convert.ToInt32(lvi.SelectedItems[0].Tag.ToString()); af.TableName = lvi.SelectedItems[0].Text; af.FormClosed += new FormClosedEventHandler(af_FormClosed); af.ShowDialog(); break; case 餐台状态.预订: new Warning("此餐桌已经被预定", 图标.Erro).Show(); break; case 餐台状态.停用: new Warning("此餐桌已经被停用", 图标.Erro).Show(); break; default: break; } }