예제 #1
0
        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;
        }
예제 #2
0
        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;
        }
예제 #3
0
 private void EditStage(StageVM stagevm)
 {
     stagevm.ShowEdit = "Hidden";
     stagevm.ShowCancel = "Visible";
     stagevm.ShowSave = "Visible";
     stagevm.Enabled = true;
 }
예제 #4
0
        private void DeleteStage(StageVM stagevm)
        {
            if (SelectedStage == null) return;

            Stage.DeleteStage(SelectedStage);

            SelectedStage = new Stage();
            Enabled = true;
            ShowEdit = "Hidden";
            ShowCancel = "Hidden";
            ShowSave = "Visible";
        }
예제 #5
0
        private void CancelUpdateStage(StageVM stagevm)
        {
            // Reset person
            _changeNotify = false;
            SelectedStage = _oldType;

            stagevm.ShowEdit = "Visible";
            stagevm.ShowCancel = "Hidden";
            stagevm.ShowSave = "Hidden";
            Enabled = false;
        }
예제 #6
0
 private void AddStage(StageVM stagevm)
 {
     SelectedStage = new Stage();
     _oldType = null;
     stagevm.ShowEdit = "Hidden";
     stagevm.ShowCancel = "Visible";
     stagevm.ShowSave = "Visible";
     stagevm.Enabled = true;
 }