예제 #1
0
        private void lbBDevice_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                cbxOrderDate.Items.Clear();

                var device = DS_BDevice.Current as BeamCutDevice;

                if (device != null)
                {
                    device = BeamCutQuery.GetDeviceOrders(device.id);
                    var orderGroup = device.BDeviceOrders.GroupBy(i => i.Date);
                    foreach (var item in orderGroup)
                    {
                        cbxOrderDate.Items.Add(item.Key);
                    }
                }

                MachineProgressViewer = new MachineProgressViewer(device);
                if (!OrderLoader.IsDisposed)
                {
                    OrderLoader.Controls.Clear();
                }
                OrderLoader.Controls.Add(MachineProgressViewer);
                MachineProgressViewer.Dock = DockStyle.Fill;

                var orders = BeamCutQuery.GetBDeviceOrders(device.id, cbxOrderDate.Text);

                if (orders != null)
                {
                    MachineProgressViewer.UpdateOrderViewer(orders);
                }
            }
            catch (Exception ex)
            { }
        }