Exemple #1
0
        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);
        }
Exemple #2
0
 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());
 }
Exemple #3
0
 public int Add(Floww Flow)
 {
     DB.Flowws.Add(Flow);
     DB.SaveChanges();
     return(Flow.ID);
 }