Ejemplo n.º 1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            ISchedulerControl scd = ITSActivator.OpenConnection <ISchedulerControl>(Consts.FrameworkSchedulerClass);

            scd.CreateTask(GetUserControlParameters().IndexScheduleJob(), new CancellationTokenSource());
            this.Close();
        }
Ejemplo n.º 2
0
        private ITSolution.Scheduler.EntidadesBd.TaskIts indexarTarefa()
        {
            var proccessSelected = cbProcesso.SelectedItem as ITSolution.Scheduler.EntidadesBd.ProcessIts;

            if (proccessSelected != null)
            {
                memDescProcess.Text = proccessSelected.DescricaoProcesso;

                if (proccessSelected.CodigoProcesso == "INS_TSTE")
                {
                }
                else if (proccessSelected.CodigoProcesso == "FEC_FOLHA")
                {
                    try
                    {
                        //var schedulerControl = new Scheduler.Manager.SchedulerControl();
                        ISchedulerControl scd = ITSActivator.OpenConnection <ISchedulerControl>(Consts.FrameworkSchedulerClass);
                        scd.CreateTask(this.control.SchedulerJob, cts);
                        return(this.control.SchedulerJob);
                    }
                    catch (Exception ex)
                    {
                        XMessageIts.ExceptionMessage(ex);
                    }
                }
                return(null);
            }
            return(null);
        }
Ejemplo n.º 3
0
        private void btnStartExec_ItemClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                var taskSel = GridViewUtil.GetFocusedRow <ITSolution.Scheduler.EntidadesBd.TaskIts>(gridViewTasks);

                ISchedulerControl sc = ITSActivator.OpenConnection <ISchedulerControl>(Consts.FrameworkSchedulerClass);
                this.cts = new CancellationTokenSource();
                sc.Execute(taskSel.IdTask, cts);
            }
            catch (Exception ex)
            {
                XMessageIts.ExceptionMessageDetails(ex, "Erro ao iniciar a tarefa!");
            }
        }
Ejemplo n.º 4
0
        private void btnRefresh_ItemClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                ISchedulerControl control = ITSActivator.OpenConnection <ISchedulerControl>(Consts.FrameworkSchedulerClass);
                gridControlTasks.DataSource = control.GetTaskList();

                //var ctx = SchedulerContextGeneric<ITSolution.Scheduler.EntidadesBd.TaskIts>.Instance;

                ////gridControlTasks.DataSource = ctx.Dao.FindAll().OrderByDescending(t => t.DtCriacao);
                //XFrmWait.StartTask(carregarTarefas());
            }
            catch (Exception ex)
            {
                XMessageIts.ExceptionMessage(ex);
            }
        }
Ejemplo n.º 5
0
 private void XFrmAddNewTask_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (chkExecuteImediate.Checked && this.task != null)
     {
         try
         {
             ISchedulerControl sc = ITSActivator.OpenConnection <ISchedulerControl>(Consts.FrameworkSchedulerClass);
             this.cts = new CancellationTokenSource();
             sc.Execute(this.task.IdTask, cts);
             //using (var scdc = new SchedulerControl())
             //{
             //    this.cts = new CancellationTokenSource();
             //    await scdc.Execute(this.task.IdTask, cts);
             //}
         }
         catch (Exception ex)
         {
             XMessageIts.ExceptionMessageDetails(ex, "Erro ao iniciar a tarefa!");
         }
     }
 }
Ejemplo n.º 6
0
 public T Open(string Url)
 {
     return(ITSActivator.OpenConnection <T>(Url));
 }