protected void btnSave_Click(object sender, EventArgs e)
    {
        var original_scheduledTask = new InfoControl.Web.ScheduledTasks.ScheduledTask();

        schedulerManager = new SchedulerManager(this);
        scheduledTask = new InfoControl.Web.ScheduledTasks.ScheduledTask();

        if (scheduledTaskId > 0)
        {
            original_scheduledTask = schedulerManager.GetScheduleTask(scheduledTaskId);
            scheduledTask = original_scheduledTask.Duplicate();
        }

        scheduledTask.Name = txtName.Text;
        scheduledTask.Period = ucCurrFieldTxtPeriod.IntValue;
        scheduledTask.Enabled = chkEnabled.Checked;
        scheduledTask.TypeFullName = txtTypeFullName.Text;

        if (ucPeriodDate.DateTime != null)
            scheduledTask.StartTime = Convert.ToDateTime(ucPeriodDate.DateTime);
        
        schedulerManager.SaveScheduleTask(scheduledTask);

        Server.Transfer("ScheduleTasks.aspx");
    }
Esempio n. 2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        var original_scheduledTask = new InfoControl.Web.ScheduledTasks.ScheduledTask();

        schedulerManager = new SchedulerManager(this);
        scheduledTask    = new InfoControl.Web.ScheduledTasks.ScheduledTask();

        if (scheduledTaskId > 0)
        {
            original_scheduledTask = schedulerManager.GetScheduleTask(scheduledTaskId);
            scheduledTask          = original_scheduledTask.Duplicate();
        }

        scheduledTask.Name         = txtName.Text;
        scheduledTask.Period       = ucCurrFieldTxtPeriod.IntValue;
        scheduledTask.Enabled      = chkEnabled.Checked;
        scheduledTask.TypeFullName = txtTypeFullName.Text;

        if (ucPeriodDate.DateTime != null)
        {
            scheduledTask.StartTime = Convert.ToDateTime(ucPeriodDate.DateTime);
        }

        schedulerManager.SaveScheduleTask(scheduledTask);

        Server.Transfer("ScheduleTasks.aspx");
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(Request["ScheduledTaskId"]))
        {
            scheduledTaskId = Convert.ToInt32(Request["ScheduledTaskId"]);
        }

        //txtLastRunStatus.Enabled = false;

        if (!IsPostBack)
        {
            if (scheduledTaskId > 0)
            {
                schedulerManager = new SchedulerManager(this);
                scheduledTask    = schedulerManager.GetScheduleTask(scheduledTaskId);

                txtName.Text          = scheduledTask.Name;
                ucPeriodDate.DateTime = scheduledTask.StartTime;
                ucCurrFieldTxtPeriod.CurrencyValue = scheduledTask.Period;
                chkEnabled.Checked     = scheduledTask.Enabled;
                txtTypeFullName.Text   = scheduledTask.TypeFullName;
                txtLastRunStatus.Value = scheduledTask.LastRunStatus;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(Request["ScheduledTaskId"]))
            scheduledTaskId = Convert.ToInt32(Request["ScheduledTaskId"]);

        //txtLastRunStatus.Enabled = false;

        if (!IsPostBack)
        {
            if (scheduledTaskId > 0)
            {
                schedulerManager = new SchedulerManager(this);
                scheduledTask = schedulerManager.GetScheduleTask(scheduledTaskId);

                txtName.Text = scheduledTask.Name;
                ucPeriodDate.DateTime = scheduledTask.StartTime;
                ucCurrFieldTxtPeriod.CurrencyValue = scheduledTask.Period;
                chkEnabled.Checked = scheduledTask.Enabled;
                txtTypeFullName.Text = scheduledTask.TypeFullName;
                txtLastRunStatus.Value = scheduledTask.LastRunStatus;
            }
        }

    }