public TabelStatusForm(DiningArea diningArea)
        {
            InitializeComponent();
            this.diningArea = diningArea;
            staffManager    = new StaffManager();
            tableManager    = new TableManager();
            itemManager     = new ItemManager();
            this.Text       = this.Text + string.Format("  ({0}: {1})", diningArea.CurrentStaff.Role, diningArea.CurrentStaff.Name);
            InitTablePosition_Simple();

            waitlistForm             = new WaitlistForm(diningArea);
            waitlistForm.OnAllocate += waitlistForm_OnAllocate;
            //set TabelStatusForm location
            int x = (System.Windows.Forms.SystemInformation.WorkingArea.Width - this.Width + waitlistForm.Width) / 2;
            int y = (System.Windows.Forms.SystemInformation.WorkingArea.Height - this.Height) / 2;

            this.StartPosition = FormStartPosition.Manual;
            this.Location      = (Point) new Size(x, y);
            //set waitlistForm location
            waitlistForm.ShowInTaskbar = false;
            waitlistForm.StartPosition = FormStartPosition.Manual;
            waitlistForm.Location      = new Point(this.Location.X - waitlistForm.Width, this.Location.Y);
            waitlistForm.Height        = this.Height;
            waitlistForm.Show();
        }
        public TabelStatusForm(DiningArea diningArea)
        {
            InitializeComponent();
            this.diningArea = diningArea;
            staffManager    = new StaffManager();
            tableManager    = new TableManager();
            itemManager     = new ItemManager();
            orderManager    = new OrderManager();

            diningArea.AWaitingTimePredictor.PredictWaitingTimeReg(diningArea.Tables, diningArea.Customers, diningArea.Orders, (List <Order>)orderManager.GetByOrderStatus(OrderStatus.Finish), (List <Item>)itemManager.GetAll());

            this.Text = this.Text + string.Format("  ({0}: {1})", diningArea.CurrentStaff.Role, diningArea.CurrentStaff.Name);
            InitTablePosition_Simple();

            waitlistForm             = new WaitlistForm(diningArea);
            waitlistForm.OnAllocate += waitlistForm_OnAllocate;
            //set TabelStatusForm location
            int x = (System.Windows.Forms.SystemInformation.WorkingArea.Width - this.Width + waitlistForm.Width) / 2;
            int y = (System.Windows.Forms.SystemInformation.WorkingArea.Height - this.Height) / 2;

            this.StartPosition = FormStartPosition.Manual;
            this.Location      = (Point) new Size(x, y);
            //set waitlistForm location
            waitlistForm.ShowInTaskbar = false;
            waitlistForm.StartPosition = FormStartPosition.Manual;
            waitlistForm.Location      = new Point(this.Location.X - waitlistForm.Width, this.Location.Y);
            waitlistForm.Height        = this.Height;
            waitlistForm.Show();

            //groupbox:table information
            txtTableId.Enabled             = false;
            txtCapacity.Enabled            = false;
            comboBoxTableStatus.DataSource = System.Enum.GetNames(typeof(TableStatus));
            comboBoxWaiterName.DataSource  = diningArea.Waiters.Select(waiter => waiter.Name).ToList();
            //groupbox:order information
            txtOrderId.Enabled = false;

            dgvItemMenu1.DataSource          = itemManager.GetAll();
            dgvItemMenu1.ReadOnly            = true;
            dgvItemMenu1.RowHeadersVisible   = false;
            dgvItemMenu1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            dgvItemMenu1.Columns["AverageTimeCost"].Visible = false;
            dgvItemMenu1.Columns["ItemStatus"].Visible      = false;
            dgvItemMenu1.Columns["ItemAmount"].Visible      = false;
            dgvItemMenu1.Columns["Description"].Visible     = false;

            dgvSelectedItems.DataSource = new List <Item>();
            //dgvSelectedItems.ReadOnly = true;
            dgvSelectedItems.RowHeadersVisible   = false;
            dgvSelectedItems.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            dgvSelectedItems.Columns["AverageTimeCost"].Visible = false;
            dgvSelectedItems.Columns["ItemStatus"].Visible      = false;
            dgvSelectedItems.Columns["Description"].Visible     = false;
            dgvSelectedItems.Columns["ItemId"].ReadOnly         = true;
            dgvSelectedItems.Columns["Name"].ReadOnly           = true;
            dgvSelectedItems.Columns["Price"].ReadOnly          = true;
            dgvSelectedItems.AllowUserToAddRows = false;
        }
 private void waitingListToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (waitlistForm == null || waitlistForm.IsDisposed)
     {
         waitlistForm = new WaitlistForm(diningArea);
         waitlistForm.ShowInTaskbar = false;
         waitlistForm.StartPosition = FormStartPosition.Manual;
         waitlistForm.Location      = new Point(this.Location.X - waitlistForm.Size.Width, this.Location.Y);
         waitlistForm.Height        = this.Height;
         waitlistForm.Show();
     }
     else
     {
         waitlistForm.WindowState = FormWindowState.Normal;
         waitlistForm.Activate();
         waitlistForm.Show();
     }
 }
示例#4
0
        public TabelStatusForm(DiningArea diningArea)
        {
            InitializeComponent();
            this.diningArea = diningArea;
            staffManager    = new StaffManager();
            tableManager    = new TableManager();
            itemManager     = new ItemManager();
            this.Text       = this.Text + string.Format("  ({0}: {1})", diningArea.CurrentStaff.Role, diningArea.CurrentStaff.Name);
            InitTablePosition_Simple();

            waitlistForm             = new WaitlistForm(diningArea);
            waitlistForm.OnAllocate += waitlistForm_OnAllocate;
            //set TabelStatusForm location
            int x = (System.Windows.Forms.SystemInformation.WorkingArea.Width - this.Width + waitlistForm.Width) / 2;
            int y = (System.Windows.Forms.SystemInformation.WorkingArea.Height - this.Height) / 2;

            this.StartPosition = FormStartPosition.Manual;
            this.Location      = (Point) new Size(x, y);
            //set waitlistForm location
            waitlistForm.ShowInTaskbar = false;
            waitlistForm.StartPosition = FormStartPosition.Manual;
            waitlistForm.Location      = new Point(this.Location.X - waitlistForm.Width, this.Location.Y);
            waitlistForm.Height        = this.Height;
            waitlistForm.Show();

            //groupbox:table information
            txtTableId.Enabled  = false;
            txtCapacity.Enabled = false;
            //groupbox:order information
            txtOrderId.Enabled      = false;
            dgvItemMenu1.DataSource = itemManager.GetAll();
            dgvItemMenu1.ReadOnly   = true;
            dgvItemMenu1.Columns["ItemId"].Visible          = false;
            dgvItemMenu1.Columns["AverageTimeCost"].Visible = false;
            dgvItemMenu1.Columns["ItemStatus"].Visible      = false;
            dgvItemMenu1.Columns["ItemStatus"].Visible      = false;
            dgvItemMenu1.Columns["ItemAmount"].Visible      = false;
        }