private void UpdateView() { CrystalHost.HostServiceClient hsc = new CRySTALClient.CrystalHost.HostServiceClient(); Dictionary<CrystalHost.TableTypes, int[]> tableStatus; tableStatus = hsc.GetTables(sessionID); foreach (int i in tableStatus[CRySTALClient.CrystalHost.TableTypes.Clean]) { if (i < 6) tableButtons[i - 1].BackColor = Color.LightGreen; } foreach (int i in tableStatus[CRySTALClient.CrystalHost.TableTypes.InUse]) { if (i < 6) tableButtons[i - 1].BackColor = Color.LightBlue; } foreach (int i in tableStatus[CRySTALClient.CrystalHost.TableTypes.Dirty]) { if (i < 6) tableButtons[i - 1].BackColor = Color.Red; } foreach (int i in tableStatus[CRySTALClient.CrystalHost.TableTypes.Cleaning]) { if (i < 6) tableButtons[i - 1].BackColor = Color.Orange; } foreach (int i in tableStatus[CRySTALClient.CrystalHost.TableTypes.CannotBeUsed]) { if (i < 6) tableButtons[i - 1].BackColor = Color.Gray; } hsc.Close(); }
private void SelectWaiter_Load(object sender, EventArgs e) { CrystalHost.HostServiceClient cli = new CRySTALClient.CrystalHost.HostServiceClient(); lst = cli.GetWaitersOnDuty(sessionID); foreach (CrystalHost.BasicEmployee emp in lst) { listBox1.Items.Add(emp.name + "(" + emp.id.ToString() + ")"); } }
void bnt_Click(object sender, EventArgs e) { int id = int.Parse((sender as Button).Tag.ToString()); SelectWaiter sw = new SelectWaiter(sessionID); if (sw.ShowDialog() == DialogResult.OK) { CrystalHost.HostServiceClient cli = new CRySTALClient.CrystalHost.HostServiceClient(); cli.AssignTableTo(sessionID, id, sw.SelEmployee.id); } }