private void SetEditObject(object obj) { UserSchedulerJob job = (UserSchedulerJob)obj; if (job == null) { this.txtJobNameEdit.Text = string.Empty; this.ddlJobTypeEdit.SelectedIndex = 0; this.txtJobActionEdit.Text = string.Empty; this.txtRepeatIntervalEdit.Text = string.Empty; this.txtCommentsEdit.Text = string.Empty; } else { this.txtJobNameEdit.Text = job.JobName; try { this.ddlJobTypeEdit.SelectedValue = job.JobType; } catch { this.ddlJobTypeEdit.SelectedIndex = 0; } this.txtJobActionEdit.Text = job.JobAction; this.txtRepeatIntervalEdit.Text = job.RepeatInterval.ToString(); this.txtCommentsEdit.Text = job.Comments; } }
public void DeleteUserSchedulerJob(UserSchedulerJob userSchedulerJob) { string command = string.Empty; command += "BEGIN "; command += "dbms_scheduler.drop_job('{0}', TRUE); "; command += "END; "; command = string.Format(command, userSchedulerJob.JobName.Trim().ToUpper()); this.DataProvider.CustomExecute(new SQLCondition(command)); }
protected void cmdAdd_ServerClick(object sender, System.EventArgs e) { UserSchedulerJob job = (UserSchedulerJob)GetEditObject(); if (job != null) { this._JobFacade.AddUserSchedulerJob(job); this.RequestData(); this._ButtonHelper.PageActionStatusHandle(PageActionType.Add); } }
protected override void Grid_ClickCell(GridRecord row, string commandName) { try { if (commandName == "Enable") { UserSchedulerJob job = (UserSchedulerJob)this.GetEditObject(row); if (job != null) { this._JobFacade.EnableUserSchedulerJob(job.JobName); cmdQuery_ServerClick(null, null); } } else if (commandName == "Disable") { UserSchedulerJob job = (UserSchedulerJob)this.GetEditObject(row); if (job != null) { this._JobFacade.DisableUserSchedulerJob(job.JobName); cmdQuery_ServerClick(null, null); } } else if (commandName == "Stop") { UserSchedulerJob job = (UserSchedulerJob)this.GetEditObject(row); if (job != null) { this._JobFacade.StopUserSchedulerJob(job.JobName); cmdQuery_ServerClick(null, null); } } else if (commandName == "RunImmediately") { UserSchedulerJob job = (UserSchedulerJob)this.GetEditObject(row); if (job != null) { this._JobFacade.RunUserSchedulerJob(job.JobName); cmdQuery_ServerClick(null, null); } } else if (commandName == "Log") { this.Response.Redirect(this.MakeRedirectUrl("./FViewJobLog.aspx?jobid=" + row.Items.FindItemByKey("JobName").Text), false); } } catch (Exception ex) { ExceptionManager.Raise(this.GetType(), ex.Message, ex.InnerException); } }
private string[] FormatExportRecord(object obj) { UserSchedulerJob job = (UserSchedulerJob)obj; return(new string[] { job.JobName, job.JobType, job.JobAction, FormatHelper.TODateTimeString(FormatHelper.TODateInt(job.StartDate), FormatHelper.TOTimeInt(job.StartDate)), job.RepeatInterval, languageComponent1.GetString(string.Compare(job.Enabled, "True", true) == 0 ? "trueText" : "falseText"), job.State, FormatHelper.TODateTimeString(FormatHelper.TODateInt(job.LastStartDate), FormatHelper.TOTimeInt(job.LastStartDate)), job.LastRunDuration.ToString(), FormatHelper.TODateTimeString(FormatHelper.TODateInt(job.NextRunDate), FormatHelper.TOTimeInt(job.NextRunDate)), job.Comments }); }
private object GetEditObject() { if (this.ValidateInput()) { UserSchedulerJob job = this._JobFacade.CreateNewUserSchedulerJob(); job.JobName = this.txtJobNameEdit.Text; job.JobType = this.ddlJobTypeEdit.SelectedValue; job.JobAction = this.txtJobActionEdit.Text; job.RepeatInterval = this.txtRepeatIntervalEdit.Text; job.Comments = this.txtCommentsEdit.Text; return(job); } else { return(null); } }
public void AddUserSchedulerJob(UserSchedulerJob userSchedulerJob) { string command = string.Empty; command += "BEGIN "; command += "dbms_scheduler.create_job(job_name => '{0}', "; command += "job_type => '{1}', "; command += "job_action => '{2}', "; command += "start_date => sysdate, "; command += "repeat_interval => '{3}', "; command += "comments => '{4}'); "; command += "END; "; command = string.Format(command, userSchedulerJob.JobName.Trim().ToUpper(), userSchedulerJob.JobType.Trim().ToUpper(), userSchedulerJob.JobAction.Trim().ToUpper(), userSchedulerJob.RepeatInterval.Trim().ToUpper(), userSchedulerJob.Comments.Trim().ToUpper()); this.DataProvider.CustomExecute(new SQLCondition(command)); }
protected DataRow GetGridRow(object obj) { UserSchedulerJob job = (UserSchedulerJob)obj; //return new UltraGridRow( // new object[]{ // "false", // job.JobName, // job.JobType, // job.JobAction, // FormatHelper.TODateTimeString(FormatHelper.TODateInt(job.StartDate),FormatHelper.TOTimeInt(job.StartDate)), // job.RepeatInterval, // languageComponent1.GetString(string.Compare(job.Enabled, "True", true) == 0 ? "trueText" : "falseText"), // job.State, // FormatHelper.TODateTimeString(FormatHelper.TODateInt(job.LastStartDate),FormatHelper.TOTimeInt(job.LastStartDate)), // job.LastRunDuration.ToString(), // FormatHelper.TODateTimeString(FormatHelper.TODateInt(job.NextRunDate),FormatHelper.TOTimeInt(job.NextRunDate)), // job.Comments, // "", // "", // "", // "" // }); DataRow row = this.DtSource.NewRow(); row["JobName"] = job.JobName; row["JobType"] = job.JobType; row["JobAction"] = job.JobAction; row["StartDateTime"] = FormatHelper.TODateTimeString(FormatHelper.TODateInt(job.StartDate), FormatHelper.TOTimeInt(job.StartDate)); row["RepeatInterval"] = job.RepeatInterval; row["Enabled"] = languageComponent1.GetString(string.Compare(job.Enabled, "True", true) == 0 ? "trueText" : "falseText"); row["State"] = job.State; row["LastStartDateTime"] = FormatHelper.TODateTimeString(FormatHelper.TODateInt(job.LastStartDate), FormatHelper.TOTimeInt(job.LastStartDate)); row["LastRunDuration"] = job.LastRunDuration.ToString(); row["NextRunDateTime"] = FormatHelper.TODateTimeString(FormatHelper.TODateInt(job.NextRunDate), FormatHelper.TOTimeInt(job.NextRunDate)); row["Comments"] = job.Comments; return(row); }
//protected void chbSelectAll_CheckedChanged(object sender, System.EventArgs e) //{ // if (this.chbSelectAll.Checked) // { // this.gridHelper.CheckAllRows(CheckStatus.Checked); // } // else // { // this.gridHelper.CheckAllRows(CheckStatus.Unchecked); // } //} protected void cmdDelete_ServerClick(object sender, System.EventArgs e) { ArrayList rowArray = this.gridHelper.GetCheckedRows(); if (rowArray != null && rowArray.Count > 0) { ArrayList jobArray = new ArrayList(rowArray.Count); foreach (GridRecord row in rowArray) { UserSchedulerJob job = (UserSchedulerJob)GetEditObject(row); if (job != null) { jobArray.Add(job); } } this._JobFacade.DeleteUserSchedulerJob((UserSchedulerJob[])jobArray.ToArray(typeof(UserSchedulerJob))); this.RequestData(); this._ButtonHelper.PageActionStatusHandle(PageActionType.Delete); } }