示例#1
0
        public ActionResult JobImplement(string jobNameList)
        {
            if (string.IsNullOrEmpty(jobNameList))
            {
                return(ErrorNotification("请选择至少一个待执行的JOB!"));
            }

            string[] nameList = jobNameList.Split(',');

            if (nameList.Length == 0)
            {
                return(ErrorNotification("没有提供正确的JOB处理信息"));
            }

            List <JobName> nameEnum = new List <JobName>();

            foreach (string item in nameList)
            {
                if (string.IsNullOrEmpty(item))
                {
                    continue;
                }
                JobName jobType = (JobName)Enum.Parse(typeof(JobName), item);
                nameEnum.Add(jobType);
            }

            _manualStartJobService.ManualStartJob(nameEnum);

            return(SuccessNotification("操作执行完毕!"));
        }
示例#2
0
        public ActionResult JobImplement(string jobNameList)
        {
            if (string.IsNullOrEmpty(jobNameList))
            {
                return(Json(new { status = "99", message = "请选择至少一个待执行的JOB!" }, JsonRequestBehavior.AllowGet));
            }

            string[] nameList = jobNameList.Split(',');

            if (nameList.Length == 0)
            {
                return(Json(new { status = 99, message = "没有提供正确的JOB处理信息" }, JsonRequestBehavior.AllowGet));
            }

            var nameEnum = new List <JobName>();

            foreach (string item in nameList)
            {
                if (string.IsNullOrEmpty(item))
                {
                    continue;
                }
                JobName jobType = (JobName)Enum.Parse(typeof(JobName), item);
                nameEnum.Add(jobType);
            }

            _manualStartJobService.ManualStartJob(nameEnum);
            return(Json(new { status = 200 }, JsonRequestBehavior.AllowGet));
        }