public bool AddManifestationType(ManifestationType newType) { if (FindLabel(newType.Id) != null) { return(false); } ManifestationTypes.Add(newType); SaveData(); return(true); }
public bool DeleteManifestationType(string id) { ManifestationType target = FindManifestationType(id); if (target == null) { return(false); } ManifestationTypes.Remove(target); SaveData(); return(true); }
public bool UpdateManifestationType(ManifestationType newTypeData) { ManifestationType target = FindManifestationType(newTypeData.Id); if (target == null) { return(false); } target.Name = newTypeData.Name; target.IconPath = newTypeData.IconPath; target.Description = newTypeData.Description; SaveData(); return(true); }
public void showManifestationTypeEditView(string typeId) { model.ManifestationType target = model.Repository.GetInstance().FindManifestationType(typeId); if (target == null) { return; } AddManifTypeView view = new AddManifTypeView(this, true); view.DataContext = target; view.idInput.Text = target.Id; view.idInput.IsEnabled = false; view.nameInput.Text = target.Name; view.descriptionInput.Text = target.Description; view.textBoxIconPath.Text = target.IconPath; view.autoGenerateId.Visibility = Visibility.Collapsed; view.autoGenerateIdLabel.Visibility = Visibility.Collapsed; view.AddOrEditBtn.Content = "Confirm changes"; MainContent.Content = view; }