private void SelectionChanged(StageVM stagevm) { if (SelectedStage == null) return; if (ShowCancel == "Visible") CancelUpdateStage(this); _oldType = SelectedStage.Copy(); stagevm.ShowEdit = "Visible"; stagevm.ShowCancel = "Hidden"; stagevm.ShowSave = "Hidden"; Enabled = false; }
private void SaveUpdateStage(StageVM stagevm) { if (!SelectedStage.IsValid()) return; // Save Changes if (_oldType == null) { // Insert into db SelectedStage.ID = Stage.AddStage(SelectedStage); } else { // Update db Stage.UpdateStage(SelectedStage); } // Update GUI stagevm.ShowEdit = "Visible"; stagevm.ShowCancel = "Hidden"; stagevm.ShowSave = "Hidden"; Enabled = false; }
private void EditStage(StageVM stagevm) { stagevm.ShowEdit = "Hidden"; stagevm.ShowCancel = "Visible"; stagevm.ShowSave = "Visible"; stagevm.Enabled = true; }
private void DeleteStage(StageVM stagevm) { if (SelectedStage == null) return; Stage.DeleteStage(SelectedStage); SelectedStage = new Stage(); Enabled = true; ShowEdit = "Hidden"; ShowCancel = "Hidden"; ShowSave = "Visible"; }
private void CancelUpdateStage(StageVM stagevm) { // Reset person _changeNotify = false; SelectedStage = _oldType; stagevm.ShowEdit = "Visible"; stagevm.ShowCancel = "Hidden"; stagevm.ShowSave = "Hidden"; Enabled = false; }
private void AddStage(StageVM stagevm) { SelectedStage = new Stage(); _oldType = null; stagevm.ShowEdit = "Hidden"; stagevm.ShowCancel = "Visible"; stagevm.ShowSave = "Visible"; stagevm.Enabled = true; }