public IActionResult Del(Unit unit) { var count = unitService.Del(unit.Unid); CaseService caseService = new CaseService(); CasedetailService detailservice = new CasedetailService(); var cases = caseService.QueryByUnid(unit.Unid); foreach (Thecase c in cases) { caseService.Del(c.Cid); detailservice.Del(c.Cid); } return(Redirect(Url.Action("Index", "_Unit"))); }
public IActionResult Del(Plan plan) { var planSerVice = new PlanService(); UnitService unitService = new UnitService(); CaseService caseService = new CaseService(); CasedetailService detailservice = new CasedetailService(); var units = unitService.QueryByPid(plan.Pid); foreach (Unit u in units) { unitService.Del(u.Unid); } var cases = caseService.QueryByPid(plan.Pid); foreach (Thecase c in cases) { caseService.Del(c.Cid); detailservice.Del(c.Cid); } var count = planSerVice.Del(plan.Pid); return(Redirect(Url.Action("Index", "_Plan"))); }
public IActionResult Del(Project project) { var count = projectService.Del(project.Proid); var plans = planService.QueryByProid(project.Proid); foreach (Plan x in plans) { planService.Del(x.Pid); } var units = unitService.QueryByProid(project.Proid); foreach (Unit u in units) { unitService.Del(u.Unid); } var cases = caseService.QueryByProid(project.Proid); foreach (Thecase c in cases) { caseService.Del(c.Cid); detailservice.Del(c.Cid); } return(Redirect(Url.Action("Index", "_Project"))); }