public ActionResult JobAdd(string bu, Job job) { job.JobName = bu + job.JobName; int i = bll.Add(job); if (i > 0) { return(Content("<script>alert('添加成功');location.href='/Job/Index';</script>")); //return Redirect("/Job/Index"); } else { return(Content("<script>alert('添加失败')</script>")); } }
public static bool AddTask(Job model, string action) { var result = false; if (action == "edit") { result = task.Edit(model); } else { model.JobID = Guid.NewGuid(); result = task.Add(model); } if (result) { QuartzHelper.ScheduleJob(model, true); } return(result); }