protected void btnConfirm_Click(object sender, EventArgs e) { DateTime timeNow; DateTime StartTime; timeNow=System.DateTime.Now; StartTime=Convert.ToDateTime(rdtimepStartTime.Text); long i = StartTime.Ticks - timeNow.Ticks; if (StartTime.Ticks - timeNow.Ticks > 0 || StartTime.Ticks - timeNow.Ticks == 0) { //����job BLL_JOB = new JOB(); flagSuccess = BLL_JOB.Create(this.KeyId, "Insert"); if (flagSuccess != string.Empty)//�ɹ�����Task��jobId�ֶ� { GetData();//��ѯ���� System.Guid KeyIdGuid = new Guid(flagSuccess); SchedulerObj.JobID = KeyIdGuid; updateSuccess = BLL_ScheduleTasks.UpdateInTaskView(SchedulerObj); if (updateSuccess == true) { Response.Redirect("~/Schedule Billing/ScheduleTasksForm.aspx?SuccessFlag=" + updateSuccess); } else { //����taskʧ�� MessageBox(false, false, true, GetGlobalResourceObject("WebResource", "TaskDetailFormView_UpdateTask_ErrorMessage").ToString()); } } else { //����jobʧ�� MessageBox(false, false, true, GetGlobalResourceObject("WebResource", "TaskDetailFormView_ConfirmMessage_ErrorMessage").ToString()); } } else { //StartTimeС��ϵͳʱ�䣬��������� MessageBox(false, false, true, GetGlobalResourceObject("WebResource", "TaskDetailFormView_StartTime_ErrorMessage").ToString()); } }
/// <summary> /// 返回SQL命令:(创建作业步骤 1,杀掉UTP进程) /// </summary> /// <returns></returns> public string strSQLUTPKill(string sid) { JOB job = new JOB(); string strDatabaseName = string.Empty; strDatabaseName = job.GetConfig("strDatabaseName") + ".dbo."; string strSQLForUTPStart = "exec " + strDatabaseName + "PrJobUTPKill '" + sid + "'"; return strSQLForUTPStart; }
/// <summary> /// 返回SQL命令:(创建作业步骤 1,检查UTP是否启动) /// </summary> /// <returns></returns> public string strSQLUPTBilling(Job jb, string JobCommandString) { string strTemp = JobCommandString; string[] strTemps = strTemp.Split('e'); JOB job = new JOB(); string strDatabaseName = string.Empty; strDatabaseName = job.GetConfig("strDatabaseName") + ".dbo."; string strSQLUPTBilling = "exec " + strDatabaseName + "[PrJobUTPBilling] '" + jb.JobID + "'," + "'" + JobCommandString + "'"; return strSQLUPTBilling; }