Exemplo n.º 1
0
        private void update()
        {
            label10.Text = information.countOfMachine.ToString();
            int i = 0;
            int j = 0;
            int z = 0;

            dataGridView1.Rows.Clear();
            dataGridView2.Rows.Clear();
            dataGridView3.Rows.Clear();
            foreach (order Order in information.orders)
            {
                if (!Order.isReady && !Order.isTake)
                {
                    dataGridView1.Rows.Add();
                    dataGridView1.Rows[i].Cells[0].Value = Order.id;
                    string value = " ";
                    foreach (serivce Serv in Order.serivces)
                    {
                        value += Serv.getName() + " ";
                    }
                    dataGridView1.Rows[i].Cells[1].Value = value;
                    dataGridView1.Rows[i].Cells[2].Value = Order.getPrice();
                    dataGridView1.Rows[i].Cells[3].Value = Order.getDateIn();
                    i++;
                }
                else if (Order.isReady && !Order.isTake)
                {
                    dataGridView2.Rows.Add();
                    dataGridView2.Rows[j].Cells[0].Value = Order.id;
                    j++;
                }
                else if (Order.isReady && Order.isTake)
                {
                    dataGridView3.Rows.Add();
                    dataGridView3.Rows[z].Cells[0].Value = Order.id;
                    dataGridView3.Rows[z].Cells[1].Value = Order.getPrice();
                    dataGridView3.Rows[z].Cells[2].Value = Order.getDateOut();
                    z++;
                }
            }
        }