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(); }
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); } }
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); } } }