public bool FinishDemand(FinishDemandView demand) { Demand objectDemand = Demands.FirstOrDefault(x => x.Id == demand.Id); if (objectDemand == null) { return false; } demand.FinishDemand(objectDemand); return true; }
public ActionResult Finish(FinishDemandView viewModel) { if (repository.FinishDemand(viewModel)) { TempData["success"] = viewModel.ProjectName + "结单成功!"; } else { TempData["error"] = viewModel.ProjectName + "结单失败!"; } return this.Redirect("/"); }