/// <summary> /// 更换版本 /// </summary> /// <param name="jobInfo"></param> /// <returns></returns> public bool Upgrade(JobInfo jobInfo) { try { return(JobInfoDb.UpdateJobInfo(jobInfo) > 0); } catch (Exception ex) { LogService.WriteLog(ex, "Upgrade 失败"); } return(false); }
/// <summary> /// 列表查询 /// </summary> /// <returns></returns> public ActionResult Index() { List <JobPager> list = JobInfoDb.GetJobPager(); //转换Quartz数据库表的时间字段 list.ForEach(f => { f.NEXT_FIRE_TIME = new DateTime(Convert.ToInt64(f.NEXT_FIRE_TIME)).AddHours(8).ToString("yyyy-MM-dd HH:mm:ss"); f.PREV_FIRE_TIME = new DateTime(Convert.ToInt64(f.PREV_FIRE_TIME)).AddHours(8).ToString("yyyy-MM-dd HH:mm:ss"); f.START_TIME = new DateTime(Convert.ToInt64(f.START_TIME)).AddHours(8).ToString("yyyy-MM-dd HH:mm:ss"); }); return(View(list)); }
/// <summary> /// 删除 /// </summary> /// <param name="id"></param> /// <returns></returns> public bool Delete(int id) { bool res = false; try { if (id > 0) { res = JobInfoDb.DeleteJobInfo(new JobInfo { IsDeleted = 1, Id = id }) > 0; } } catch (Exception ex) { LogService.WriteLog(ex, "Delete 失败"); } return(res); }
public ActionResult Update(int id) { JobInfo jobInfo = JobInfoDb.GetJobInfo(id); return(Json(jobInfo, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 添加任务 /// </summary> /// <param name="jobInfo"></param> /// <returns></returns> public ActionResult Add(JobInfo jobInfo) { jobInfo.JobGroup = jobInfo.SchedName; JobInfoDb.AddJobInfo(jobInfo); return(RedirectToAction("Index", "Home")); }