Exemplo n.º 1
0
    /// <summary>
    /// 保存信息
    /// </summary>
    public void SaveInfo()
    {
        WorkRule     objWorkRule     = new WorkRule();
        Work_PlanRun objWork_PlanRun = new Work_PlanRun();

        objWork_PlanRun.WorkInfoID = WorkInfoID;
        objWork_PlanRun.PlanID     = PlanID;
        objWork_PlanRun.RunDate    = txtRunDateTime.TextDateTime;
        objWork_PlanRun.IsRun      = false;
        objWorkRule.InsertPlanRun(objWork_PlanRun);
        MessageDialog("设置成功", "PlanList.aspx?WorkInfoID=" + WorkInfoID);
    }
Exemplo n.º 2
0
 private void ProcessNextWorkDate()
 {
     while (true)
     {
         try
         {
             WorkRule workRule = new WorkRule();
             bool     flag     = false;
             foreach (Work_Plan current in workRule.GetCreateNextPlanDate(this._Work_Host))
             {
                 try
                 {
                     DateTime dateTime = PlanHelper.CreateNextPlanDate(current.PlanConfig, current.LastRunDate);
                     if (dateTime != DateTime.MaxValue)
                     {
                         Work_PlanRun work_PlanRun = new Work_PlanRun();
                         work_PlanRun.WorkInfoID = current.WorkInfoID;
                         work_PlanRun.PlanID     = current.PlanID;
                         work_PlanRun.RunDate    = dateTime;
                         work_PlanRun.IsRun      = false;
                         flag = true;
                         workRule.CurrentEntities.AddTowork_planrun(work_PlanRun);
                     }
                 }
                 catch (Exception ex)
                 {
                     ("循环检查创建" + current.PlanName + "下次执行时间出现异常:" + ex.Message).WriteLineRed("");
                     LogHelper.Write("WorkLog", "循环检创建" + current.PlanName + "下次执行时间出现异常", ex, "");
                 }
             }
             if (flag)
             {
                 "提交下一次计划更新".WriteLineYellow("");
                 workRule.CurrentEntities.SaveChanges();
             }
         }
         catch (Exception ex)
         {
             ("循环检查创建各作业下次执行时间出现异常:" + ex.Message).WriteLineRed("");
             try
             {
                 LogHelper.Write("WorkLog", "循环检查创建各作业下次执行时间出现异常", ex, "");
             }
             catch (Exception exception)
             {
                 EventLogWriter.WriterLog(exception);
             }
         }
         Thread.Sleep(this._NextWorkDateSleep);
     }
 }
Exemplo n.º 3
0
 public void UpdatePlanRun(Work_PlanRun objWork_PlanRun)
 {
     this.CurrentEntities.SaveChanges();
 }
Exemplo n.º 4
0
 public void InsertPlanRun(Work_PlanRun objWork_PlanRun)
 {
     this.CurrentEntities.AddTowork_planrun(objWork_PlanRun);
     this.CurrentEntities.SaveChanges();
 }