public SystemManagerViewModel(ITSystem system = null) { if (system == null) { this.Itsystem = new ITSystem(); this.IsNewSystemg = true; } else { Itsystem = system; } Itsystem.SysAdministrator.ForEach(SysAdmin.Add); Itsystem.Alias.ForEach(Alias.Add); AddAliasCommand = new RelayCommand <string>( ExecuteAddAliasCommand); DeleteAliasCommand = new RelayCommand <string>(this.ExecuteDeleteAliasCommand); AddSysAdminCommand = new RelayCommand <string>( ExecuteAddSysAdminCommand); DeleteSysAdminCommand = new RelayCommand <string>(this.ExecuteDeleteSysAdminCommand); CloseCommand = new RelayCommand(() => MessengerInstance.Send <Tuple <ITSystem, bool> >(new Tuple <ITSystem, bool>(null, false))); ConfirmCommand = new RelayCommand(() => MessengerInstance.Send <Tuple <ITSystem, bool> >(new Tuple <ITSystem, bool>(Itsystem, this.IsNewSystemg))); }
private void ExecuteEditCommand(ITSystem system) { DialogHost.Show( new SystemManagerView { DataContext = new SystemManagerViewModel(system) }, (sender, args) => { Console.WriteLine( ((args.Content as SystemManagerView).DataContext as SystemManagerViewModel).Itsystem); }); }
public void Update(Action <bool, Exception> callback, ITSystem systemToUpdate) { try { this.systemApi.Update(systemToUpdate); } catch (Exception ex) { callback(false, ex); } callback(true, null); }
public void Insert(Action <bool, Exception> callback, ITSystem SystemToSave) { try { this.systemApi.Insert(SystemToSave); } catch (Exception ex) { callback(false, ex); } callback(true, null); }
public void Delete(Action <bool, Exception> callback, ITSystem systemToDelete) { try { systemApi.Delete(systemToDelete); } catch (Exception ex) { callback(false, ex); } callback(true, null); }
public void Update(Action <bool, Exception> callback, ITSystem listToSave) { throw new NotImplementedException(); }
private void DeleteSystem(ITSystem obj) { this._dataService.Delete(((b, exception) => Console.WriteLine(b)), obj); ListOfSystems.Remove(obj); }