/// <summary> /// Selects Asynchronous task from LayerD /// </summary> /// <param name="asyncParameterValue">Async Parameter Value</param> private void UOC_SelectTask(AsyncProcessingServiceParameterValue asyncParameterValue) { AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue(); this.ReturnValue = asyncReturnValue; LayerD myDao = new LayerD(this.GetDam()); myDao.SelectTask(asyncParameterValue, asyncReturnValue); DataTable dt = (DataTable)asyncReturnValue.Obj; asyncReturnValue.Obj = null; if (dt != null) { if (dt.Rows.Count != 0) { asyncReturnValue.TaskId = Convert.ToInt32(dt.Rows[0]["Id"]); asyncReturnValue.UserId = dt.Rows[0]["UserId"].ToString(); asyncReturnValue.ProcessName = dt.Rows[0]["ProcessName"].ToString(); asyncReturnValue.Data = dt.Rows[0]["Data"].ToString(); asyncReturnValue.NumberOfRetries = Convert.ToInt32(dt.Rows[0]["NumberOfRetries"]); asyncReturnValue.ReservedArea = dt.Rows[0]["ReservedArea"].ToString(); asyncReturnValue.CommandId = Convert.ToInt32(dt.Rows[0]["CommandId"]); } } }
/// <summary> /// Updates information in the database that the asynchronous task is failed and can be retried later /// </summary> /// <param name="asyncParameterValue">Asynchronous Parameter Values</param> private void UOC_UpdateTaskRetry(AsyncProcessingServiceParameterValue asyncParameterValue) { AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue(); this.ReturnValue = asyncReturnValue; LayerD myDao = new LayerD(this.GetDam()); myDao.UpdateTaskRetry(asyncParameterValue, asyncReturnValue); }
/// <summary> /// Selects user command from Database through LayerD /// </summary> /// <param name="asyncParameterValue"></param> private void UOC_SelectCommand(AsyncProcessingServiceParameterValue asyncParameterValue) { AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue(); this.ReturnValue = asyncReturnValue; LayerD myDao = new LayerD(this.GetDam()); myDao.SelectCommand(asyncParameterValue, asyncReturnValue); }
/// <summary> /// Inserts Async Parameter values to Database through LayerD /// </summary> /// <param name="asyncParameterValue"></param> public void UOC_InsertTask(AsyncProcessingServiceParameterValue asyncParameterValue) { // 戻り値クラスを生成して、事前に戻り値に設定しておく。 AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue(); this.ReturnValue = asyncReturnValue; LayerD myDao = new LayerD(this.GetDam()); myDao.InsertTask(asyncParameterValue, asyncReturnValue); }
/// <summary> /// To get Asynchronous Task from the database /// </summary> /// <param name="asyncParameterValue"></param> /// <param name="asyncReturnValue"></param> public void SelectTask(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) { string filename = string.Empty; filename = "SelectTask.sql"; // Get SQL query from file. this.SetSqlByFile3(filename); // Set SQL parameter values this.SetParameter("P1", asyncParameterValue.RegistrationDateTime); this.SetParameter("P2", asyncParameterValue.NumberOfRetries); this.SetParameter("P3", (int)AsyncProcessingServiceParameterValue.AsyncStatus.Register); this.SetParameter("P4", (int)AsyncProcessingServiceParameterValue.AsyncStatus.AbnormalEnd); this.SetParameter("P7", asyncParameterValue.CompletionDateTime); DataTable dt = new DataTable(); // Get Asynchronous Task from the database this.ExecSelectFill_DT(dt); asyncReturnValue.Obj = dt; }
/// <summary> /// Inserts async parameter values to database /// </summary> /// <param name="asyncParameterValue"></param> /// <param name="asyncReturnValue"></param> public void InsertTask(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) { string filename = string.Empty; filename = "AsyncProcessingServiceInsert.sql"; // Get SQL query from file. this.SetSqlByFile3(filename); // Set SQL parameter values this.SetParameter("P2", asyncParameterValue.UserId); this.SetParameter("P3", asyncParameterValue.ProcessName); this.SetParameter("P4", asyncParameterValue.Data); this.SetParameter("P5", asyncParameterValue.RegistrationDateTime); this.SetParameter("P6", DBNull.Value); this.SetParameter("P7", asyncParameterValue.NumberOfRetries); this.SetParameter("P8", DBNull.Value); this.SetParameter("P9", asyncParameterValue.StatusId); this.SetParameter("P10", asyncParameterValue.ProgressRate); this.SetParameter("P11", asyncParameterValue.CommandId); this.SetParameter("P12", asyncParameterValue.ReservedArea); // Execute SQL query asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery(); }
/// <summary> /// Selects user command from database /// </summary> /// <param name="asyncParameterValue">Asynchronous Parameter Values</param> /// <param name="asyncReturnValue">Asynchronous Return Values</param> public void SelectCommand(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) { string filename = string.Empty; filename = "SelectCommand.sql"; // Get SQL query from file. this.SetSqlByFile3(filename); // Set SQL parameter values this.SetParameter("P1", asyncParameterValue.TaskId); // Execute SQL query asyncReturnValue.Obj = this.ExecSelectScalar(); }
/// <summary> /// Set stop command for all running asynchronous task. /// </summary> /// <param name="asyncParameterValue">Asynchronous Parameter Values</param> /// <param name="asyncReturnValue">Asynchronous Return Values</param> public void StopAllTask(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) { string filename = string.Empty; filename = "StopAllTask.sql"; // Get SQL query from file. this.SetSqlByFile3(filename); // Set SQL parameter values this.SetParameter("P1", asyncParameterValue.StatusId); this.SetParameter("P2", asyncParameterValue.CommandId); // Execute SQL query asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery(); }
/// <summary> /// Updates progress rate of the asynchronous task in the database. /// </summary> /// <param name="asyncParameterValue">Asynchronous Parameter Values</param> /// <param name="asyncReturnValue">Asynchronous Return Values</param> public void UpdateTaskProgress(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) { string filename = string.Empty; filename = "UpdateTaskProgress.sql"; // Get SQL query from file. this.SetSqlByFile3(filename); // Set SQL parameter values this.SetParameter("P1", asyncParameterValue.TaskId); this.SetParameter("P2", asyncParameterValue.ProgressRate); // Execute SQL query asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery(); }
/// <summary> /// Updates information in the database that the asynchronous task is failed and abort this task [status=Abort] /// </summary> /// <param name="asyncParameterValue">Asynchronous Parameter Values</param> /// <param name="asyncReturnValue">Asynchronous Return Values</param> public void UpdateTaskFail(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) { string filename = string.Empty; filename = "UpdateTaskFail.sql"; // Get SQL query from file. this.SetSqlByFile3(filename); // Set SQL parameter values this.SetParameter("P1", asyncParameterValue.TaskId); this.SetParameter("P2", asyncParameterValue.CompletionDateTime); this.SetParameter("P3", asyncParameterValue.StatusId); this.SetParameter("P4", asyncParameterValue.ExceptionInfo); // Execute SQL query asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery(); }
/// <summary> /// Updates information in the database that the asynchronous task is started /// </summary> /// <param name="asyncParameterValue">Asynchronous Parameter Values</param> /// <param name="asyncReturnValue">Asynchronous Return Values</param> public void UpdateTaskStart(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue) { string filename = "UpdateTaskStart.sql"; // Get SQL query from file. this.SetSqlByFile3(filename); // Set SQL parameter values this.SetParameter("P1", asyncParameterValue.TaskId); this.SetParameter("P2", asyncParameterValue.ExecutionStartDateTime); this.SetParameter("P3", asyncParameterValue.StatusId); this.SetParameter("P4", DBNull.Value); // Execute SQL query asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery(); }