public void Delete() { if (SelectedStep == null) { return; } var diagle = windowManager.ShowMessageBox(String.Format("确定要删除"), "系统提示", MessageBoxButton.YesNo); if (diagle == MessageBoxResult.Yes) { List <T_LogicStep> selsteps = new List <T_LogicStep>(SelectedStep.ToArray()); foreach (var selstep in selsteps) { if (this.logicService.DeleteT_LogicStep(selstep.ID)) { var CurrentIndex = StepList.IndexOf(selstep); for (int i = CurrentIndex; i < StepList.Count; i++) { StepList[i].OrderIndex = StepList[i].OrderIndex - 1; } StepList.Remove(selstep); Program.LogicSteps = StepList.ToList(); SaveEvent?.Invoke(Program); } else { this.View.ShowHint(new MessageWin(false)); } } } }
public void Confirm() { if (String.IsNullOrEmpty(Program.Name)) { this.View.ShowHint(new MessageWin("程序名称不能为空")); return; } Program.LogicSteps = StepList.ToList(); if (logicService.SaveT_LogicTest(Program)) { SaveEvent?.Invoke(Program); this.View.ShowHint(new MessageWin()); } else { this.View.ShowHint(new MessageWin("保存失败!")); } }