Beispiel #1
0
        //新设备录入
        private void Device_Incoming(object sender, RoutedEventArgs e)
        {
            EquipmentClass equitment = new EquipmentClass();
            DataSet        set       = equitment.comingEquipment();

            if (moveGrid.Children != null)
            {
                moveGrid.Children.Clear();
            }
            NewEquipment equipments = DeviceMigrationsFactory.NewEquipment;

            equipments.MyEvent += new ClickEventHandler(form2_MyEvent);
            DeviceMigrationsFactory.NewEquipment.page.ShowPages(DeviceMigrationsFactory.NewEquipment.comingGrild, set, BaseRequest.PAGE_SIZE);

            moveGrid.Children.Add(equipments);
            equipments.SetValue(Grid.RowProperty, 0);
            equipments.SetValue(Grid.ColumnProperty, 0);
        }
Beispiel #2
0
        //报修设备
        private void Device_Migrations(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            TreeViewItem assets = ((sender as TreeView).SelectedItem as TreeViewItem);

            if (moveGrid.Children != null)
            {
                moveGrid.Children.Clear();
            }
            string migrations = assets.Uid.ToString();

            if (migrations == null || "".Equals(migrations))
            {
                return;
            }
            if (migrations.Equals("repair"))
            {
                if (moveGrid.Children != null)
                {
                    moveGrid.Children.Clear();
                }
                Equipments equipments = DeviceMigrationsFactory.Equipments;
                moveGrid.Children.Add(equipments);
                equipments.SetValue(Grid.RowProperty, 0);
                equipments.SetValue(Grid.ColumnProperty, 0);
            }
            else if (migrations.Equals("incoming"))
            {
                if (moveGrid.Children != null)
                {
                    moveGrid.Children.Clear();
                }
                NewEquipment equipments = DeviceMigrationsFactory.NewEquipment;
                moveGrid.Children.Add(equipments);
                equipments.SetValue(Grid.RowProperty, 0);
                equipments.SetValue(Grid.ColumnProperty, 0);
            }
            else if (migrations.Equals("delivery"))
            {
                if (moveGrid.Children != null)
                {
                    moveGrid.Children.Clear();
                }
                EquipmentDelivery equipments = DeviceMigrationsFactory.EquipmentDelivery;
                moveGrid.Children.Add(equipments);
                equipments.SetValue(Grid.RowProperty, 0);
                equipments.SetValue(Grid.ColumnProperty, 0);
            }
            else if (migrations.Equals("incoming"))
            {
                if (moveGrid.Children != null)
                {
                    moveGrid.Children.Clear();
                }
                EquipmentDelivery equipments = DeviceMigrationsFactory.EquipmentDelivery;
                moveGrid.Children.Add(equipments);
                equipments.SetValue(Grid.RowProperty, 0);
                equipments.SetValue(Grid.ColumnProperty, 0);
            }
            else if (migrations.Equals("migrate"))
            {
                if (moveGrid.Children != null)
                {
                    moveGrid.Children.Clear();
                }
                DeviceMove equipments = DeviceMigrationsFactory.DeviceMove;
                moveGrid.Children.Add(equipments);
                equipments.SetValue(Grid.RowProperty, 0);
                equipments.SetValue(Grid.ColumnProperty, 0);
            }
            else if (migrations.Equals("scrap"))
            {
                if (moveGrid.Children != null)
                {
                    moveGrid.Children.Clear();
                }
                EquipmentScrapping equipments = DeviceMigrationsFactory.EquipmentScrapping;
                moveGrid.Children.Add(equipments);
                equipments.SetValue(Grid.RowProperty, 0);
                equipments.SetValue(Grid.ColumnProperty, 0);
            }
            else if (migrations.Equals("mains"))
            {
                if (moveGrid.Children != null)
                {
                    moveGrid.Children.Clear();
                }
                DevicePower equipments = DeviceMigrationsFactory.DevicePower;
                moveGrid.Children.Add(equipments);
                equipments.SetValue(Grid.RowProperty, 0);
                equipments.SetValue(Grid.ColumnProperty, 0);
            }
        }