コード例 #1
0
        public void DeleteJob(string jobId)
        {
            var job = SqlMapper.Entity <Models.ScheduleJobInfo>().Where(x => x.JobId == jobId).FirstOrDefault();

            using (var trans = SqlMapper.BeginTransaction())
            {
                try
                {
                    job.JobState = JobState.Deleted;
                    trans.Entity <Models.ScheduleJobInfo>().Update(job);
                    ScheduleManager.DeleteJob(jobId);
                    trans.Commit();
                }
                catch (Exception ex)
                {
                    trans.Rollback();
                    throw ex;
                }
            }
        }