public bool Edit(Floww Flow) { var model = DB.Flowws.Find(Flow.ID); if (model == null) { return(false); } DB.Entry(model).CurrentValues.SetValues(Flow); DB.SaveChanges(); return(true); }
public ActionResult Save(Floww flow) { if (flow.ID > 0) { if (!Core.FlowwManager.Edit(flow)) { return(ErrorJsonResult("编辑流程失败!")); } } else { var id = Core.FlowwManager.Add(flow); if (id <= 0) { return(ErrorJsonResult("创建流程失败!")); } } return(SuccessJsonResult()); }
public int Add(Floww Flow) { DB.Flowws.Add(Flow); DB.SaveChanges(); return(Flow.ID); }