protected void GV_List_RowCommand(object sender, GridViewCommandEventArgs e) { //停止 if (e.CommandName.Equals("StopTrigger")) { int id = int.Parse(e.CommandArgument.ToString()); BatchTrigger batchTrigger = TheBatchTriggerMgr.LoadBatchTrigger(id); batchTrigger.Status = BusinessConstants.CODE_MASTER_STATUS_VALUE_PAUSE; TheBatchTriggerMgr.UpdateBatchTrigger(batchTrigger); ShowSuccessMessage("MasterData.Jobs.Trigger.StopSuccessfully", batchTrigger.BatchJobDetail.Name); this.DataBind(); } //启动 if (e.CommandName.Equals("StartTrigger")) { int id = int.Parse(e.CommandArgument.ToString()); BatchTrigger batchTrigger = TheBatchTriggerMgr.LoadBatchTrigger(id); batchTrigger.Status = BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS; //int minuteOdd = DateTime.Now.Minute % batchTrigger.Interval; //string newDate = DateTime.Now.AddMinutes(batchTrigger.Interval - minuteOdd).ToString("yyyy-MM-dd hh:mm"); //batchTrigger.NextFireTime = DateTime.Parse(newDate); TheBatchTriggerMgr.UpdateBatchTrigger(batchTrigger); ShowSuccessMessage("MasterData.Jobs.Trigger.StartSuccessfully", batchTrigger.BatchJobDetail.Name); this.DataBind(); } //查看日志 if (e.CommandName.Equals("ViewLog")) { int id = int.Parse(e.CommandArgument.ToString()); this.ucLog.Visible = true; this.ucLog.InitPageParameter(id); } }
public void InitPageParameter(int triggerId) { this.TriggerId = triggerId; BatchTrigger batchTrigger = TheBatchTriggerMgr.LoadBatchTrigger(triggerId); this.lbJobName.Text = batchTrigger.BatchJobDetail.Name; this.lbJobDescription.Text = batchTrigger.BatchJobDetail.Description; this.tbStartDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); this.tbEndDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); DoSearch(); }
private void DataBind() { BatchTrigger batchTrigger = TheBatchTriggerMgr.LoadLeanEngineTrigger(); if (batchTrigger != null) { this.tbPrevFireTime.Text = batchTrigger.PreviousFireTime.HasValue ? batchTrigger.PreviousFireTime.Value.ToString("yyyy-MM-dd HH:mm") : string.Empty; this.tbNextFireTime.Text = batchTrigger.NextFireTime.HasValue ? batchTrigger.NextFireTime.Value.ToString("yyyy-MM-dd HH:mm") : string.Empty; this.tbInterval.Text = batchTrigger.Interval.ToString(); this.lblIntervalType.Value = batchTrigger.IntervalType; } }
protected void GV_BatchTrigger_RowEditing(object sender, GridViewEditEventArgs e) { GridViewRow row = this.GV_List.Rows[e.NewEditIndex]; HiddenField hfId = (HiddenField)row.FindControl("hfId"); BatchTrigger batchTrigger = TheBatchTriggerMgr.LoadBatchTrigger(int.Parse(hfId.Value)); if (batchTrigger.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS) { ShowErrorMessage("MasterData.Jobs.Trigger.StopFirst"); e.Cancel = true; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BatchTrigger batchTrigger = TheBatchTriggerMgr.LoadLeanEngineTrigger(); if (batchTrigger != null) { bool isPause = (batchTrigger.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_PAUSE); if (!isPause) { StartEvent(sender, null); } this.InitialUI(!isPause); } } }
private void StartStopService(bool enable) { try { BatchTrigger batchTrigger = TheBatchTriggerMgr.LoadLeanEngineTrigger(); if (batchTrigger != null) { batchTrigger.Status = enable ? BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS : BusinessConstants.CODE_MASTER_STATUS_VALUE_PAUSE; TheBatchTriggerMgr.UpdateBatchTrigger(batchTrigger); ShowSuccessMessage("MasterData.Jobs.Trigger.StopSuccessfully", batchTrigger.BatchJobDetail.Name); } } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
protected void ODS_GV_BatchTrigger_OnUpdating(object source, ObjectDataSourceMethodEventArgs e) { BatchTrigger batchTrigger = (BatchTrigger)e.InputParameters[0]; BatchTrigger oldTrigger = TheBatchTriggerMgr.LoadBatchTrigger(batchTrigger.Id); batchTrigger.BatchJobDetail = oldTrigger.BatchJobDetail; batchTrigger.Name = oldTrigger.Name; batchTrigger.Description = oldTrigger.Description; GridViewRow row = this.GV_List.Rows[this.CurrentIndex]; com.Sconit.Control.CodeMstrDropDownList ddlIntervalType = (com.Sconit.Control.CodeMstrDropDownList)row.FindControl("ddlIntervalType"); if (ddlIntervalType.SelectedIndex != -1) { batchTrigger.IntervalType = ddlIntervalType.SelectedValue; } CurrentJob = oldTrigger.BatchJobDetail.Name; }