예제 #1
0
 private void CreateEquipFromWindow(CreateEquipementWindow window)
 {
     dataCtrl.EquiCtrl.Name       = window.ProjName.Text;
     dataCtrl.EquiCtrl.Os         = window.Os.Text;
     dataCtrl.EquiCtrl.Type       = window.Type.Text;
     dataCtrl.EquiCtrl.Version    = window.Version.Text;
     dataCtrl.EquiCtrl.MacAddress = window.MacAddr.Text;
     dataCtrl.EquiCtrl.Notes      = window.Notes.Text;
     dataCtrl.EquiCtrl.Ip         = dataCtrl.NetCtrl.StringtoIp(window.Ip.Text);
     dataCtrl.EquiCtrl.IsActiveCheck();
 }
예제 #2
0
        private void mnuCreateEquipement(object sender, RoutedEventArgs e)
        {
            CreateEquipementWindow newEquipementWindow = new CreateEquipementWindow();

            if (newEquipementWindow.ShowDialog() == true)
            {
                dataCtrl.EquiCtrl.Create(newEquipementWindow.ProjName.Text);
                CreateEquipFromWindow(newEquipementWindow);
                dataCtrl.EquiCtrl.AddToProject(dataCtrl.ProjCtrl);
            }
        }
예제 #3
0
        private void ModifyEquipement_Click(object sender, RoutedEventArgs e)
        {
            if (SetSelectedEquip())
            {
                string ip = dataCtrl.EquiCtrl.Ip != null?dataCtrl.EquiCtrl.Ip.ToString() : null;

                CreateEquipementWindow newEquipementWindow = new CreateEquipementWindow(
                    dataCtrl.EquiCtrl.Name,
                    dataCtrl.EquiCtrl.Type,
                    dataCtrl.EquiCtrl.Os,
                    dataCtrl.EquiCtrl.Version,
                    ip,
                    dataCtrl.EquiCtrl.MacAddress,
                    dataCtrl.EquiCtrl.Notes);
                if (newEquipementWindow.ShowDialog() == true)
                {
                    dataCtrl.EquiCtrl.DeleteFromProject(dataCtrl.ProjCtrl);
                    CreateEquipFromWindow(newEquipementWindow);
                    dataCtrl.EquiCtrl.AddToProject(dataCtrl.ProjCtrl);
                }
            }
        }