コード例 #1
0
ファイル: JobInfo.cs プロジェクト: KribKing/DownLoadExe
 public virtual void Run()
 {
     try
     {
         if (IsExecuting)
         {
             Log4netUtil.Warn("请注意,作业【" + this.name + "】正在执行,请稍后");
             return;
         }
         IRunInterface irun = this.TaskStarter.CreateInstance(this);
         if (irun == null)
         {
             Log4netUtil.Warn("作业【" + this.name + "】未找到对应的执行接口");
             return;
         }
         IsExecuting = true;
         Log4netUtil.Debug("作业【" + this.name + "】开始执行");
         irun.Run();
         Tools.FlushMemory();
         Log4netUtil.Debug("作业【" + this.name + "】执行结束");
         IsExecuting = false;
     }
     catch (Exception ex)
     {
         Tools.FlushMemory();
         Log4netUtil.Error("作业【" + this.name + "】执行发生异常" + ex.Message, ex);
         IsExecuting = false;
     }
 }
コード例 #2
0
        public IRunInterface CreateInstance(JobInfo info)
        {
            IRunInterface iface = null;

            iface = info.id == "WeChat_Doc" ? (IRunInterface) new RunInterfaceForFszyyWechatToDoctor(info) :             //微信推送-治疗师
                    info.id == "WeChat_PatBed" ? (IRunInterface) new RunInterfaceForFszyyWechatToDoctorSwitchBed(info) : //微信推送-患者
                    info.id == "WeChat_Pat" ? (IRunInterface) new RunInterfaceForFszyyWeChatToPatient(info) :            //微信推送-患者
                    info.id == "Sms_Pat" ? (IRunInterface) new RunInterfaceForHaSmsToPat(info) :                         //短信推送-患者
                    null;
            return(iface);
        }
コード例 #3
0
        public IRunInterface CreateInstance(JobInfo info)
        {
            IRunInterface   iface = null;
            JobInfoSyncData job   = info as JobInfoSyncData;

            if (job == null)
            {
                return(iface);
            }
            iface = !job.isbulkop ? (IRunInterface) new RunInterfaceForTargetDb(info) :        //目标库单操作
                    job.sourcetype == 1 ? (IRunInterface) new RunInterfaceBySourceDb(info) :   //源数据库批量操作
                    job.servertype == 0 ? (IRunInterface) new RunInterfaceByHttp(info) :       //源Http服务批量操作
                    job.servertype == 1 ? (IRunInterface) new RunInterfaceByWebService(info) : //源webservice批量操作
                    job.servertype == 2 ? (IRunInterface) new RunInterfaceByRest(info) :       //源Rest服务批量操作
                    null;
            return(iface);
        }