Beispiel #1
0
        /// <summary>
        /// 添加模板
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool AddJobTemplate(ViewModel_JobTemplate model)
        {
            if (model != null)
            {
                J_JobTemplate jobTemplate = new J_JobTemplate()
                {

                    JTName = model.JTName,
                    JobClassName = model.JobClassName,
                    JobType = model.JobType,
                    CronStr = model.CronStr,
                    Remark =model.Remark,
                    JobGroup = model.JobGroup
                };
                try
                {
                    this.Create(jobTemplate);
                    return true;
                }
                catch (Exception)
                {
                    return false;
                }
            }
            return false;
        }
Beispiel #2
0
 /// <summary>
 /// 根据选中的作业模板id获取作业模板中的数据
 /// </summary>
 /// <param name="JTID"></param>
 /// <returns></returns>
 public ActionResult GetJobTemplateDataByTemplate(int JobType)
 {
     //获取对应的作业模板
     var data = jobTemplateBLL.GetListBy(t => t.JobType == JobType).FirstOrDefault();
     // var data_midlle= data.ToMiddleModel();
     //此处不转为中间变量转为ViewModel中间对象
     ViewModel_JobTemplate data_vm = new ViewModel_JobTemplate()
     {
         CronStr = data.CronStr,
         JobClassName = data.JobClassName,
         JobType = data.JobType,
         JobGroup = data.JobGroup
     };
     return Content(Common.SerializerHelper.SerializerToString(data_vm));
 }