diff --git a/root/files/resource/AsyncProcessingService/Xml/SPDefinition.xml b/root/files/resource/AsyncProcessingService/Xml/SPDefinition.xml
new file mode 100644
index 0000000..6baf634
--- /dev/null
+++ b/root/files/resource/AsyncProcessingService/Xml/SPDefinition.xml
@@ -0,0 +1,15 @@
+
+
+
+
+]>
+
+
+
+
+
+
+
diff --git a/root/files/resource/AsyncProcessingService/Xml/TMProtocolDefinition.xml b/root/files/resource/AsyncProcessingService/Xml/TMProtocolDefinition.xml
index 18f0271..1a467a3 100644
--- a/root/files/resource/AsyncProcessingService/Xml/TMProtocolDefinition.xml
+++ b/root/files/resource/AsyncProcessingService/Xml/TMProtocolDefinition.xml
@@ -9,23 +9,10 @@
+ url CDATA #IMPLIED url_ref IDREF #IMPLIED timeout CDATA #IMPLIED prop_ref IDREF #IMPLIED>
]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/root/programs/CS/6_CopyToService.bat b/root/programs/CS/6_CopyToService.bat
new file mode 100644
index 0000000..cb319f2
--- /dev/null
+++ b/root/programs/CS/6_CopyToService.bat
@@ -0,0 +1 @@
+xcopy /E /Y "Samples\AsyncSvc_sample\AsyncSvc_sample\bin\Debug" "Frameworks\Infrastructure\AsyncProcessingService\bin\Debug\"
\ No newline at end of file
diff --git a/root/programs/CS/7_SubmitTask.bat b/root/programs/CS/7_SubmitTask.bat
new file mode 100644
index 0000000..d4628ce
--- /dev/null
+++ b/root/programs/CS/7_SubmitTask.bat
@@ -0,0 +1 @@
+call "Samples\AsyncSvc_sample\TestAsyncSvc_Sample\bin\Debug\TestAsyncSvc_Sample.exe"
\ No newline at end of file
diff --git a/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.cs b/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.cs
index e6f39a2..9360bd0 100644
--- a/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.cs
+++ b/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.cs
@@ -51,46 +51,29 @@
//* Implemented code to 'Enable and Handle pre-shutdown notification' technique, to resolve the issue of
//* OnShutdown method, when you restart or shutdown the OS
//* 06/01/2016 Sandeep Implemented '_isServiceException' property and 'SetServiceException' method, to enhance the Start and Stop behavior
+//* 2018/08/24 西野 大介 ログ詳細化と、デッドコードの削除
//**********************************************************************************
using System;
-using System.IO;
using System.Threading;
using System.Reflection;
-using System.Runtime.Serialization.Formatters.Binary;
using System.ServiceProcess;
using Touryo.Infrastructure.Business.AsyncProcessingService;
using Touryo.Infrastructure.Business.Util;
+using Touryo.Infrastructure.Framework.AsyncProcessingService;
using Touryo.Infrastructure.Framework.Transmission;
using Touryo.Infrastructure.Framework.Exceptions;
using Touryo.Infrastructure.Framework.Common;
using Touryo.Infrastructure.Framework.Util;
using Touryo.Infrastructure.Public.Db;
-using Touryo.Infrastructure.Public.Str;
using Touryo.Infrastructure.Public.Log;
using Touryo.Infrastructure.Public.Util;
-namespace Touryo.Infrastructure.Framework.AsyncProcessingService
+namespace Touryo.Infrastructure.AsyncProcessingService
{
- /// Method names to update asynchronous task
- public class AsyncTaskUpdate
- {
- /// Update start
- public const string START = "UpdateTaskStart";
-
- /// Update retry
- public const string RETRY = "UpdateTaskRetry";
-
- /// Update fail
- public const string FAIL = "UpdateTaskFail";
-
- /// Update success
- public const string SUCCESS = "UpdateTaskSuccess";
- }
-
/// Asynchronous Processing Service class for windows service
- public class AsyncProcessingService : System.ServiceProcess.ServiceBase
+ public class AsyncProcessingService : ServiceBase
{
#region Member variables
@@ -144,7 +127,9 @@ public AsyncProcessingService()
this.CanShutdown = true;
// To enable pre-shutdown notification technique
- FieldInfo acceptedCommandsFieldInfo = typeof(ServiceBase).GetField("acceptedCommands", BindingFlags.Instance | BindingFlags.NonPublic);
+ FieldInfo acceptedCommandsFieldInfo = typeof(ServiceBase).GetField(
+ "acceptedCommands", BindingFlags.Instance | BindingFlags.NonPublic);
+
if (acceptedCommandsFieldInfo == null)
{
throw new ApplicationException(GetMessage.GetMessageDescription("E0009"));
@@ -165,10 +150,8 @@ public AsyncProcessingService()
///
public static void Main()
{
- System.ServiceProcess.ServiceBase[] ServicesToRun;
- ServicesToRun =
- new System.ServiceProcess.ServiceBase[] { new AsyncProcessingService() };
- System.ServiceProcess.ServiceBase.Run(ServicesToRun);
+ ServiceBase[] ServicesToRun = new ServiceBase[] { new AsyncProcessingService() };
+ ServiceBase.Run(ServicesToRun);
}
///
@@ -209,8 +192,8 @@ protected override void OnStart(string[] args)
ThreadPool.SetMaxThreads(this._maxThreadCount, 0);
// Starts main thread invocation.
- _mainThread = new Thread(new ThreadStart(MainThreadInvoke));
- _mainThread.Start();
+ this._mainThread = new Thread(new ThreadStart(MainThreadInvoke));
+ this._mainThread.Start();
}
}
@@ -228,6 +211,7 @@ protected override void OnStop()
// Stop the process of asynchronous service and Waits to complete all worker thread to complete.
this.StopAsyncProcess();
}
+
LogIF.InfoLog("ASYNC-SERVICE", GetMessage.GetMessageDescription("I0005"));
}
@@ -245,6 +229,7 @@ protected override void OnPause()
// Stop the process of asynchronous service and Waits to complete all worker thread to complete.
this.StopAsyncProcess();
}
+
LogIF.InfoLog("ASYNC-SERVICE", GetMessage.GetMessageDescription("I0006"));
}
@@ -271,6 +256,7 @@ protected override void OnCustomCommand(int command)
this.StopAsyncProcess();
base.OnCustomCommand(command);
}
+
LogIF.InfoLog("ASYNC-SERVICE", GetMessage.GetMessageDescription("I0009"));
}
@@ -310,14 +296,17 @@ public void MainThreadInvoke()
try
{
// Get asynchronous task from the database.
- AsyncProcessingServiceParameterValue asyncParameterValue = new AsyncProcessingServiceParameterValue("AsyncProcessingService", "SelectTask", "SelectTask", "SQL",
- new MyUserInfo("AsyncProcessingService", "AsyncProcessingService"));
+ ApsParameterValue asyncParameterValue = new ApsParameterValue(
+ "AsyncProcessingService", "SelectTask", "SelectTask", "SQL",
+ new MyUserInfo("AsyncProcessingService", "AsyncProcessingService"));
+
asyncParameterValue.RegistrationDateTime = DateTime.Now - new TimeSpan(_maxNumberOfHours, 0, 0);
asyncParameterValue.NumberOfRetries = this._maxNumberOfRetries;
asyncParameterValue.CompletionDateTime = DateTime.Now - new TimeSpan(_maxNumberOfHours, 0, 0);
- LayerB layerB = new LayerB();
- AsyncProcessingServiceReturnValue selectedAsyncTask = (AsyncProcessingServiceReturnValue)layerB.DoBusinessLogic(
- (BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted);
+
+ ApsLayerB layerB = new ApsLayerB();
+ ApsReturnValue selectedAsyncTask = (ApsReturnValue)layerB.DoBusinessLogic(
+ (BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted);
// Existence check of asynchronous task
if (string.IsNullOrEmpty(selectedAsyncTask.UserId))
@@ -349,8 +338,10 @@ public void MainThreadInvoke()
}
// Selected asynchronous task is assigned to a worker thread
- this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.START);
- LogIF.InfoLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("I0002"), selectedAsyncTask.TaskId));
+ this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.UpdateTaskStart);
+
+ LogIF.InfoLog("ASYNC-SERVICE", string.Format(
+ GetMessage.GetMessageDescription("I0002"), selectedAsyncTask.TaskId));
// Assign the task to the worker thread
ThreadPool.QueueUserWorkItem(new WaitCallback(this.WorkerThreadCallBack), (object)selectedAsyncTask);
@@ -360,7 +351,9 @@ public void MainThreadInvoke()
// Service Failed due to unexpected exception.
this._isServiceException = true;
this._infiniteLoop = false;
- LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0000"), ex.Message.ToString()));
+
+ LogIF.ErrorLog("ASYNC-SERVICE", string.Format(
+ GetMessage.GetMessageDescription("E0000"), ex.Message.ToString()));
}
}
}
@@ -375,7 +368,7 @@ public void MainThreadInvoke()
/// Selected Asynchronous Task
private void WorkerThreadCallBack(object asyncTask)
{
- AsyncProcessingServiceReturnValue selectedAsyncTask = (AsyncProcessingServiceReturnValue)asyncTask;
+ ApsReturnValue selectedAsyncTask = (ApsReturnValue)asyncTask;
// A new worker thread started an Async task
this._workerThreadCount++;
@@ -383,27 +376,37 @@ private void WorkerThreadCallBack(object asyncTask)
try
{
// To handle unstable "Register" state, when you invoke [Abort] at this state
- if (selectedAsyncTask.CommandId == (int)AsyncProcessingServiceParameterValue.AsyncCommand.Abort)
+ if (selectedAsyncTask.CommandId == (int)AsyncCommand.Abort)
{
- throw new BusinessSystemException("APSAbortCommand", GetMessage.GetMessageDescription("CTE0004"));
+ throw new BusinessSystemException(
+ AsyncErrorMessageID.APSAbortCommand.ToString(),
+ GetMessage.GetMessageDescription("CTE0004"));
}
// Call User Program to execute by using communication control function
- AsyncProcessingServiceParameterValue asyncParameterValue = new AsyncProcessingServiceParameterValue("AsyncProcessingService", "Start", "Start", "SQL",
- new MyUserInfo(selectedAsyncTask.UserId, selectedAsyncTask.TaskId.ToString()));
+ ApsParameterValue asyncParameterValue = new ApsParameterValue(
+ "AsyncProcessingService", "Start", "Start", "SQL",
+ new MyUserInfo(selectedAsyncTask.UserId, selectedAsyncTask.TaskId.ToString()));
+
asyncParameterValue.TaskId = selectedAsyncTask.TaskId;
asyncParameterValue.Data = selectedAsyncTask.Data;
+
CallController callController = new CallController(asyncParameterValue.User);
- AsyncProcessingServiceReturnValue asyncReturnValue = (AsyncProcessingServiceReturnValue)callController.Invoke(selectedAsyncTask.ProcessName, asyncParameterValue);
+ ApsReturnValue asyncReturnValue = (ApsReturnValue)callController.Invoke(selectedAsyncTask.ProcessName, asyncParameterValue);
if (asyncReturnValue.ErrorFlag == true)
{
- if (asyncReturnValue.ErrorMessageID == "APSStopCommand")
+ if (asyncReturnValue.ErrorMessageID == AsyncErrorMessageID.APSStopCommand.ToString())
{
- string exceptionInfo = "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + Environment.NewLine + "ErrorMessage: " + asyncReturnValue.ErrorMessage;
+ string exceptionInfo =
+ "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + Environment.NewLine +
+ "ErrorMessage: " + asyncReturnValue.ErrorMessage;
+
// Asynchronous task is stopped due to user 'stop' command.
- this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.RETRY, exceptionInfo);
- LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0001") + asyncReturnValue.ErrorMessage, selectedAsyncTask.TaskId));
+ this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.UpdateTaskRetry, exceptionInfo);
+
+ LogIF.ErrorLog("ASYNC-SERVICE", string.Format(
+ GetMessage.GetMessageDescription("E0001") + asyncReturnValue.ErrorMessage, selectedAsyncTask.TaskId));
}
else
{
@@ -413,41 +416,64 @@ private void WorkerThreadCallBack(object asyncTask)
{
// Asynchronous task does not exceeds the maximum number of retries
// Updated as retry later
- string exceptionInfo = "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + Environment.NewLine + "ErrorMessage: " + asyncReturnValue.ErrorMessage;
+ string exceptionInfo =
+ "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + Environment.NewLine +
+ "ErrorMessage: " + asyncReturnValue.ErrorMessage;
+
selectedAsyncTask.NumberOfRetries += 1;
- this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.RETRY, exceptionInfo);
- LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0004"), selectedAsyncTask.TaskId));
+ this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.UpdateTaskRetry, exceptionInfo);
+
+ LogIF.ErrorLog("ASYNC-SERVICE", string.Format(
+ GetMessage.GetMessageDescription("E0004"), selectedAsyncTask.TaskId));
}
else
{
// Asynchronous task exceeds maximum number of retries
// Update task as abort
- string exceptionInfo = "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + Environment.NewLine + "ErrorMessage: " + asyncReturnValue.ErrorMessage;
- this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.FAIL, exceptionInfo);
- LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0005"), selectedAsyncTask.TaskId));
+ string exceptionInfo =
+ "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + Environment.NewLine +
+ "ErrorMessage: " + asyncReturnValue.ErrorMessage;
+
+ this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.UpdateTaskFail, exceptionInfo);
+
+ LogIF.ErrorLog("ASYNC-SERVICE", string.Format(
+ GetMessage.GetMessageDescription("E0005"), selectedAsyncTask.TaskId));
}
}
}
else
{
// Selected Asynchronous task is completed successfully.
- this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.SUCCESS);
- LogIF.InfoLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("I0003"), selectedAsyncTask.TaskId));
+ this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.UpdateTaskSuccess);
+ LogIF.InfoLog("ASYNC-SERVICE", string.Format(
+ GetMessage.GetMessageDescription("I0003"), selectedAsyncTask.TaskId));
}
}
catch (BusinessSystemException ex)
{
// Asynchronous task is aborted due to BusinessSystemException sent by user program.
- string exceptionInfo = "ErrorMessageID: " + ex.messageID + Environment.NewLine + "ErrorMessage: " + ex.Message;
- this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.FAIL, exceptionInfo);
- LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0006"), selectedAsyncTask.TaskId, ex.Message));
+ string exceptionInfo =
+ "ErrorMessageID: " + ex.messageID + Environment.NewLine +
+ "ErrorMessage: " + ex.Message;
+
+ this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.UpdateTaskFail, exceptionInfo);
+
+ LogIF.ErrorLog("ASYNC-SERVICE", string.Format(
+ GetMessage.GetMessageDescription("E0006"),
+ selectedAsyncTask.TaskId, ex.ToString())); // ログ詳細化
}
catch (Exception ex)
{
// Asynchronous task is aborted due to unexpected exception.
- string exceptionInfo = "ErrorMessageID: " + ex.GetType().Name + Environment.NewLine + "ErrorMessage: " + ex.Message;
- this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.FAIL, exceptionInfo);
- LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0006"), selectedAsyncTask.TaskId, ex.Message));
+ string exceptionInfo =
+ "ErrorMessageID: " + ex.GetType().Name + Environment.NewLine +
+ "ErrorMessage: " + ex.Message;
+
+ this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.UpdateTaskFail, exceptionInfo);
+
+ LogIF.ErrorLog("ASYNC-SERVICE", string.Format(
+ GetMessage.GetMessageDescription("E0006"),
+ selectedAsyncTask.TaskId, ex.ToString())); // ログ詳細化
}
finally
{
@@ -538,71 +564,54 @@ public void SetFromConfig()
/// Selected Asynchronous Task
/// SQL_Update_Method_name
///
- public AsyncProcessingServiceReturnValue UpdateAsyncTask(AsyncProcessingServiceReturnValue selectedAsyncTask, string updateTask, string exceptionInfo = null)
+ public ApsReturnValue UpdateAsyncTask(ApsReturnValue selectedAsyncTask, AsyncTaskUpdate updateTask, string exceptionInfo = null)
{
- AsyncProcessingServiceParameterValue asyncParameterValue = new AsyncProcessingServiceParameterValue("AsyncProcessingService", updateTask, updateTask, "SQL",
- new MyUserInfo("AsyncProcessingService", "AsyncProcessingService"));
+ ApsParameterValue asyncParameterValue = new ApsParameterValue(
+ "AsyncProcessingService", updateTask.ToString(), updateTask.ToString(), "SQL",
+ new MyUserInfo("AsyncProcessingService", "AsyncProcessingService"));
+
asyncParameterValue.TaskId = selectedAsyncTask.TaskId;
// Update databse based on task
switch (updateTask)
{
- case AsyncTaskUpdate.START:
+ case AsyncTaskUpdate.UpdateTaskStart:
asyncParameterValue.ExecutionStartDateTime = DateTime.Now;
- asyncParameterValue.StatusId = (int)AsyncProcessingServiceParameterValue.AsyncStatus.Processing;
+ asyncParameterValue.StatusId = (int)AsyncStatus.Processing;
break;
- case AsyncTaskUpdate.RETRY:
+
+ case AsyncTaskUpdate.UpdateTaskRetry:
if (exceptionInfo.Length > 512)
{
exceptionInfo = exceptionInfo.Substring(0, 512);
}
asyncParameterValue.NumberOfRetries = selectedAsyncTask.NumberOfRetries;
asyncParameterValue.CompletionDateTime = DateTime.Now;
- asyncParameterValue.StatusId = (int)AsyncProcessingServiceParameterValue.AsyncStatus.AbnormalEnd;
+ asyncParameterValue.StatusId = (int)AsyncStatus.AbnormalEnd;
asyncParameterValue.ExceptionInfo = exceptionInfo;
break;
- case AsyncTaskUpdate.FAIL:
+
+ case AsyncTaskUpdate.UpdateTaskFail:
if (exceptionInfo.Length > 512)
{
exceptionInfo = exceptionInfo.Substring(0, 512);
}
asyncParameterValue.CompletionDateTime = DateTime.Now;
- asyncParameterValue.StatusId = (int)AsyncProcessingServiceParameterValue.AsyncStatus.Abort;
+ asyncParameterValue.StatusId = (int)AsyncStatus.Abort;
asyncParameterValue.ExceptionInfo = exceptionInfo;
break;
- case AsyncTaskUpdate.SUCCESS:
+
+ case AsyncTaskUpdate.UpdateTaskSuccess:
asyncParameterValue.CompletionDateTime = DateTime.Now;
asyncParameterValue.ProgressRate = 100;
- asyncParameterValue.StatusId = (int)AsyncProcessingServiceParameterValue.AsyncStatus.End;
+ asyncParameterValue.StatusId = (int)AsyncStatus.End;
break;
}
- LayerB layerB = new LayerB();
- AsyncProcessingServiceReturnValue asyncReturnValue = (AsyncProcessingServiceReturnValue)layerB.DoBusinessLogic(
- (BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted);
- return asyncReturnValue;
- }
-
- #endregion
+ ApsLayerB layerB = new ApsLayerB();
+ ApsReturnValue asyncReturnValue = (ApsReturnValue)layerB.DoBusinessLogic(
+ (BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted);
- #region DeserializeFromBase64
-
- ///
- /// Converts string data to byte array and byte array data to object.
- ///
- /// Base64 String
- /// Deserialized Object
- public object DeserializeFromBase64(string strBase64)
- {
- byte[] deserializeData = null;
- MemoryStream memStream = new MemoryStream();
- BinaryFormatter binForm = new BinaryFormatter();
-
- deserializeData = CustomEncode.FromBase64String(strBase64);
- memStream.Write(deserializeData, 0, deserializeData.Length);
- memStream.Seek(0, SeekOrigin.Begin);
- object obj = (object)binForm.Deserialize(memStream);
-
- return obj;
+ return asyncReturnValue;
}
#endregion
@@ -621,17 +630,22 @@ public void StopAsyncProcess()
this._mainThread.Join();
// Update stop command to all the running asynchronous task
- AsyncProcessingServiceParameterValue asyncParameterValue = new AsyncProcessingServiceParameterValue("AsyncProcessingService", "StopAllTask", "StopAllTask", "SQL",
- new MyUserInfo("AsyncProcessingService", "AsyncProcessingService"));
- asyncParameterValue.StatusId = (int)AsyncProcessingServiceParameterValue.AsyncStatus.Processing;
- asyncParameterValue.CommandId = (int)AsyncProcessingServiceParameterValue.AsyncCommand.Stop;
- LayerB layerB = new LayerB();
- AsyncProcessingServiceReturnValue asyncReturnValue = (AsyncProcessingServiceReturnValue)layerB.DoBusinessLogic(
- (BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted);
+ ApsParameterValue asyncParameterValue = new ApsParameterValue(
+ "AsyncProcessingService", "StopAllTask", "StopAllTask", "SQL",
+ new MyUserInfo("AsyncProcessingService", "AsyncProcessingService"));
+
+ asyncParameterValue.StatusId = (int)AsyncStatus.Processing;
+ asyncParameterValue.CommandId = (int)AsyncCommand.Stop;
+
+ ApsLayerB layerB = new ApsLayerB();
+ ApsReturnValue asyncReturnValue = (ApsReturnValue)layerB.DoBusinessLogic(
+ (BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted);
if (asyncReturnValue.ErrorFlag)
{
- LogIF.ErrorLog("ASYNC-SERVICE", "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + "ErrorMessage: " + asyncReturnValue.ErrorMessage);
+ LogIF.ErrorLog("ASYNC-SERVICE",
+ "ErrorMessageID: " + asyncReturnValue.ErrorMessageID +
+ "ErrorMessage: " + asyncReturnValue.ErrorMessage);
}
// Wait for all worker thread to be complete
@@ -659,9 +673,11 @@ public void SetServiceException()
try
{
// Checks for successful connection to the database.
- AsyncProcessingServiceParameterValue asyncParameterValue = new AsyncProcessingServiceParameterValue("AsyncProcessingService", "TestConnection", "TestConnection", "SQL",
- new MyUserInfo("AsyncProcessingService", "AsyncProcessingService"));
- LayerB layerB = new LayerB();
+ ApsParameterValue asyncParameterValue = new ApsParameterValue(
+ "AsyncProcessingService", "TestConnection", "TestConnection", "SQL",
+ new MyUserInfo("AsyncProcessingService", "AsyncProcessingService"));
+
+ ApsLayerB layerB = new ApsLayerB();
layerB.DoBusinessLogic((BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.NoTransaction);
// Asynchronous Processing Service initializes successfully without any errors
diff --git a/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.csproj b/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.csproj
index c07a795..40e3031 100644
--- a/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.csproj
+++ b/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/AsyncProcessingService.csproj
@@ -51,7 +51,9 @@
-
+
+ Component
+
Component
diff --git a/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/app.config b/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/app.config
index f5dbebc..11353a4 100644
--- a/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/app.config
+++ b/root/programs/CS/Frameworks/Infrastructure/AsyncProcessingService/app.config
@@ -1,15 +1,18 @@
-
+
+
+
-
-
-
+
+
+
+
diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerB.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerB.cs
new file mode 100644
index 0000000..6b2a38b
--- /dev/null
+++ b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerB.cs
@@ -0,0 +1,259 @@
+//**********************************************************************************
+//* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
+//**********************************************************************************
+
+#region Apache License
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+//**********************************************************************************
+//* クラス名 :LayerB
+//* クラス日本語名 :LayerB
+//*
+//* 日時 更新者 内容
+//* ---------- ---------------- -------------------------------------------------
+//* 11/28/2014 Supragyan Created LayerB class for AsyncProcessing Service
+//* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service
+//* 04/15/2015 Sandeep Did code modification of insert, update and select for AsyncProcessing Service
+//* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task
+//* Modified code to reset Exception information, before starting asynchronous task
+//* 06/26/2015 Sandeep Implemented code to get commandID in the SelectTask method,
+//* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state
+//* 06/01/2016 Sandeep Implemented method to test the connection of specified database
+//* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps)
+//**********************************************************************************
+
+using System;
+using System.Data;
+
+using Touryo.Infrastructure.Business.Business;
+
+namespace Touryo.Infrastructure.Business.AsyncProcessingService
+{
+ ///
+ /// LayerB class for AsyncProcessing Service
+ ///
+ public class ApsLayerB : MyFcBaseLogic
+ {
+ #region Insert
+
+ ///
+ /// Inserts Async Parameter values to Database through LayerD
+ ///
+ ///
+ public void UOC_InsertTask(ApsParameterValue parameterValue)
+ {
+ // 戻り値クラスを生成して、事前に戻り値に設定しておく。
+ ApsReturnValue returnValue = new ApsReturnValue();
+ this.ReturnValue = returnValue;
+
+ ApsLayerD layerD = new ApsLayerD(this.GetDam());
+ layerD.InsertTask(parameterValue, returnValue);
+ }
+
+ #endregion
+
+ #region Update
+
+ #region UpdateTaskStart
+
+ ///
+ /// Updates information in the database that the asynchronous task is started
+ ///
+ /// Asynchronous Parameter Values
+ private void UOC_UpdateTaskStart(ApsParameterValue parameterValue)
+ {
+ ApsReturnValue returnValue = new ApsReturnValue();
+ this.ReturnValue = returnValue;
+
+ ApsLayerD layerD = new ApsLayerD(this.GetDam());
+ layerD.UpdateTaskStart(parameterValue, returnValue);
+ }
+
+ #endregion
+
+ #region UpdateTaskRetry
+
+ ///
+ /// Updates information in the database that the asynchronous task is failed and can be retried later
+ ///
+ /// Asynchronous Parameter Values
+ private void UOC_UpdateTaskRetry(ApsParameterValue parameterValue)
+ {
+ ApsReturnValue returnValue = new ApsReturnValue();
+ this.ReturnValue = returnValue;
+
+ ApsLayerD layerD = new ApsLayerD(this.GetDam());
+ layerD.UpdateTaskRetry(parameterValue, returnValue);
+ }
+
+ #endregion
+
+ #region UpdateTaskFail
+
+ ///
+ /// Updates information in the database that the asynchronous task is failed and abort this task [status=Abort]
+ ///
+ /// Asynchronous Parameter Values
+ private void UOC_UpdateTaskFail(ApsParameterValue parameterValue)
+ {
+ ApsReturnValue returnValue = new ApsReturnValue();
+ this.ReturnValue = returnValue;
+
+ ApsLayerD layerD = new ApsLayerD(this.GetDam());
+ layerD.UpdateTaskFail(parameterValue, returnValue);
+ }
+
+ #endregion
+
+ #region UpdateTaskSuccess
+
+ ///
+ /// Updates information in the database that the asynchronous task is completed
+ ///
+ /// Asynchronous Parameter Values
+ private void UOC_UpdateTaskSuccess(ApsParameterValue parameterValue)
+ {
+ ApsReturnValue returnValue = new ApsReturnValue();
+ this.ReturnValue = returnValue;
+
+ ApsLayerD layerD = new ApsLayerD(this.GetDam());
+ layerD.UpdateTaskSuccess(parameterValue, returnValue);
+ }
+
+ #endregion
+
+ #region UpdateTaskProgress
+
+ ///
+ /// Updates progress rate of the asynchronous task in the database.
+ ///
+ /// Asynchronous Parameter Values
+ private void UOC_UpdateTaskProgress(ApsParameterValue parameterValue)
+ {
+ ApsReturnValue returnValue = new ApsReturnValue();
+ this.ReturnValue = returnValue;
+
+ ApsLayerD layerD = new ApsLayerD(this.GetDam());
+ layerD.UpdateTaskProgress(parameterValue, returnValue);
+ }
+
+ #endregion
+
+ #region UpdateTaskCommand
+
+ ///
+ /// Updates command value information of a selected asynchronous task
+ ///
+ /// Asynchronous Parameter Values
+ private void UOC_UpdateTaskCommand(ApsParameterValue parameterValue)
+ {
+ ApsReturnValue returnValue = new ApsReturnValue();
+ this.ReturnValue = returnValue;
+
+ ApsLayerD layerD = new ApsLayerD(this.GetDam());
+ layerD.UpdateTaskCommand(parameterValue, returnValue);
+ }
+
+ #endregion
+
+ #region StopAllTask
+
+ ///
+ /// Set stop command for all running asynchronous task
+ ///
+ /// Asynchronous Parameter Values
+ private void UOC_StopAllTask(ApsParameterValue parameterValue)
+ {
+ ApsReturnValue returnValue = new ApsReturnValue();
+ this.ReturnValue = returnValue;
+
+ ApsLayerD layerD = new ApsLayerD(this.GetDam());
+ layerD.StopAllTask(parameterValue, returnValue);
+ }
+
+ #endregion
+
+ #endregion
+
+ #region Select
+
+ #region SelectCommand
+
+ ///
+ /// Selects user command from Database through LayerD
+ ///
+ ///
+ private void UOC_SelectCommand(ApsParameterValue parameterValue)
+ {
+ ApsReturnValue returnValue = new ApsReturnValue();
+ this.ReturnValue = returnValue;
+
+ ApsLayerD layerD = new ApsLayerD(this.GetDam());
+ layerD.SelectCommand(parameterValue, returnValue);
+ }
+
+ #endregion
+
+ #region SelectTask
+
+ ///
+ /// Selects Asynchronous task from LayerD
+ ///
+ /// Async Parameter Value
+ private void UOC_SelectTask(ApsParameterValue parameterValue)
+ {
+ ApsReturnValue returnValue = new ApsReturnValue();
+ this.ReturnValue = returnValue;
+
+ ApsLayerD layerD = new ApsLayerD(this.GetDam());
+ layerD.SelectTask(parameterValue, returnValue);
+
+ DataTable dt = (DataTable)returnValue.Obj;
+ returnValue.Obj = null;
+
+ if (dt != null)
+ {
+ if (dt.Rows.Count != 0)
+ {
+ returnValue.TaskId = Convert.ToInt32(dt.Rows[0]["Id"]);
+ returnValue.UserId = dt.Rows[0]["UserId"].ToString();
+ returnValue.ProcessName = dt.Rows[0]["ProcessName"].ToString();
+ returnValue.Data = dt.Rows[0]["Data"].ToString();
+ returnValue.NumberOfRetries = Convert.ToInt32(dt.Rows[0]["NumberOfRetries"]);
+ returnValue.ReservedArea = dt.Rows[0]["ReservedArea"].ToString();
+ returnValue.CommandId = Convert.ToInt32(dt.Rows[0]["CommandId"]);
+ }
+ }
+ }
+
+ #endregion
+
+ #endregion
+
+ #region TestConnection
+
+ ///
+ /// Tests the connection with the specified database
+ ///
+ /// Async Parameter Value
+ private void UOC_TestConnection(ApsParameterValue parameterValue)
+ {
+ ApsLayerD layerD = new ApsLayerD(this.GetDam());
+ }
+
+ #endregion
+ }
+}
diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerD.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerD.cs
new file mode 100644
index 0000000..2a3edb8
--- /dev/null
+++ b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerD.cs
@@ -0,0 +1,338 @@
+//**********************************************************************************
+//* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
+//**********************************************************************************
+
+#region Apache License
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+//**********************************************************************************
+//* クラス名 :LayerD
+//* クラス日本語名 :LayerD
+//*
+//* 日時 更新者 内容
+//* ---------- ---------------- -------------------------------------------------
+//* 11/28/2014 Supragyan Created LayerD class for AsyncProcessing Service
+//* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service
+//* 04/14/2015 Sandeep Did code modification of update and select asynchronous task
+//* 04/14/2015 Sandeep Did code implementation of SetSqlByFile3 to access the SQL from embedded resource
+//* 05/28/2015 Sandeep Did code implementation to update Exception information to the database
+//* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task
+//* Modified code to reset Exception information, before starting asynchronous task
+//* 06/26/2015 Sandeep Removed the where condition command <> 'Abort' from the SelectTask asynchronous task,
+//* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state
+//* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps)
+//**********************************************************************************
+
+using System;
+using System.Data;
+
+using Touryo.Infrastructure.Business.Dao;
+using Touryo.Infrastructure.Framework.AsyncProcessingService;
+using Touryo.Infrastructure.Public.Db;
+
+namespace Touryo.Infrastructure.Business.AsyncProcessingService
+{
+ ///
+ /// LayerD class for AsyncProcessing Service
+ ///
+ public class ApsLayerD : MyBaseDao
+ {
+ /// AsyncProcessingService用B層
+ /// dam
+ public ApsLayerD(BaseDam dam) : base(dam) { }
+
+ #region Insert
+
+ ///
+ /// Inserts async parameter values to database
+ ///
+ ///
+ ///
+ public void InsertTask(ApsParameterValue parameterValue, ApsReturnValue returnValue)
+ {
+ string filename = string.Empty;
+ filename = "AsyncProcessingServiceInsert.sql";
+
+ // Get SQL query from file.
+ this.SetSqlByFile2(filename);
+
+ // Set SQL parameter values
+ this.SetParameter("P2", parameterValue.UserId);
+ this.SetParameter("P3", parameterValue.ProcessName);
+ this.SetParameter("P4", parameterValue.Data);
+ this.SetParameter("P5", parameterValue.RegistrationDateTime);
+ this.SetParameter("P6", DBNull.Value);
+ this.SetParameter("P7", parameterValue.NumberOfRetries);
+ this.SetParameter("P8", DBNull.Value);
+ this.SetParameter("P9", parameterValue.StatusId);
+ this.SetParameter("P10", parameterValue.ProgressRate);
+ this.SetParameter("P11", parameterValue.CommandId);
+ this.SetParameter("P12", parameterValue.ReservedArea);
+
+ // Execute SQL query
+ returnValue.Obj = this.ExecInsUpDel_NonQuery();
+ }
+
+ #endregion
+
+ #region Update
+
+ #region UpdateTaskStart
+
+ ///
+ /// Updates information in the database that the asynchronous task is started
+ ///
+ /// Asynchronous Parameter Values
+ /// Asynchronous Return Values
+ public void UpdateTaskStart(ApsParameterValue parameterValue, ApsReturnValue returnValue)
+ {
+ string filename = string.Empty;
+ filename = "UpdateTaskStart.sql";
+
+ // Get SQL query from file.
+ this.SetSqlByFile2(filename);
+
+ // Set SQL parameter values
+ this.SetParameter("P1", parameterValue.TaskId);
+ this.SetParameter("P2", parameterValue.ExecutionStartDateTime);
+ this.SetParameter("P3", parameterValue.StatusId);
+ this.SetParameter("P4", DBNull.Value);
+
+ // Execute SQL query
+ returnValue.Obj = this.ExecInsUpDel_NonQuery();
+ }
+
+ #endregion
+
+ #region UpdateTaskRetry
+
+ ///
+ /// Updates information in the database that the asynchronous task is failed and can be retried later
+ ///
+ /// Asynchronous Parameter Values
+ /// Asynchronous Return Values
+ public void UpdateTaskRetry(ApsParameterValue parameterValue, ApsReturnValue returnValue)
+ {
+ string filename = string.Empty;
+ filename = "UpdateTaskRetry.sql";
+
+ // Get SQL query from file.
+ this.SetSqlByFile2(filename);
+
+ // Set SQL parameter values
+ this.SetParameter("P1", parameterValue.TaskId);
+ this.SetParameter("P2", parameterValue.NumberOfRetries);
+ this.SetParameter("P3", parameterValue.CompletionDateTime);
+ this.SetParameter("P4", parameterValue.StatusId);
+ this.SetParameter("P5", parameterValue.ExceptionInfo);
+
+ // Execute SQL query
+ returnValue.Obj = this.ExecInsUpDel_NonQuery();
+ }
+
+ #endregion
+
+ #region UpdateTaskFail
+
+ ///
+ /// Updates information in the database that the asynchronous task is failed and abort this task [status=Abort]
+ ///
+ /// Asynchronous Parameter Values
+ /// Asynchronous Return Values
+ public void UpdateTaskFail(ApsParameterValue parameterValue, ApsReturnValue returnValue)
+ {
+ string filename = string.Empty;
+ filename = "UpdateTaskFail.sql";
+
+ // Get SQL query from file.
+ this.SetSqlByFile2(filename);
+
+ // Set SQL parameter values
+ this.SetParameter("P1", parameterValue.TaskId);
+ this.SetParameter("P2", parameterValue.CompletionDateTime);
+ this.SetParameter("P3", parameterValue.StatusId);
+ this.SetParameter("P4", parameterValue.ExceptionInfo);
+
+ // Execute SQL query
+ returnValue.Obj = this.ExecInsUpDel_NonQuery();
+ }
+
+ #endregion
+
+ #region UpdateTaskSuccess
+
+ ///
+ /// Updates information in the database that the asynchronous task is completed
+ ///
+ /// Asynchronous Parameter Values
+ /// Asynchronous Return Values
+ public void UpdateTaskSuccess(ApsParameterValue parameterValue, ApsReturnValue returnValue)
+ {
+ string filename = string.Empty;
+ filename = "UpdateTaskSuccess.sql";
+
+ // Get SQL query from file.
+ this.SetSqlByFile2(filename);
+
+ // Set SQL parameter values
+ this.SetParameter("P1", parameterValue.TaskId);
+ this.SetParameter("P2", parameterValue.CompletionDateTime);
+ this.SetParameter("P3", parameterValue.ProgressRate);
+ this.SetParameter("P4", parameterValue.StatusId);
+
+ // Execute SQL query
+ returnValue.Obj = this.ExecInsUpDel_NonQuery();
+ }
+
+ #endregion
+
+ #region UpdateTaskProgress
+
+ ///
+ /// Updates progress rate of the asynchronous task in the database.
+ ///
+ /// Asynchronous Parameter Values
+ /// Asynchronous Return Values
+ public void UpdateTaskProgress(ApsParameterValue parameterValue, ApsReturnValue returnValue)
+ {
+ string filename = string.Empty;
+ filename = "UpdateTaskProgress.sql";
+
+ // Get SQL query from file.
+ this.SetSqlByFile2(filename);
+
+ // Set SQL parameter values
+ this.SetParameter("P1", parameterValue.TaskId);
+ this.SetParameter("P2", parameterValue.ProgressRate);
+
+ // Execute SQL query
+ returnValue.Obj = this.ExecInsUpDel_NonQuery();
+ }
+
+ #endregion
+
+ #region UpdateTaskCommand
+
+ ///
+ /// Updates command value information of a selected asynchronous task
+ ///
+ /// Asynchronous Parameter Values
+ /// Asynchronous Return Values
+ public void UpdateTaskCommand(ApsParameterValue parameterValue, ApsReturnValue returnValue)
+ {
+ string filename = string.Empty;
+ filename = "UpdateTaskCommand.sql";
+
+ // Get SQL query from file.
+ this.SetSqlByFile2(filename);
+
+ // Set SQL parameter values
+ this.SetParameter("P1", parameterValue.TaskId);
+ this.SetParameter("P2", parameterValue.CommandId);
+
+ // Execute SQL query
+ returnValue.Obj = this.ExecInsUpDel_NonQuery();
+ }
+
+ #endregion
+
+ #region StopAllTask
+
+ ///
+ /// Set stop command for all running asynchronous task.
+ ///
+ /// Asynchronous Parameter Values
+ /// Asynchronous Return Values
+ public void StopAllTask(ApsParameterValue parameterValue, ApsReturnValue returnValue)
+ {
+ string filename = string.Empty;
+ filename = "StopAllTask.sql";
+
+ // Get SQL query from file.
+ this.SetSqlByFile2(filename);
+
+ // Set SQL parameter values
+ this.SetParameter("P1", parameterValue.StatusId);
+ this.SetParameter("P2", parameterValue.CommandId);
+
+ // Execute SQL query
+ returnValue.Obj = this.ExecInsUpDel_NonQuery();
+ }
+
+ #endregion
+
+ #endregion
+
+ #region Select
+
+ #region SelectCommand
+
+ ///
+ /// Selects user command from database
+ ///
+ /// Asynchronous Parameter Values
+ /// Asynchronous Return Values
+ public void SelectCommand(ApsParameterValue parameterValue, ApsReturnValue returnValue)
+ {
+ string filename = string.Empty;
+ filename = "SelectCommand.sql";
+
+ // Get SQL query from file.
+ this.SetSqlByFile2(filename);
+
+ // Set SQL parameter values
+ this.SetParameter("P1", parameterValue.TaskId);
+
+ // Execute SQL query
+ returnValue.Obj = this.ExecSelectScalar();
+ }
+
+ #endregion
+
+ #region SelectTask
+
+ ///
+ /// To get Asynchronous Task from the database
+ ///
+ ///
+ ///
+ public void SelectTask(ApsParameterValue parameterValue, ApsReturnValue returnValue)
+ {
+ string filename = string.Empty;
+ filename = "SelectTask.sql";
+
+ // Get SQL query from file.
+ this.SetSqlByFile2(filename);
+
+ // Set SQL parameter values
+ this.SetParameter("P1", parameterValue.RegistrationDateTime);
+ this.SetParameter("P2", parameterValue.NumberOfRetries);
+ this.SetParameter("P3", (int)AsyncStatus.Register);
+ this.SetParameter("P4", (int)AsyncStatus.AbnormalEnd);
+ this.SetParameter("P7", parameterValue.CompletionDateTime);
+
+ DataTable dt = new DataTable();
+
+ // Get Asynchronous Task from the database
+ this.ExecSelectFill_DT(dt);
+ returnValue.Obj = dt;
+ }
+
+ #endregion
+
+ #endregion
+ }
+}
diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceParameterValue.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsParameterValue.cs
similarity index 51%
rename from root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceParameterValue.cs
rename to root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsParameterValue.cs
index d18d6bd..d685002 100644
--- a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceParameterValue.cs
+++ b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsParameterValue.cs
@@ -19,13 +19,15 @@
#endregion
//**********************************************************************************
-//* クラス名 :AsyncProcessingServiceParameterValue
-//* クラス日本語名 :AsyncProcessingServiceParameterValue
+//* クラス名 :ApsParameterValue
+//* クラス日本語名 :ApsParameterValue
//*
//* 日時 更新者 内容
//* ---------- ---------------- -------------------------------------------------
//* 11/28/2014 Supragyan Paramter Value class for Asynchronous Processing Service
//* 04/15/2015 Sandeep Changed datatype of ProgressRate to decimal.
+//* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps)
+//* 2018/08/24 西野 大介 列挙型と列挙型処理クラスの移動
//**********************************************************************************
using System;
@@ -39,7 +41,7 @@ namespace Touryo.Infrastructure.Business.AsyncProcessingService
///
/// Paramter Value class for Asynchronous Processing Service
///
- public class AsyncProcessingServiceParameterValue : MyParameterValue
+ public class ApsParameterValue : MyParameterValue
{
/// 汎用エリア
public object Obj;
@@ -86,109 +88,13 @@ public class AsyncProcessingServiceParameterValue : MyParameterValue
#region コンストラクタ
/// コンストラクタ
- public AsyncProcessingServiceParameterValue(string screenId, string controlId, string methodName, string actionType, MyUserInfo user)
+ public ApsParameterValue(
+ string screenId, string controlId, string methodName, string actionType, MyUserInfo user)
: base(screenId, controlId, methodName, actionType, user)
{
// Baseのコンストラクタに引数を渡すために必要。
}
#endregion
-
- #region AsyncStatus
-
- ///
- /// AsyncStatus Enum for storing all status
- ///
- public enum AsyncStatus
- {
- /// Register
- [StringValue("Register")]
- Register = 1,
-
- /// Processing
- [StringValue("Processing")]
- Processing,
-
- /// End
- [StringValue("End")]
- End,
-
- /// AbnormalEnd
- [StringValue("AbnormalEnd")]
- AbnormalEnd,
-
- /// Abort
- [StringValue("Abort")]
- Abort,
- }
-
- #endregion
-
- #region AsyncCommand
-
- ///
- /// AsyncCommand Enum for storing command values
- ///
- public enum AsyncCommand
- {
- /// Stop
- [StringValue("Stop")]
- Stop = 1,
-
- /// Abort
- [StringValue("Abort")]
- Abort,
- }
-
- #endregion
- }
-
- ///
- /// To get the string value
- ///
- public class StringValueAttribute : System.Attribute
- {
- private string _value;
-
- /// StringValueAttribute
- /// value
- public StringValueAttribute(string value)
- {
- _value = value;
- }
-
- /// Value
- public string Value
- {
- get { return _value; }
- }
- }
-
- ///
- /// Class that holds the Enum values string
- ///
- public class StringEnum
- {
- ///
- /// To get the string value from Enum value
- ///
- /// Enum value
- /// String value of Enum
- public static string GetStringValue(Enum value)
- {
- string output = null;
- Type type = value.GetType();
-
- // Gets the 'StringValueAttribute'
- FieldInfo fi = type.GetField(value.ToString());
- StringValueAttribute[] attrs =
- fi.GetCustomAttributes(typeof(StringValueAttribute),
- false) as StringValueAttribute[];
- if (attrs.Length > 0)
- {
- output = attrs[0].Value;
- }
- return output;
- }
}
}
diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceReturnValue.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsReturnValue.cs
similarity index 92%
rename from root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceReturnValue.cs
rename to root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsReturnValue.cs
index cfd6ae2..5b45b57 100644
--- a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceReturnValue.cs
+++ b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsReturnValue.cs
@@ -19,13 +19,14 @@
#endregion
//**********************************************************************************
-//* クラス名 :AsyncProcessingServiceReturnValue
-//* クラス日本語名 :AsyncProcessingServiceReturnValue
+//* クラス名 :ApsReturnValue
+//* クラス日本語名 :ApsReturnValue
//*
//* 日時 更新者 内容
//* ---------- ---------------- -------------------------------------------------
//* 11/28/2014 Supragyan Paramter Return Value class for Asynchronous Processing Service
//* 04/15/2015 Sandeep Changed datatype of ProgressRate to decimal.
+//* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps)
//**********************************************************************************
using System;
@@ -33,11 +34,10 @@
namespace Touryo.Infrastructure.Business.AsyncProcessingService
{
-
///
/// Paramter Return Value class for Asynchronous Processing Service
///
- public class AsyncProcessingServiceReturnValue : MyReturnValue
+ public class ApsReturnValue : MyReturnValue
{
/// 汎用エリア
public object Obj;
@@ -81,5 +81,4 @@ public class AsyncProcessingServiceReturnValue : MyReturnValue
/// ExceptionInfo
public string ExceptionInfo;
}
-
}
diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsUtility.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsUtility.cs
new file mode 100644
index 0000000..f7d3bea
--- /dev/null
+++ b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsUtility.cs
@@ -0,0 +1,115 @@
+//**********************************************************************************
+//* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
+//**********************************************************************************
+
+#region Apache License
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+//**********************************************************************************
+//* クラス名 :ApsUtility
+//* クラス日本語名 :ApsUtility
+//*
+//* 日時 更新者 内容
+//* ---------- ---------------- -------------------------------------------------
+//* 2018/08/24 西野 大介 新規作成(Utilityメソッドを部品化)
+//**********************************************************************************
+
+using Touryo.Infrastructure.Business.Util;
+using Touryo.Infrastructure.Public.Db;
+
+namespace Touryo.Infrastructure.Business.AsyncProcessingService
+{
+ /// ApsUtility
+ public class ApsUtility
+ {
+ /// Get command information from database.
+ /// asynchronous task id
+ /// asynchronous return value
+ /// BaseDam
+ public static void GetCommandValue(int taskID, ApsReturnValue returnValue, BaseDam dam)
+ {
+ // Sets parameters of AsyncProcessingServiceParameterValue to get command value.
+ ApsParameterValue parameterValue = new ApsParameterValue(
+ "AsyncProcessingService", "SelectCommand", "SelectCommand", "SQL",
+ new MyUserInfo("AsyncProcessingService", "AsyncProcessingService"));
+
+ parameterValue.TaskId = taskID;
+
+ // Calls data access part of asynchronous processing service.
+ ApsLayerD layerD = new ApsLayerD(dam);
+ layerD.SelectCommand(parameterValue, returnValue);
+ returnValue.CommandId = (int)returnValue.Obj;
+ }
+
+ ///
+ /// Resumes asynchronous process in the middle of the processing.
+ ///
+ /// Task ID
+ /// asynchronous return value
+ /// BaseDam
+ public static void ResumeProcessing(int taskID, ApsReturnValue returnValue, BaseDam dam)
+ {
+ // Reset the command of selected task.
+ ApsUtility.UpdateTaskCommand(taskID, 0, returnValue, dam);
+ }
+
+ ///
+ /// Updates the progress rate in the database.
+ ///
+ /// asynchronous task id
+ /// ApsReturnValue
+ /// progress rate
+ /// BaseDam
+ public static void UpdateProgressRate(int taskID, ApsReturnValue returnValue, decimal progressRate, BaseDam dam)
+ {
+ // Sets parameters of AsyncProcessingServiceParameterValue to Update progress rate
+ ApsParameterValue parameterValue = new ApsParameterValue(
+ "AsyncProcessingService", "UpdateTaskProgress", "UpdateTaskProgress", "SQL",
+ new MyUserInfo("AsyncProcessingService", "AsyncProcessingService"));
+
+ parameterValue.TaskId = taskID;
+ parameterValue.ProgressRate = progressRate;
+
+ // Calls data access part of asynchronous processing service.
+ ApsLayerD layerD = new ApsLayerD(dam);
+ layerD.UpdateTaskProgress(parameterValue, returnValue);
+ }
+
+ ///
+ /// Updates the command of selected task
+ ///
+ /// Task ID
+ /// Command ID
+ /// user parameter value
+ /// BaseDam
+ public static void UpdateTaskCommand(int taskID, int commandId, ApsReturnValue returnValue, BaseDam dam)
+ {
+ // Sets parameters of AsyncProcessingServiceParameterValue to update the command of selected task.
+ ApsParameterValue parameterValue = new ApsParameterValue(
+ "AsyncProcessingService", "UpdateTaskCommand", "UpdateTaskCommand", "SQL",
+ new MyUserInfo("AsyncProcessingService", "AsyncProcessingService"));
+
+ parameterValue.TaskId = taskID;
+ parameterValue.CommandId = commandId;
+
+ // Calls data access part of asynchronous processing service.
+ ApsLayerD layerD = new ApsLayerD(dam);
+ layerD.UpdateTaskCommand(parameterValue, returnValue);
+ }
+
+
+ }
+}
diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerB.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerB.cs
deleted file mode 100644
index 4afc7e0..0000000
--- a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerB.cs
+++ /dev/null
@@ -1,262 +0,0 @@
-//**********************************************************************************
-//* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
-//**********************************************************************************
-
-#region Apache License
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-//**********************************************************************************
-//* クラス名 :LayerB
-//* クラス日本語名 :LayerB
-//*
-//* 日時 更新者 内容
-//* ---------- ---------------- -------------------------------------------------
-//* 11/28/2014 Supragyan Created LayerB class for AsyncProcessing Service
-//* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service
-//* 04/15/2015 Sandeep Did code modification of insert, update and select for AsyncProcessing Service
-//* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task
-//* Modified code to reset Exception information, before starting asynchronous task
-//* 06/26/2015 Sandeep Implemented code to get commandID in the SelectTask method,
-//* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state
-//* 06/01/2016 Sandeep Implemented method to test the connection of specified database
-//**********************************************************************************
-
-using System;
-using System.Data;
-
-using Touryo.Infrastructure.Business.Business;
-
-namespace Touryo.Infrastructure.Business.AsyncProcessingService
-{
- #region LayerB
-
- ///
- /// LayerB class for AsyncProcessing Service
- ///
- public class LayerB : MyFcBaseLogic
- {
- #region Insert
-
- ///
- /// Inserts Async Parameter values to Database through LayerD
- ///
- ///
- public void UOC_InsertTask(AsyncProcessingServiceParameterValue asyncParameterValue)
- {
- // 戻り値クラスを生成して、事前に戻り値に設定しておく。
- AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue();
- this.ReturnValue = asyncReturnValue;
-
- LayerD myDao = new LayerD(this.GetDam());
- myDao.InsertTask(asyncParameterValue, asyncReturnValue);
- }
-
- #endregion
-
- #region Update
-
- #region UpdateTaskStart
-
- ///
- /// Updates information in the database that the asynchronous task is started
- ///
- /// Asynchronous Parameter Values
- private void UOC_UpdateTaskStart(AsyncProcessingServiceParameterValue asyncParameterValue)
- {
- AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue();
- this.ReturnValue = asyncReturnValue;
-
- LayerD myDao = new LayerD(this.GetDam());
- myDao.UpdateTaskStart(asyncParameterValue, asyncReturnValue);
- }
-
- #endregion
-
- #region UpdateTaskRetry
-
- ///
- /// Updates information in the database that the asynchronous task is failed and can be retried later
- ///
- /// Asynchronous Parameter Values
- private void UOC_UpdateTaskRetry(AsyncProcessingServiceParameterValue asyncParameterValue)
- {
- AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue();
- this.ReturnValue = asyncReturnValue;
-
- LayerD myDao = new LayerD(this.GetDam());
- myDao.UpdateTaskRetry(asyncParameterValue, asyncReturnValue);
- }
-
- #endregion
-
- #region UpdateTaskFail
-
- ///
- /// Updates information in the database that the asynchronous task is failed and abort this task [status=Abort]
- ///
- /// Asynchronous Parameter Values
- private void UOC_UpdateTaskFail(AsyncProcessingServiceParameterValue asyncParameterValue)
- {
- AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue();
- this.ReturnValue = asyncReturnValue;
-
- LayerD myDao = new LayerD(this.GetDam());
- myDao.UpdateTaskFail(asyncParameterValue, asyncReturnValue);
- }
-
- #endregion
-
- #region UpdateTaskSuccess
-
- ///
- /// Updates information in the database that the asynchronous task is completed
- ///
- /// Asynchronous Parameter Values
- private void UOC_UpdateTaskSuccess(AsyncProcessingServiceParameterValue asyncParameterValue)
- {
- AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue();
- this.ReturnValue = asyncReturnValue;
-
- LayerD myDao = new LayerD(this.GetDam());
- myDao.UpdateTaskSuccess(asyncParameterValue, asyncReturnValue);
- }
-
- #endregion
-
- #region UpdateTaskProgress
-
- ///
- /// Updates progress rate of the asynchronous task in the database.
- ///
- /// Asynchronous Parameter Values
- private void UOC_UpdateTaskProgress(AsyncProcessingServiceParameterValue asyncParameterValue)
- {
- AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue();
- this.ReturnValue = asyncReturnValue;
-
- LayerD myDao = new LayerD(this.GetDam());
- myDao.UpdateTaskProgress(asyncParameterValue, asyncReturnValue);
- }
-
- #endregion
-
- #region UpdateTaskCommand
-
- ///
- /// Updates command value information of a selected asynchronous task
- ///
- /// Asynchronous Parameter Values
- private void UOC_UpdateTaskCommand(AsyncProcessingServiceParameterValue asyncParameterValue)
- {
- AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue();
- this.ReturnValue = asyncReturnValue;
-
- LayerD myDao = new LayerD(this.GetDam());
- myDao.UpdateTaskCommand(asyncParameterValue, asyncReturnValue);
- }
-
- #endregion
-
- #region StopAllTask
-
- ///
- /// Set stop command for all running asynchronous task
- ///
- /// Asynchronous Parameter Values
- private void UOC_StopAllTask(AsyncProcessingServiceParameterValue asyncParameterValue)
- {
- AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue();
- this.ReturnValue = asyncReturnValue;
-
- LayerD myDao = new LayerD(this.GetDam());
- myDao.StopAllTask(asyncParameterValue, asyncReturnValue);
- }
-
- #endregion
-
- #endregion
-
- #region Select
-
- #region SelectCommand
-
- ///
- /// Selects user command from Database through LayerD
- ///
- ///
- private void UOC_SelectCommand(AsyncProcessingServiceParameterValue asyncParameterValue)
- {
- AsyncProcessingServiceReturnValue asyncReturnValue = new AsyncProcessingServiceReturnValue();
- this.ReturnValue = asyncReturnValue;
-
- LayerD myDao = new LayerD(this.GetDam());
- myDao.SelectCommand(asyncParameterValue, asyncReturnValue);
- }
-
- #endregion
-
- #region SelectTask
-
- ///
- /// Selects Asynchronous task from LayerD
- ///
- /// Async Parameter Value
- 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"]);
- }
- }
- }
-
- #endregion
-
- #endregion
-
- #region TestConnection
-
- ///
- /// Tests the connection with the specified database
- ///
- /// Async Parameter Value
- private void UOC_TestConnection(AsyncProcessingServiceParameterValue asyncParameterValue)
- {
- LayerD myDao = new LayerD(this.GetDam());
- }
-
- #endregion
- }
-
- #endregion
-}
diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerD.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerD.cs
deleted file mode 100644
index d990a2e..0000000
--- a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerD.cs
+++ /dev/null
@@ -1,368 +0,0 @@
-//**********************************************************************************
-//* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
-//**********************************************************************************
-
-#region Apache License
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-//**********************************************************************************
-//* クラス名 :LayerD
-//* クラス日本語名 :LayerD
-//*
-//* 日時 更新者 内容
-//* ---------- ---------------- -------------------------------------------------
-//* 11/28/2014 Supragyan Created LayerD class for AsyncProcessing Service
-//* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service
-//* 04/14/2015 Sandeep Did code modification of update and select asynchronous task
-//* 04/14/2015 Sandeep Did code implementation of SetSqlByFile3 to access the SQL from embedded resource
-//* 05/28/2015 Sandeep Did code implementation to update Exception information to the database
-//* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task
-//* Modified code to reset Exception information, before starting asynchronous task
-//* 06/26/2015 Sandeep Removed the where condition command <> 'Abort' from the SelectTask asynchronous task,
-//* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state
-//**********************************************************************************
-
-using System;
-using System.Data;
-using System.Text;
-
-using Touryo.Infrastructure.Business.Dao;
-using Touryo.Infrastructure.Public.Db;
-using Touryo.Infrastructure.Public.IO;
-using Touryo.Infrastructure.Public.Util;
-
-namespace Touryo.Infrastructure.Business.AsyncProcessingService
-{
- ///
- /// LayerD class for AsyncProcessing Service
- ///
- public class LayerD : MyBaseDao
- {
- /// AsyncProcessingService用B層
- /// dam
- public LayerD(BaseDam dam) : base(dam) { }
-
- #region SetSqlByFile3
-
- /////
- ///// Get SQL query from the embedded resource assembly
- /////
- //public void SetSqlByFile3(string filename)
- //{
- // // SQLファイルのEncoding情報の取得
- // string sqlEncoding = GetConfigParameter.GetConfigValue(PubLiteral.SQL_ENCODING);
-
- // if (string.IsNullOrEmpty(sqlEncoding))
- // {
- // // デフォルト:UTF-8
- // sqlEncoding = "utf-8";
- // }
-
- // string assemblyString = "Business";
- // string assemblyNameSpace = "Touryo.Infrastructure.Business.AsyncProcessingService";
- // string loadFileName = assemblyNameSpace + "." + filename;
-
- // // Get SQL query from embedded resource file.
- // string commandText = EmbeddedResourceLoader.LoadAsString(assemblyString, loadFileName, Encoding.GetEncoding(sqlEncoding));
-
- // // Set sql command as text
- // this.SetSqlByCommand(commandText);
- //}
-
- #endregion
-
- #region Insert
-
- ///
- /// Inserts async parameter values to database
- ///
- ///
- ///
- public void InsertTask(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue)
- {
- string filename = string.Empty;
- filename = "AsyncProcessingServiceInsert.sql";
-
- // Get SQL query from file.
- this.SetSqlByFile2(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();
- }
-
- #endregion
-
- #region Update
-
- #region UpdateTaskStart
-
- ///
- /// Updates information in the database that the asynchronous task is started
- ///
- /// Asynchronous Parameter Values
- /// Asynchronous Return Values
- public void UpdateTaskStart(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue)
- {
- string filename = string.Empty;
- filename = "UpdateTaskStart.sql";
-
- // Get SQL query from file.
- this.SetSqlByFile2(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();
- }
-
- #endregion
-
- #region UpdateTaskRetry
-
- ///
- /// Updates information in the database that the asynchronous task is failed and can be retried later
- ///
- /// Asynchronous Parameter Values
- /// Asynchronous Return Values
- public void UpdateTaskRetry(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue)
- {
- string filename = string.Empty;
- filename = "UpdateTaskRetry.sql";
-
- // Get SQL query from file.
- this.SetSqlByFile2(filename);
-
- // Set SQL parameter values
- this.SetParameter("P1", asyncParameterValue.TaskId);
- this.SetParameter("P2", asyncParameterValue.NumberOfRetries);
- this.SetParameter("P3", asyncParameterValue.CompletionDateTime);
- this.SetParameter("P4", asyncParameterValue.StatusId);
- this.SetParameter("P5", asyncParameterValue.ExceptionInfo);
-
- // Execute SQL query
- asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery();
- }
-
- #endregion
-
- #region UpdateTaskFail
-
- ///
- /// Updates information in the database that the asynchronous task is failed and abort this task [status=Abort]
- ///
- /// Asynchronous Parameter Values
- /// Asynchronous Return Values
- public void UpdateTaskFail(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue)
- {
- string filename = string.Empty;
- filename = "UpdateTaskFail.sql";
-
- // Get SQL query from file.
- this.SetSqlByFile2(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();
- }
-
- #endregion
-
- #region UpdateTaskSuccess
-
- ///
- /// Updates information in the database that the asynchronous task is completed
- ///
- /// Asynchronous Parameter Values
- /// Asynchronous Return Values
- public void UpdateTaskSuccess(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue)
- {
- string filename = string.Empty;
- filename = "UpdateTaskSuccess.sql";
-
- // Get SQL query from file.
- this.SetSqlByFile2(filename);
-
- // Set SQL parameter values
- this.SetParameter("P1", asyncParameterValue.TaskId);
- this.SetParameter("P2", asyncParameterValue.CompletionDateTime);
- this.SetParameter("P3", asyncParameterValue.ProgressRate);
- this.SetParameter("P4", asyncParameterValue.StatusId);
-
- // Execute SQL query
- asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery();
- }
-
- #endregion
-
- #region UpdateTaskProgress
-
- ///
- /// Updates progress rate of the asynchronous task in the database.
- ///
- /// Asynchronous Parameter Values
- /// Asynchronous Return Values
- public void UpdateTaskProgress(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue)
- {
- string filename = string.Empty;
- filename = "UpdateTaskProgress.sql";
-
- // Get SQL query from file.
- this.SetSqlByFile2(filename);
-
- // Set SQL parameter values
- this.SetParameter("P1", asyncParameterValue.TaskId);
- this.SetParameter("P2", asyncParameterValue.ProgressRate);
-
- // Execute SQL query
- asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery();
- }
-
- #endregion
-
- #region UpdateTaskCommand
-
- ///
- /// Updates command value information of a selected asynchronous task
- ///
- /// Asynchronous Parameter Values
- /// Asynchronous Return Values
- public void UpdateTaskCommand(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue)
- {
- string filename = string.Empty;
- filename = "UpdateTaskCommand.sql";
-
- // Get SQL query from file.
- this.SetSqlByFile2(filename);
-
- // Set SQL parameter values
- this.SetParameter("P1", asyncParameterValue.TaskId);
- this.SetParameter("P2", asyncParameterValue.CommandId);
-
- // Execute SQL query
- asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery();
- }
-
- #endregion
-
- #region StopAllTask
-
- ///
- /// Set stop command for all running asynchronous task.
- ///
- /// Asynchronous Parameter Values
- /// Asynchronous Return Values
- public void StopAllTask(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue)
- {
- string filename = string.Empty;
- filename = "StopAllTask.sql";
-
- // Get SQL query from file.
- this.SetSqlByFile2(filename);
-
- // Set SQL parameter values
- this.SetParameter("P1", asyncParameterValue.StatusId);
- this.SetParameter("P2", asyncParameterValue.CommandId);
-
- // Execute SQL query
- asyncReturnValue.Obj = this.ExecInsUpDel_NonQuery();
- }
-
- #endregion
-
- #endregion
-
- #region Select
-
- #region SelectCommand
-
- ///
- /// Selects user command from database
- ///
- /// Asynchronous Parameter Values
- /// Asynchronous Return Values
- public void SelectCommand(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue)
- {
- string filename = string.Empty;
- filename = "SelectCommand.sql";
-
- // Get SQL query from file.
- this.SetSqlByFile2(filename);
-
- // Set SQL parameter values
- this.SetParameter("P1", asyncParameterValue.TaskId);
-
- // Execute SQL query
- asyncReturnValue.Obj = this.ExecSelectScalar();
- }
-
- #endregion
-
- #region SelectTask
-
- ///
- /// To get Asynchronous Task from the database
- ///
- ///
- ///
- public void SelectTask(AsyncProcessingServiceParameterValue asyncParameterValue, AsyncProcessingServiceReturnValue asyncReturnValue)
- {
- string filename = string.Empty;
- filename = "SelectTask.sql";
-
- // Get SQL query from file.
- this.SetSqlByFile2(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;
- }
-
- #endregion
-
- #endregion
- }
-}
diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/MyApsBaseLogic.cs b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/MyApsBaseLogic.cs
index aa15e1d..9d9a7a9 100644
--- a/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/MyApsBaseLogic.cs
+++ b/root/programs/CS/Frameworks/Infrastructure/Business/AsyncProcessingService/MyApsBaseLogic.cs
@@ -195,12 +195,12 @@ protected override void UOC_ConnectionOpen(
if (parameterValue.ActionType.Split('%')[0] == "SQL")
{
- // SQL Server / SQL Client用のDamを生成
- damABT = new DamSqlSvr();
- damAMT = new DamSqlSvr();
+ // SQL Server / SQL Client用のDamを生成
+ damABT = new DamSqlSvr();
+ damAMT = new DamSqlSvr();
- // 接続文字列をロード
- connstring = GetConfigParameter.GetConnectionString("ConnectionString_SQL");
+ // 接続文字列をロード
+ connstring = GetConfigParameter.GetConnectionString("ConnectionString_SQL");
}
else if (parameterValue.ActionType.Split('%')[0] == "OLE")
{
@@ -662,7 +662,7 @@ protected override void UOC_ABEND(BaseParameterValue parameterValue, ref BaseRet
// Log4Netへログ出力
LogIF.ErrorLog("ACCESS", strLogMessage);
-
+
// スタックトレースを保って InnerException を throw
ExceptionDispatchInfo.Capture(ex).Throw();
}
diff --git a/root/programs/CS/Frameworks/Infrastructure/Business/Business.csproj b/root/programs/CS/Frameworks/Infrastructure/Business/Business.csproj
index 8beeba9..a76d6a6 100644
--- a/root/programs/CS/Frameworks/Infrastructure/Business/Business.csproj
+++ b/root/programs/CS/Frameworks/Infrastructure/Business/Business.csproj
@@ -63,32 +63,116 @@
false
-
- ..\..\..\..\..\..\..\OpenTouryo\root\programs\CS\Frameworks\Infrastructure\Build\OpenTouryo.DamManagedOdp.dll
+
+ ..\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll
+ True
-
- ..\..\..\..\..\..\..\OpenTouryo\root\programs\CS\Frameworks\Infrastructure\Build\OpenTouryo.DamMySQL.dll
+
+ ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll
+ True
-
- ..\..\..\..\..\..\..\OpenTouryo\root\programs\CS\Frameworks\Infrastructure\Build\OpenTouryo.DamPstGrS.dll
+
+ ..\packages\Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll
+ True
-
- ..\..\..\..\..\..\..\OpenTouryo\root\programs\CS\Frameworks\Infrastructure\Build\OpenTouryo.Framework.dll
+
+ ..\packages\Microsoft.Owin.Security.3.1.0\lib\net45\Microsoft.Owin.Security.dll
+ True
-
- ..\..\..\..\..\..\..\OpenTouryo\root\programs\CS\Frameworks\Infrastructure\Build\OpenTouryo.Public.dll
+
+ ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll
+ True
+
+
+ ..\packages\MySql.Data.6.9.12\lib\net45\MySql.Data.dll
+ True
+
+
+ ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll
+ True
+
+
+ ..\packages\Npgsql.3.2.5\lib\net451\Npgsql.dll
+ True
+
+
+ ..\packages\Touryo.Infrastructure.Public.Db.DamManagedOdp.2.3.0\lib\net46\OpenTouryo.DamManagedOdp.dll
+ True
+
+
+ ..\packages\Touryo.Infrastructure.Public.Db.DamMySQL.2.3.0\lib\net46\OpenTouryo.DamMySQL.dll
+ True
+
+
+ ..\packages\Touryo.Infrastructure.Public.Db.DamPstGrS.2.3.0\lib\net46\OpenTouryo.DamPstGrS.dll
+ True
+
+
+ ..\packages\Touryo.Infrastructure.Framework.2.3.0\lib\net46\OpenTouryo.Framework.dll
+ True
+
+
+ ..\packages\Touryo.Infrastructure.Public.2.3.0\lib\net46\OpenTouryo.Public.dll
+ True
+
+
+ ..\packages\Oracle.ManagedDataAccess.12.2.1100\lib\net40\Oracle.ManagedDataAccess.dll
+ True
+
+
+ ..\packages\Owin.1.0\lib\net40\Owin.dll
+ True
+
+
+ ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll
+ True
+
+
+ ..\packages\System.Threading.Tasks.Extensions.4.3.0\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll
+ True
+
+
+
+ ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll
+ True
+
+
+ ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll
+ True
+
+
+ ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll
+ True
+
+
+ ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll
+ True
+
+
+ ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll
+ True
+
+
+ ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll
+ True
+
+
+ ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll
+ True
+
-
-
-
-
+
+
+
+
+
@@ -111,11 +195,10 @@
+
-
-
@@ -149,6 +232,10 @@
MyBusinessSystemExceptionMessageResource.Designer.cs
+
+
+
+
@@ -13,15 +13,15 @@
-
+
-
+
-
+
diff --git a/root/programs/CS/Samples/AsyncSvc_sample/TestAsyncSvc_Sample/packages.config b/root/programs/CS/Samples/AsyncSvc_sample/TestAsyncSvc_Sample/packages.config
new file mode 100644
index 0000000..bfe8416
--- /dev/null
+++ b/root/programs/CS/Samples/AsyncSvc_sample/TestAsyncSvc_Sample/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/root/programs/VB/6_CopyToService.bat b/root/programs/VB/6_CopyToService.bat
new file mode 100644
index 0000000..8d175b1
--- /dev/null
+++ b/root/programs/VB/6_CopyToService.bat
@@ -0,0 +1 @@
+xcopy /E /Y "Samples\AsyncSvc_sample\AsyncSvc_sample\bin\Debug" "..\CS\Frameworks\Infrastructure\AsyncProcessingService\bin\Debug\"
\ No newline at end of file
diff --git a/root/programs/VB/7_SubmitTask.bat b/root/programs/VB/7_SubmitTask.bat
new file mode 100644
index 0000000..d4628ce
--- /dev/null
+++ b/root/programs/VB/7_SubmitTask.bat
@@ -0,0 +1 @@
+call "Samples\AsyncSvc_sample\TestAsyncSvc_Sample\bin\Debug\TestAsyncSvc_Sample.exe"
\ No newline at end of file
diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerB.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerB.vb
new file mode 100644
index 0000000..89f7784
--- /dev/null
+++ b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerB.vb
@@ -0,0 +1,246 @@
+'**********************************************************************************
+'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
+'**********************************************************************************
+
+#Region "Apache License"
+'
+' Licensed under the Apache License, Version 2.0 (the "License");
+' you may not use this file except in compliance with the License.
+' You may obtain a copy of the License at
+'
+' http://www.apache.org/licenses/LICENSE-2.0
+'
+' Unless required by applicable law or agreed to in writing, software
+' distributed under the License is distributed on an "AS IS" BASIS,
+' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+' See the License for the specific language governing permissions and
+' limitations under the License.
+'
+#End Region
+
+'**********************************************************************************
+'* クラス名 :LayerB
+'* クラス日本語名 :LayerB
+'*
+'* 日時 更新者 内容
+'* ---------- ---------------- -------------------------------------------------
+'* 11/28/2014 Supragyan Created LayerB class for AsyncProcessing Service
+'* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service
+'* 04/15/2015 Sandeep Did code modification of insert, update and select for AsyncProcessing Service
+'* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task
+'* Modified code to reset Exception information, before starting asynchronous task
+'* 06/26/2015 Sandeep Implemented code to get commandID in the SelectTask method,
+'* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state
+'* 06/01/2016 Sandeep Implemented method to test the connection of specified database
+'* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps)
+'**********************************************************************************
+
+Imports System
+Imports System.Data
+
+Imports Touryo.Infrastructure.Business.Business
+
+Namespace Touryo.Infrastructure.Business.AsyncProcessingService
+
+ '''
+ ''' LayerB class for AsyncProcessing Service
+ '''
+ Public Class ApsLayerB
+ Inherits MyFcBaseLogic
+ #Region "Insert"
+
+ '''
+ ''' Inserts Async Parameter values to Database through LayerD
+ '''
+ '''
+ Public Sub UOC_InsertTask(parameterValue As ApsParameterValue)
+ ' 戻り値クラスを生成して、事前に戻り値に設定しておく。
+ Dim returnValue As New ApsReturnValue()
+ Me.ReturnValue = returnValue
+
+ Dim layerD As New ApsLayerD(Me.GetDam())
+ layerD.InsertTask(parameterValue, returnValue)
+ End Sub
+
+ #End Region
+
+ #Region "Update"
+
+ #Region "UpdateTaskStart"
+
+ '''
+ ''' Updates information in the database that the asynchronous task is started
+ '''
+ ''' Asynchronous Parameter Values
+ Private Sub UOC_UpdateTaskStart(parameterValue As ApsParameterValue)
+ Dim returnValue As New ApsReturnValue()
+ Me.ReturnValue = returnValue
+
+ Dim layerD As New ApsLayerD(Me.GetDam())
+ layerD.UpdateTaskStart(parameterValue, returnValue)
+ End Sub
+
+ #End Region
+
+ #Region "UpdateTaskRetry"
+
+ '''
+ ''' Updates information in the database that the asynchronous task is failed and can be retried later
+ '''
+ ''' Asynchronous Parameter Values
+ Private Sub UOC_UpdateTaskRetry(parameterValue As ApsParameterValue)
+ Dim returnValue As New ApsReturnValue()
+ Me.ReturnValue = returnValue
+
+ Dim layerD As New ApsLayerD(Me.GetDam())
+ layerD.UpdateTaskRetry(parameterValue, returnValue)
+ End Sub
+
+ #End Region
+
+ #Region "UpdateTaskFail"
+
+ '''
+ ''' Updates information in the database that the asynchronous task is failed and abort this task [status=Abort]
+ '''
+ ''' Asynchronous Parameter Values
+ Private Sub UOC_UpdateTaskFail(parameterValue As ApsParameterValue)
+ Dim returnValue As New ApsReturnValue()
+ Me.ReturnValue = returnValue
+
+ Dim layerD As New ApsLayerD(Me.GetDam())
+ layerD.UpdateTaskFail(parameterValue, returnValue)
+ End Sub
+
+ #End Region
+
+ #Region "UpdateTaskSuccess"
+
+ '''
+ ''' Updates information in the database that the asynchronous task is completed
+ '''
+ ''' Asynchronous Parameter Values
+ Private Sub UOC_UpdateTaskSuccess(parameterValue As ApsParameterValue)
+ Dim returnValue As New ApsReturnValue()
+ Me.ReturnValue = returnValue
+
+ Dim layerD As New ApsLayerD(Me.GetDam())
+ layerD.UpdateTaskSuccess(parameterValue, returnValue)
+ End Sub
+
+ #End Region
+
+ #Region "UpdateTaskProgress"
+
+ '''
+ ''' Updates progress rate of the asynchronous task in the database.
+ '''
+ ''' Asynchronous Parameter Values
+ Private Sub UOC_UpdateTaskProgress(parameterValue As ApsParameterValue)
+ Dim returnValue As New ApsReturnValue()
+ Me.ReturnValue = returnValue
+
+ Dim layerD As New ApsLayerD(Me.GetDam())
+ layerD.UpdateTaskProgress(parameterValue, returnValue)
+ End Sub
+
+ #End Region
+
+ #Region "UpdateTaskCommand"
+
+ '''
+ ''' Updates command value information of a selected asynchronous task
+ '''
+ ''' Asynchronous Parameter Values
+ Private Sub UOC_UpdateTaskCommand(parameterValue As ApsParameterValue)
+ Dim returnValue As New ApsReturnValue()
+ Me.ReturnValue = returnValue
+
+ Dim layerD As New ApsLayerD(Me.GetDam())
+ layerD.UpdateTaskCommand(parameterValue, returnValue)
+ End Sub
+
+ #End Region
+
+ #Region "StopAllTask"
+
+ '''
+ ''' Set stop command for all running asynchronous task
+ '''
+ ''' Asynchronous Parameter Values
+ Private Sub UOC_StopAllTask(parameterValue As ApsParameterValue)
+ Dim returnValue As New ApsReturnValue()
+ Me.ReturnValue = returnValue
+
+ Dim layerD As New ApsLayerD(Me.GetDam())
+ layerD.StopAllTask(parameterValue, returnValue)
+ End Sub
+
+ #End Region
+
+ #End Region
+
+ #Region "Select"
+
+ #Region "SelectCommand"
+
+ '''
+ ''' Selects user command from Database through LayerD
+ '''
+ '''
+ Private Sub UOC_SelectCommand(parameterValue As ApsParameterValue)
+ Dim returnValue As New ApsReturnValue()
+ Me.ReturnValue = returnValue
+
+ Dim layerD As New ApsLayerD(Me.GetDam())
+ layerD.SelectCommand(parameterValue, returnValue)
+ End Sub
+
+ #End Region
+
+ #Region "SelectTask"
+
+ '''
+ ''' Selects Asynchronous task from LayerD
+ '''
+ ''' Async Parameter Value
+ Private Sub UOC_SelectTask(parameterValue As ApsParameterValue)
+ Dim returnValue As New ApsReturnValue()
+ Me.ReturnValue = returnValue
+
+ Dim layerD As New ApsLayerD(Me.GetDam())
+ layerD.SelectTask(parameterValue, returnValue)
+
+ Dim dt As DataTable = DirectCast(returnValue.Obj, DataTable)
+ returnValue.Obj = Nothing
+
+ If dt IsNot Nothing Then
+ If dt.Rows.Count <> 0 Then
+ returnValue.TaskId = Convert.ToInt32(dt.Rows(0)("Id"))
+ returnValue.UserId = dt.Rows(0)("UserId").ToString()
+ returnValue.ProcessName = dt.Rows(0)("ProcessName").ToString()
+ returnValue.Data = dt.Rows(0)("Data").ToString()
+ returnValue.NumberOfRetries = Convert.ToInt32(dt.Rows(0)("NumberOfRetries"))
+ returnValue.ReservedArea = dt.Rows(0)("ReservedArea").ToString()
+ returnValue.CommandId = Convert.ToInt32(dt.Rows(0)("CommandId"))
+ End If
+ End If
+ End Sub
+
+ #End Region
+
+ #End Region
+
+ #Region "TestConnection"
+
+ '''
+ ''' Tests the connection with the specified database
+ '''
+ ''' Async Parameter Value
+ Private Sub UOC_TestConnection(parameterValue As ApsParameterValue)
+ Dim layerD As New ApsLayerD(Me.GetDam())
+ End Sub
+
+ #End Region
+ End Class
+End Namespace
diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerD.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerD.vb
new file mode 100644
index 0000000..4793dd6
--- /dev/null
+++ b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsLayerD.vb
@@ -0,0 +1,329 @@
+'**********************************************************************************
+'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
+'**********************************************************************************
+
+#Region "Apache License"
+'
+' Licensed under the Apache License, Version 2.0 (the "License");
+' you may not use this file except in compliance with the License.
+' You may obtain a copy of the License at
+'
+' http://www.apache.org/licenses/LICENSE-2.0
+'
+' Unless required by applicable law or agreed to in writing, software
+' distributed under the License is distributed on an "AS IS" BASIS,
+' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+' See the License for the specific language governing permissions and
+' limitations under the License.
+'
+#End Region
+
+'**********************************************************************************
+'* クラス名 :LayerD
+'* クラス日本語名 :LayerD
+'*
+'* 日時 更新者 内容
+'* ---------- ---------------- -------------------------------------------------
+'* 11/28/2014 Supragyan Created LayerD class for AsyncProcessing Service
+'* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service
+'* 04/14/2015 Sandeep Did code modification of update and select asynchronous task
+'* 04/14/2015 Sandeep Did code implementation of SetSqlByFile3 to access the SQL from embedded resource
+'* 05/28/2015 Sandeep Did code implementation to update Exception information to the database
+'* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task
+'* Modified code to reset Exception information, before starting asynchronous task
+'* 06/26/2015 Sandeep Removed the where condition command <> 'Abort' from the SelectTask asynchronous task,
+'* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state
+'* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps)
+'**********************************************************************************
+
+Imports System
+Imports System.Data
+
+Imports Touryo.Infrastructure.Business.Dao
+Imports Touryo.Infrastructure.Framework.AsyncProcessingService
+Imports Touryo.Infrastructure.Public.Db
+
+Namespace Touryo.Infrastructure.Business.AsyncProcessingService
+ '''
+ ''' LayerD class for AsyncProcessing Service
+ '''
+ Public Class ApsLayerD
+ Inherits MyBaseDao
+ ''' AsyncProcessingService用B層
+ ''' dam
+ Public Sub New(dam As BaseDam)
+ MyBase.New(dam)
+ End Sub
+
+ #Region "Insert"
+
+ '''
+ ''' Inserts async parameter values to database
+ '''
+ '''
+ '''
+ Public Sub InsertTask(parameterValue As ApsParameterValue, returnValue As ApsReturnValue)
+ Dim filename As String = String.Empty
+ filename = "AsyncProcessingServiceInsert.sql"
+
+ ' Get SQL query from file.
+ Me.SetSqlByFile2(filename)
+
+ ' Set SQL parameter values
+ Me.SetParameter("P2", parameterValue.UserId)
+ Me.SetParameter("P3", parameterValue.ProcessName)
+ Me.SetParameter("P4", parameterValue.Data)
+ Me.SetParameter("P5", parameterValue.RegistrationDateTime)
+ Me.SetParameter("P6", DBNull.Value)
+ Me.SetParameter("P7", parameterValue.NumberOfRetries)
+ Me.SetParameter("P8", DBNull.Value)
+ Me.SetParameter("P9", parameterValue.StatusId)
+ Me.SetParameter("P10", parameterValue.ProgressRate)
+ Me.SetParameter("P11", parameterValue.CommandId)
+ Me.SetParameter("P12", parameterValue.ReservedArea)
+
+ ' Execute SQL query
+ returnValue.Obj = Me.ExecInsUpDel_NonQuery()
+ End Sub
+
+ #End Region
+
+ #Region "Update"
+
+ #Region "UpdateTaskStart"
+
+ '''
+ ''' Updates information in the database that the asynchronous task is started
+ '''
+ ''' Asynchronous Parameter Values
+ ''' Asynchronous Return Values
+ Public Sub UpdateTaskStart(parameterValue As ApsParameterValue, returnValue As ApsReturnValue)
+ Dim filename As String = String.Empty
+ filename = "UpdateTaskStart.sql"
+
+ ' Get SQL query from file.
+ Me.SetSqlByFile2(filename)
+
+ ' Set SQL parameter values
+ Me.SetParameter("P1", parameterValue.TaskId)
+ Me.SetParameter("P2", parameterValue.ExecutionStartDateTime)
+ Me.SetParameter("P3", parameterValue.StatusId)
+ Me.SetParameter("P4", DBNull.Value)
+
+ ' Execute SQL query
+ returnValue.Obj = Me.ExecInsUpDel_NonQuery()
+ End Sub
+
+ #End Region
+
+ #Region "UpdateTaskRetry"
+
+ '''
+ ''' Updates information in the database that the asynchronous task is failed and can be retried later
+ '''
+ ''' Asynchronous Parameter Values
+ ''' Asynchronous Return Values
+ Public Sub UpdateTaskRetry(parameterValue As ApsParameterValue, returnValue As ApsReturnValue)
+ Dim filename As String = String.Empty
+ filename = "UpdateTaskRetry.sql"
+
+ ' Get SQL query from file.
+ Me.SetSqlByFile2(filename)
+
+ ' Set SQL parameter values
+ Me.SetParameter("P1", parameterValue.TaskId)
+ Me.SetParameter("P2", parameterValue.NumberOfRetries)
+ Me.SetParameter("P3", parameterValue.CompletionDateTime)
+ Me.SetParameter("P4", parameterValue.StatusId)
+ Me.SetParameter("P5", parameterValue.ExceptionInfo)
+
+ ' Execute SQL query
+ returnValue.Obj = Me.ExecInsUpDel_NonQuery()
+ End Sub
+
+ #End Region
+
+ #Region "UpdateTaskFail"
+
+ '''
+ ''' Updates information in the database that the asynchronous task is failed and abort this task [status=Abort]
+ '''
+ ''' Asynchronous Parameter Values
+ ''' Asynchronous Return Values
+ Public Sub UpdateTaskFail(parameterValue As ApsParameterValue, returnValue As ApsReturnValue)
+ Dim filename As String = String.Empty
+ filename = "UpdateTaskFail.sql"
+
+ ' Get SQL query from file.
+ Me.SetSqlByFile2(filename)
+
+ ' Set SQL parameter values
+ Me.SetParameter("P1", parameterValue.TaskId)
+ Me.SetParameter("P2", parameterValue.CompletionDateTime)
+ Me.SetParameter("P3", parameterValue.StatusId)
+ Me.SetParameter("P4", parameterValue.ExceptionInfo)
+
+ ' Execute SQL query
+ returnValue.Obj = Me.ExecInsUpDel_NonQuery()
+ End Sub
+
+ #End Region
+
+ #Region "UpdateTaskSuccess"
+
+ '''
+ ''' Updates information in the database that the asynchronous task is completed
+ '''
+ ''' Asynchronous Parameter Values
+ ''' Asynchronous Return Values
+ Public Sub UpdateTaskSuccess(parameterValue As ApsParameterValue, returnValue As ApsReturnValue)
+ Dim filename As String = String.Empty
+ filename = "UpdateTaskSuccess.sql"
+
+ ' Get SQL query from file.
+ Me.SetSqlByFile2(filename)
+
+ ' Set SQL parameter values
+ Me.SetParameter("P1", parameterValue.TaskId)
+ Me.SetParameter("P2", parameterValue.CompletionDateTime)
+ Me.SetParameter("P3", parameterValue.ProgressRate)
+ Me.SetParameter("P4", parameterValue.StatusId)
+
+ ' Execute SQL query
+ returnValue.Obj = Me.ExecInsUpDel_NonQuery()
+ End Sub
+
+ #End Region
+
+ #Region "UpdateTaskProgress"
+
+ '''
+ ''' Updates progress rate of the asynchronous task in the database.
+ '''
+ ''' Asynchronous Parameter Values
+ ''' Asynchronous Return Values
+ Public Sub UpdateTaskProgress(parameterValue As ApsParameterValue, returnValue As ApsReturnValue)
+ Dim filename As String = String.Empty
+ filename = "UpdateTaskProgress.sql"
+
+ ' Get SQL query from file.
+ Me.SetSqlByFile2(filename)
+
+ ' Set SQL parameter values
+ Me.SetParameter("P1", parameterValue.TaskId)
+ Me.SetParameter("P2", parameterValue.ProgressRate)
+
+ ' Execute SQL query
+ returnValue.Obj = Me.ExecInsUpDel_NonQuery()
+ End Sub
+
+ #End Region
+
+ #Region "UpdateTaskCommand"
+
+ '''
+ ''' Updates command value information of a selected asynchronous task
+ '''
+ ''' Asynchronous Parameter Values
+ ''' Asynchronous Return Values
+ Public Sub UpdateTaskCommand(parameterValue As ApsParameterValue, returnValue As ApsReturnValue)
+ Dim filename As String = String.Empty
+ filename = "UpdateTaskCommand.sql"
+
+ ' Get SQL query from file.
+ Me.SetSqlByFile2(filename)
+
+ ' Set SQL parameter values
+ Me.SetParameter("P1", parameterValue.TaskId)
+ Me.SetParameter("P2", parameterValue.CommandId)
+
+ ' Execute SQL query
+ returnValue.Obj = Me.ExecInsUpDel_NonQuery()
+ End Sub
+
+ #End Region
+
+ #Region "StopAllTask"
+
+ '''
+ ''' Set stop command for all running asynchronous task.
+ '''
+ ''' Asynchronous Parameter Values
+ ''' Asynchronous Return Values
+ Public Sub StopAllTask(parameterValue As ApsParameterValue, returnValue As ApsReturnValue)
+ Dim filename As String = String.Empty
+ filename = "StopAllTask.sql"
+
+ ' Get SQL query from file.
+ Me.SetSqlByFile2(filename)
+
+ ' Set SQL parameter values
+ Me.SetParameter("P1", parameterValue.StatusId)
+ Me.SetParameter("P2", parameterValue.CommandId)
+
+ ' Execute SQL query
+ returnValue.Obj = Me.ExecInsUpDel_NonQuery()
+ End Sub
+
+ #End Region
+
+ #End Region
+
+ #Region "Select"
+
+ #Region "SelectCommand"
+
+ '''
+ ''' Selects user command from database
+ '''
+ ''' Asynchronous Parameter Values
+ ''' Asynchronous Return Values
+ Public Sub SelectCommand(parameterValue As ApsParameterValue, returnValue As ApsReturnValue)
+ Dim filename As String = String.Empty
+ filename = "SelectCommand.sql"
+
+ ' Get SQL query from file.
+ Me.SetSqlByFile2(filename)
+
+ ' Set SQL parameter values
+ Me.SetParameter("P1", parameterValue.TaskId)
+
+ ' Execute SQL query
+ returnValue.Obj = Me.ExecSelectScalar()
+ End Sub
+
+ #End Region
+
+ #Region "SelectTask"
+
+ '''
+ ''' To get Asynchronous Task from the database
+ '''
+ '''
+ '''
+ Public Sub SelectTask(parameterValue As ApsParameterValue, returnValue As ApsReturnValue)
+ Dim filename As String = String.Empty
+ filename = "SelectTask.sql"
+
+ ' Get SQL query from file.
+ Me.SetSqlByFile2(filename)
+
+ ' Set SQL parameter values
+ Me.SetParameter("P1", parameterValue.RegistrationDateTime)
+ Me.SetParameter("P2", parameterValue.NumberOfRetries)
+ Me.SetParameter("P3", CInt(AsyncStatus.Register))
+ Me.SetParameter("P4", CInt(AsyncStatus.AbnormalEnd))
+ Me.SetParameter("P7", parameterValue.CompletionDateTime)
+
+ Dim dt As New DataTable()
+
+ ' Get Asynchronous Task from the database
+ Me.ExecSelectFill_DT(dt)
+ returnValue.Obj = dt
+ End Sub
+
+ #End Region
+
+ #End Region
+ End Class
+End Namespace
diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceParameterValue.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsParameterValue.vb
similarity index 57%
rename from root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceParameterValue.vb
rename to root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsParameterValue.vb
index f745c60..b90ba76 100644
--- a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceParameterValue.vb
+++ b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsParameterValue.vb
@@ -19,15 +19,18 @@
#End Region
'**********************************************************************************
-'* クラス名 :AsyncProcessingServiceParameterValue
-'* クラス日本語名 :AsyncProcessingServiceParameterValue
+'* クラス名 :ApsParameterValue
+'* クラス日本語名 :ApsParameterValue
'*
'* 日時 更新者 内容
'* ---------- ---------------- -------------------------------------------------
'* 11/28/2014 Supragyan Paramter Value class for Asynchronous Processing Service
'* 04/15/2015 Sandeep Changed datatype of ProgressRate to decimal.
+'* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps)
+'* 2018/08/24 西野 大介 列挙型と列挙型処理クラスの移動
'**********************************************************************************
+Imports System
Imports System.Reflection
Imports Touryo.Infrastructure.Business.Common
@@ -37,7 +40,7 @@ Namespace Touryo.Infrastructure.Business.AsyncProcessingService
'''
''' Paramter Value class for Asynchronous Processing Service
'''
- Public Class AsyncProcessingServiceParameterValue
+ Public Class ApsParameterValue
Inherits MyParameterValue
''' 汎用エリア
Public Obj As Object
@@ -90,95 +93,5 @@ Namespace Touryo.Infrastructure.Business.AsyncProcessingService
End Sub
#End Region
-
- #Region "AsyncStatus"
-
- '''
- ''' AsyncStatus Enum for storing all status
- '''
- Public Enum AsyncStatus
- ''' Register
- _
- Register = 1
-
- ''' Processing
- _
- Processing
-
- ''' End
- _
- [End]
-
- ''' AbnormalEnd
- _
- AbnormalEnd
-
- ''' Abort
- _
- Abort
- End Enum
-
- #End Region
-
- #Region "AsyncCommand"
-
- '''
- ''' AsyncCommand Enum for storing command values
- '''
- Public Enum AsyncCommand
- ''' Stop
- _
- [Stop] = 1
-
- ''' Abort
- _
- Abort
- End Enum
-
- #End Region
- End Class
-
- '''
- ''' To get the string value
- '''
- Public Class StringValueAttribute
- Inherits System.Attribute
- Private _value As String
-
- ''' StringValueAttribute
- ''' value
- Public Sub New(value As String)
- _value = value
- End Sub
-
- ''' Value
- Public ReadOnly Property Value() As String
- Get
- Return _value
- End Get
- End Property
- End Class
-
- '''
- ''' Class that holds the Enum values string
- '''
- Public Class StringEnum
- '''
- ''' To get the string value from Enum value
- '''
- ''' Enum value
- ''' String value of Enum
- Public Shared Function GetStringValue(value As [Enum]) As String
- Dim output As String = Nothing
- Dim type As Type = value.[GetType]()
-
- ' Gets the 'StringValueAttribute'
- Dim fi As FieldInfo = type.GetField(value.ToString())
- Dim attrs As StringValueAttribute() = TryCast(fi.GetCustomAttributes(GetType(StringValueAttribute), False), StringValueAttribute())
- If attrs.Length > 0 Then
- output = attrs(0).Value
- End If
- Return output
- End Function
End Class
End Namespace
diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsReturnValue.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsReturnValue.vb
new file mode 100644
index 0000000..817d9f8
--- /dev/null
+++ b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsReturnValue.vb
@@ -0,0 +1,83 @@
+'**********************************************************************************
+'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
+'**********************************************************************************
+
+#Region "Apache License"
+'
+' Licensed under the Apache License, Version 2.0 (the "License");
+' you may not use this file except in compliance with the License.
+' You may obtain a copy of the License at
+'
+' http://www.apache.org/licenses/LICENSE-2.0
+'
+' Unless required by applicable law or agreed to in writing, software
+' distributed under the License is distributed on an "AS IS" BASIS,
+' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+' See the License for the specific language governing permissions and
+' limitations under the License.
+'
+#End Region
+
+'**********************************************************************************
+'* クラス名 :ApsReturnValue
+'* クラス日本語名 :ApsReturnValue
+'*
+'* 日時 更新者 内容
+'* ---------- ---------------- -------------------------------------------------
+'* 11/28/2014 Supragyan Paramter Return Value class for Asynchronous Processing Service
+'* 04/15/2015 Sandeep Changed datatype of ProgressRate to decimal.
+'* 2018/08/24 西野 大介 クラス名称の変更( ---> Aps)
+'**********************************************************************************
+
+Imports System
+Imports Touryo.Infrastructure.Business.Common
+
+Namespace Touryo.Infrastructure.Business.AsyncProcessingService
+ '''
+ ''' Paramter Return Value class for Asynchronous Processing Service
+ '''
+ Public Class ApsReturnValue
+ Inherits MyReturnValue
+ ''' 汎用エリア
+ Public Obj As Object
+
+ ''' TaskId
+ Public TaskId As Integer
+
+ ''' UserId
+ Public UserId As String
+
+ ''' ProcessName
+ Public ProcessName As String
+
+ ''' Data
+ Public Data As String
+
+ ''' RegistrationDateTime
+ Public RegistrationDateTime As DateTime
+
+ ''' ExecutionStartDateTime;
+ Public ExecutionStartDateTime As DateTime
+
+ ''' NumberOfRetries;
+ Public NumberOfRetries As Integer
+
+ ''' ProgressRate
+ Public ProgressRate As Decimal
+
+ ''' StatusId;
+ Public StatusId As Integer
+
+ ''' CompletionDateTime
+ Public CompletionDateTime As DateTime
+
+ ''' CommandId;
+ Public CommandId As Integer
+
+ ''' ReservedArea
+ Public ReservedArea As String
+
+ ''' ExceptionInfo
+ Public ExceptionInfo As String
+ End Class
+End Namespace
diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsUtility.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsUtility.vb
new file mode 100644
index 0000000..624f9a7
--- /dev/null
+++ b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/ApsUtility.vb
@@ -0,0 +1,103 @@
+'**********************************************************************************
+'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
+'**********************************************************************************
+
+#Region "Apache License"
+'
+' Licensed under the Apache License, Version 2.0 (the "License");
+' you may not use this file except in compliance with the License.
+' You may obtain a copy of the License at
+'
+' http://www.apache.org/licenses/LICENSE-2.0
+'
+' Unless required by applicable law or agreed to in writing, software
+' distributed under the License is distributed on an "AS IS" BASIS,
+' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+' See the License for the specific language governing permissions and
+' limitations under the License.
+'
+#End Region
+
+'**********************************************************************************
+'* クラス名 :ApsUtility
+'* クラス日本語名 :ApsUtility
+'*
+'* 日時 更新者 内容
+'* ---------- ---------------- -------------------------------------------------
+'* 2018/08/24 西野 大介 新規作成(Utilityメソッドを部品化)
+'**********************************************************************************
+
+Imports Touryo.Infrastructure.Business.Util
+Imports Touryo.Infrastructure.Public.Db
+
+Namespace Touryo.Infrastructure.Business.AsyncProcessingService
+ ''' ApsUtility
+ Public Class ApsUtility
+ ''' Get command information from database.
+ ''' asynchronous task id
+ ''' asynchronous return value
+ ''' BaseDam
+ Public Shared Sub GetCommandValue(taskID As Integer, returnValue As ApsReturnValue, dam As BaseDam)
+ ' Sets parameters of AsyncProcessingServiceParameterValue to get command value.
+ Dim parameterValue As New ApsParameterValue("AsyncProcessingService", "SelectCommand", "SelectCommand", "SQL", New MyUserInfo("AsyncProcessingService", "AsyncProcessingService"))
+
+ parameterValue.TaskId = taskID
+
+ ' Calls data access part of asynchronous processing service.
+ Dim layerD As New ApsLayerD(dam)
+ layerD.SelectCommand(parameterValue, returnValue)
+ returnValue.CommandId = CInt(returnValue.Obj)
+ End Sub
+
+ '''
+ ''' Resumes asynchronous process in the middle of the processing.
+ '''
+ ''' Task ID
+ ''' asynchronous return value
+ ''' BaseDam
+ Public Shared Sub ResumeProcessing(taskID As Integer, returnValue As ApsReturnValue, dam As BaseDam)
+ ' Reset the command of selected task.
+ ApsUtility.UpdateTaskCommand(taskID, 0, returnValue, dam)
+ End Sub
+
+ '''
+ ''' Updates the progress rate in the database.
+ '''
+ ''' asynchronous task id
+ ''' ApsReturnValue
+ ''' progress rate
+ ''' BaseDam
+ Public Shared Sub UpdateProgressRate(taskID As Integer, returnValue As ApsReturnValue, progressRate As Decimal, dam As BaseDam)
+ ' Sets parameters of AsyncProcessingServiceParameterValue to Update progress rate
+ Dim parameterValue As New ApsParameterValue("AsyncProcessingService", "UpdateTaskProgress", "UpdateTaskProgress", "SQL", New MyUserInfo("AsyncProcessingService", "AsyncProcessingService"))
+
+ parameterValue.TaskId = taskID
+ parameterValue.ProgressRate = progressRate
+
+ ' Calls data access part of asynchronous processing service.
+ Dim layerD As New ApsLayerD(dam)
+ layerD.UpdateTaskProgress(parameterValue, returnValue)
+ End Sub
+
+ '''
+ ''' Updates the command of selected task
+ '''
+ ''' Task ID
+ ''' Command ID
+ ''' user parameter value
+ ''' BaseDam
+ Public Shared Sub UpdateTaskCommand(taskID As Integer, commandId As Integer, returnValue As ApsReturnValue, dam As BaseDam)
+ ' Sets parameters of AsyncProcessingServiceParameterValue to update the command of selected task.
+ Dim parameterValue As New ApsParameterValue("AsyncProcessingService", "UpdateTaskCommand", "UpdateTaskCommand", "SQL", New MyUserInfo("AsyncProcessingService", "AsyncProcessingService"))
+
+ parameterValue.TaskId = taskID
+ parameterValue.CommandId = commandId
+
+ ' Calls data access part of asynchronous processing service.
+ Dim layerD As New ApsLayerD(dam)
+ layerD.UpdateTaskCommand(parameterValue, returnValue)
+ End Sub
+
+
+ End Class
+End Namespace
diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceReturnValue.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceReturnValue.vb
deleted file mode 100644
index c71f8ff..0000000
--- a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/AsyncProcessingServiceReturnValue.vb
+++ /dev/null
@@ -1,81 +0,0 @@
-'**********************************************************************************
-'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
-'**********************************************************************************
-
-#Region "Apache License"
-'
-' Licensed under the Apache License, Version 2.0 (the "License");
-' you may not use this file except in compliance with the License.
-' You may obtain a copy of the License at
-'
-' http://www.apache.org/licenses/LICENSE-2.0
-'
-' Unless required by applicable law or agreed to in writing, software
-' distributed under the License is distributed on an "AS IS" BASIS,
-' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-' See the License for the specific language governing permissions and
-' limitations under the License.
-'
-#End Region
-
-'**********************************************************************************
-'* クラス名 :AsyncProcessingServiceReturnValue
-'* クラス日本語名 :AsyncProcessingServiceReturnValue
-'*
-'* 日時 更新者 内容
-'* ---------- ---------------- -------------------------------------------------
-'* 11/28/2014 Supragyan Paramter Return Value class for Asynchronous Processing Service
-'* 04/15/2015 Sandeep Changed datatype of ProgressRate to decimal.
-'**********************************************************************************
-
-Imports Touryo.Infrastructure.Business.Common
-
-Namespace Touryo.Infrastructure.Business.AsyncProcessingService
- '''
- ''' Paramter Return Value class for Asynchronous Processing Service
- '''
- Public Class AsyncProcessingServiceReturnValue
- Inherits MyReturnValue
- ''' 汎用エリア
- Public Obj As Object
-
- ''' TaskId
- Public TaskId As Integer
-
- ''' UserId
- Public UserId As String
-
- ''' ProcessName
- Public ProcessName As String
-
- ''' Data
- Public Data As String
-
- ''' RegistrationDateTime
- Public RegistrationDateTime As DateTime
-
- ''' ExecutionStartDateTime;
- Public ExecutionStartDateTime As DateTime
-
- ''' NumberOfRetries;
- Public NumberOfRetries As Integer
-
- ''' ProgressRate
- Public ProgressRate As Decimal
-
- ''' StatusId;
- Public StatusId As Integer
-
- ''' CompletionDateTime
- Public CompletionDateTime As DateTime
-
- ''' CommandId;
- Public CommandId As Integer
-
- ''' ReservedArea
- Public ReservedArea As String
-
- ''' ExceptionInfo
- Public ExceptionInfo As String
- End Class
-End Namespace
diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerB.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerB.vb
deleted file mode 100644
index 7142286..0000000
--- a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerB.vb
+++ /dev/null
@@ -1,246 +0,0 @@
-'**********************************************************************************
-'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
-'**********************************************************************************
-
-#Region "Apache License"
-'
-' Licensed under the Apache License, Version 2.0 (the "License");
-' you may not use this file except in compliance with the License.
-' You may obtain a copy of the License at
-'
-' http://www.apache.org/licenses/LICENSE-2.0
-'
-' Unless required by applicable law or agreed to in writing, software
-' distributed under the License is distributed on an "AS IS" BASIS,
-' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-' See the License for the specific language governing permissions and
-' limitations under the License.
-'
-#End Region
-
-'**********************************************************************************
-'* クラス名 :LayerB
-'* クラス日本語名 :LayerB
-'*
-'* 日時 更新者 内容
-'* ---------- ---------------- -------------------------------------------------
-'* 11/28/2014 Supragyan Created LayerB class for AsyncProcessing Service
-'* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service
-'* 04/15/2015 Sandeep Did code modification of insert, update and select for AsyncProcessing Service
-'* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task
-'* Modified code to reset Exception information, before starting asynchronous task
-'* 06/26/2015 Sandeep Implemented code to get commandID in the SelectTask method,
-'* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state
-'* 06/01/2016 Sandeep Implemented method to test the connection of specified database
-'**********************************************************************************
-
-Imports Touryo.Infrastructure.Business.Business
-
-Namespace Touryo.Infrastructure.Business.AsyncProcessingService
-#Region "LayerB"
-
- '''
- ''' LayerB class for AsyncProcessing Service
- '''
- Public Class LayerB
- Inherits MyFcBaseLogic
-#Region "Insert"
-
- '''
- ''' Inserts Async Parameter values to Database through LayerD
- '''
- '''
- Public Sub UOC_InsertTask(asyncParameterValue As AsyncProcessingServiceParameterValue)
- ' 戻り値クラスを生成して、事前に戻り値に設定しておく。
- Dim asyncReturnValue As New AsyncProcessingServiceReturnValue()
- Me.ReturnValue = asyncReturnValue
-
- Dim myDao As New LayerD(Me.GetDam())
- myDao.InsertTask(asyncParameterValue, asyncReturnValue)
- End Sub
-
-#End Region
-
-#Region "Update"
-
-#Region "UpdateTaskStart"
-
- '''
- ''' Updates information in the database that the asynchronous task is started
- '''
- ''' Asynchronous Parameter Values
- Private Sub UOC_UpdateTaskStart(asyncParameterValue As AsyncProcessingServiceParameterValue)
- Dim asyncReturnValue As New AsyncProcessingServiceReturnValue()
- Me.ReturnValue = asyncReturnValue
-
- Dim myDao As New LayerD(Me.GetDam())
- myDao.UpdateTaskStart(asyncParameterValue, asyncReturnValue)
- End Sub
-
-#End Region
-
-#Region "UpdateTaskRetry"
-
- '''
- ''' Updates information in the database that the asynchronous task is failed and can be retried later
- '''
- ''' Asynchronous Parameter Values
- Private Sub UOC_UpdateTaskRetry(asyncParameterValue As AsyncProcessingServiceParameterValue)
- Dim asyncReturnValue As New AsyncProcessingServiceReturnValue()
- Me.ReturnValue = asyncReturnValue
-
- Dim myDao As New LayerD(Me.GetDam())
- myDao.UpdateTaskRetry(asyncParameterValue, asyncReturnValue)
- End Sub
-
-#End Region
-
-#Region "UpdateTaskFail"
-
- '''
- ''' Updates information in the database that the asynchronous task is failed and abort this task [status=Abort]
- '''
- ''' Asynchronous Parameter Values
- Private Sub UOC_UpdateTaskFail(asyncParameterValue As AsyncProcessingServiceParameterValue)
- Dim asyncReturnValue As New AsyncProcessingServiceReturnValue()
- Me.ReturnValue = asyncReturnValue
-
- Dim myDao As New LayerD(Me.GetDam())
- myDao.UpdateTaskFail(asyncParameterValue, asyncReturnValue)
- End Sub
-
-#End Region
-
-#Region "UpdateTaskSuccess"
-
- '''
- ''' Updates information in the database that the asynchronous task is completed
- '''
- ''' Asynchronous Parameter Values
- Private Sub UOC_UpdateTaskSuccess(asyncParameterValue As AsyncProcessingServiceParameterValue)
- Dim asyncReturnValue As New AsyncProcessingServiceReturnValue()
- Me.ReturnValue = asyncReturnValue
-
- Dim myDao As New LayerD(Me.GetDam())
- myDao.UpdateTaskSuccess(asyncParameterValue, asyncReturnValue)
- End Sub
-
-#End Region
-
-#Region "UpdateTaskProgress"
-
- '''
- ''' Updates progress rate of the asynchronous task in the database.
- '''
- ''' Asynchronous Parameter Values
- Private Sub UOC_UpdateTaskProgress(asyncParameterValue As AsyncProcessingServiceParameterValue)
- Dim asyncReturnValue As New AsyncProcessingServiceReturnValue()
- Me.ReturnValue = asyncReturnValue
-
- Dim myDao As New LayerD(Me.GetDam())
- myDao.UpdateTaskProgress(asyncParameterValue, asyncReturnValue)
- End Sub
-
-#End Region
-
-#Region "UpdateTaskCommand"
-
- '''
- ''' Updates command value information of a selected asynchronous task
- '''
- ''' Asynchronous Parameter Values
- Private Sub UOC_UpdateTaskCommand(asyncParameterValue As AsyncProcessingServiceParameterValue)
- Dim asyncReturnValue As New AsyncProcessingServiceReturnValue()
- Me.ReturnValue = asyncReturnValue
-
- Dim myDao As New LayerD(Me.GetDam())
- myDao.UpdateTaskCommand(asyncParameterValue, asyncReturnValue)
- End Sub
-
-#End Region
-
-#Region "StopAllTask"
-
- '''
- ''' Set stop command for all running asynchronous task
- '''
- ''' Asynchronous Parameter Values
- Private Sub UOC_StopAllTask(asyncParameterValue As AsyncProcessingServiceParameterValue)
- Dim asyncReturnValue As New AsyncProcessingServiceReturnValue()
- Me.ReturnValue = asyncReturnValue
-
- Dim myDao As New LayerD(Me.GetDam())
- myDao.StopAllTask(asyncParameterValue, asyncReturnValue)
- End Sub
-
-#End Region
-
-#End Region
-
-#Region "Select"
-
-#Region "SelectCommand"
-
- '''
- ''' Selects user command from Database through LayerD
- '''
- '''
- Private Sub UOC_SelectCommand(asyncParameterValue As AsyncProcessingServiceParameterValue)
- Dim asyncReturnValue As New AsyncProcessingServiceReturnValue()
- Me.ReturnValue = asyncReturnValue
-
- Dim myDao As New LayerD(Me.GetDam())
- myDao.SelectCommand(asyncParameterValue, asyncReturnValue)
- End Sub
-
-#End Region
-
-#Region "SelectTask"
-
- '''
- ''' Selects Asynchronous task from LayerD
- '''
- ''' Async Parameter Value
- Private Sub UOC_SelectTask(asyncParameterValue As AsyncProcessingServiceParameterValue)
- Dim asyncReturnValue As New AsyncProcessingServiceReturnValue()
- Me.ReturnValue = asyncReturnValue
-
- Dim myDao As New LayerD(Me.GetDam())
- myDao.SelectTask(asyncParameterValue, asyncReturnValue)
-
- Dim dt As DataTable = DirectCast(asyncReturnValue.Obj, DataTable)
- asyncReturnValue.Obj = Nothing
-
- If dt IsNot Nothing Then
- If dt.Rows.Count <> 0 Then
- 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"))
- End If
- End If
- End Sub
-
-#End Region
-
-#End Region
-
-#Region "TestConnection"
-
- '''
- ''' Tests the connection with the specified database
- '''
- ''' Async Parameter Value
- Private Sub UOC_TestConnection(asyncParameterValue As AsyncProcessingServiceParameterValue)
- Dim myDao As New LayerD(Me.GetDam())
- End Sub
-
-#End Region
- End Class
-
-#End Region
-End Namespace
-
diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerD.vb b/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerD.vb
deleted file mode 100644
index 222f9b8..0000000
--- a/root/programs/VB/Frameworks/Infrastructure/Business/AsyncProcessingService/LayerD.vb
+++ /dev/null
@@ -1,353 +0,0 @@
-'**********************************************************************************
-'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
-'**********************************************************************************
-
-#Region "Apache License"
-'
-' Licensed under the Apache License, Version 2.0 (the "License");
-' you may not use this file except in compliance with the License.
-' You may obtain a copy of the License at
-'
-' http://www.apache.org/licenses/LICENSE-2.0
-'
-' Unless required by applicable law or agreed to in writing, software
-' distributed under the License is distributed on an "AS IS" BASIS,
-' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-' See the License for the specific language governing permissions and
-' limitations under the License.
-'
-#End Region
-
-'**********************************************************************************
-'* クラス名 :LayerD
-'* クラス日本語名 :LayerD
-'*
-'* 日時 更新者 内容
-'* ---------- ---------------- -------------------------------------------------
-'* 11/28/2014 Supragyan Created LayerD class for AsyncProcessing Service
-'* 11/28/2014 Supragyan Created Insert,Update,Select method for AsyncProcessing Service
-'* 04/14/2015 Sandeep Did code modification of update and select asynchronous task
-'* 04/14/2015 Sandeep Did code implementation of SetSqlByFile3 to access the SQL from embedded resource
-'* 05/28/2015 Sandeep Did code implementation to update Exception information to the database
-'* 06/09/2015 Sandeep Implemented code to update stop command to all the running asynchronous task
-'* Modified code to reset Exception information, before starting asynchronous task
-'* 06/26/2015 Sandeep Removed the where condition command <> 'Abort' from the SelectTask asynchronous task,
-'* to resolve unstable "Register" state, when you invoke [Abort] to AsyncTask, at this "Register" state
-'**********************************************************************************
-
-Imports System.Text
-
-Imports Touryo.Infrastructure.Business.Dao
-Imports Touryo.Infrastructure.Public.Db
-Imports Touryo.Infrastructure.Public.IO
-Imports Touryo.Infrastructure.Public.Util
-
-Namespace Touryo.Infrastructure.Business.AsyncProcessingService
- '''
- ''' LayerD class for AsyncProcessing Service
- '''
- Public Class LayerD
- Inherits MyBaseDao
- ''' AsyncProcessingService用B層
- ''' dam
- Public Sub New(dam As BaseDam)
- MyBase.New(dam)
- End Sub
-
-#Region "SetSqlByFile3"
-
- ''''
- '''' Get SQL query from the embedded resource assembly
- ''''
- 'Public Sub SetSqlByFile3(filename As String)
- ' ' SQLファイルのEncoding情報の取得
- ' Dim sqlEncoding As String = GetConfigParameter.GetConfigValue(PubLiteral.SQL_ENCODING)
-
- ' If String.IsNullOrEmpty(sqlEncoding) Then
- ' ' デフォルト:UTF-8
- ' sqlEncoding = "utf-8"
- ' End If
-
- ' Dim assemblyString As String = "Business"
-
- ' ' Get SQL query from embedded resource file.
- ' Dim commandText As String = EmbeddedResourceLoader.LoadAsString(assemblyString, filename, Encoding.GetEncoding(sqlEncoding))
-
- ' ' Set sql command as text
- ' Me.SetSqlByCommand(commandText)
- 'End Sub
-
-#End Region
-
-#Region "Insert"
-
- '''
- ''' Inserts async parameter values to database
- '''
- '''
- '''
- Public Sub InsertTask(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue)
- Dim filename As String = String.Empty
- filename = "AsyncProcessingServiceInsert.sql"
-
- ' Get SQL query from file.
- Me.SetSqlByFile2(filename)
-
- ' Set SQL parameter values
- Me.SetParameter("P2", asyncParameterValue.UserId)
- Me.SetParameter("P3", asyncParameterValue.ProcessName)
- Me.SetParameter("P4", asyncParameterValue.Data)
- Me.SetParameter("P5", asyncParameterValue.RegistrationDateTime)
- Me.SetParameter("P6", DBNull.Value)
- Me.SetParameter("P7", asyncParameterValue.NumberOfRetries)
- Me.SetParameter("P8", DBNull.Value)
- Me.SetParameter("P9", asyncParameterValue.StatusId)
- Me.SetParameter("P10", asyncParameterValue.ProgressRate)
- Me.SetParameter("P11", asyncParameterValue.CommandId)
- Me.SetParameter("P12", asyncParameterValue.ReservedArea)
-
- ' Execute SQL query
- asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery()
- End Sub
-
- #End Region
-
- #Region "Update"
-
- #Region "UpdateTaskStart"
-
- '''
- ''' Updates information in the database that the asynchronous task is started
- '''
- ''' Asynchronous Parameter Values
- ''' Asynchronous Return Values
- Public Sub UpdateTaskStart(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue)
- Dim filename As String = String.Empty
- filename = "UpdateTaskStart.sql"
-
- ' Get SQL query from file.
- Me.SetSqlByFile2(filename)
-
- ' Set SQL parameter values
- Me.SetParameter("P1", asyncParameterValue.TaskId)
- Me.SetParameter("P2", asyncParameterValue.ExecutionStartDateTime)
- Me.SetParameter("P3", asyncParameterValue.StatusId)
- Me.SetParameter("P4", DBNull.Value)
-
- ' Execute SQL query
- asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery()
- End Sub
-
- #End Region
-
- #Region "UpdateTaskRetry"
-
- '''
- ''' Updates information in the database that the asynchronous task is failed and can be retried later
- '''
- ''' Asynchronous Parameter Values
- ''' Asynchronous Return Values
- Public Sub UpdateTaskRetry(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue)
- Dim filename As String = String.Empty
- filename = "UpdateTaskRetry.sql"
-
- ' Get SQL query from file.
- Me.SetSqlByFile2(filename)
-
- ' Set SQL parameter values
- Me.SetParameter("P1", asyncParameterValue.TaskId)
- Me.SetParameter("P2", asyncParameterValue.NumberOfRetries)
- Me.SetParameter("P3", asyncParameterValue.CompletionDateTime)
- Me.SetParameter("P4", asyncParameterValue.StatusId)
- Me.SetParameter("P5", asyncParameterValue.ExceptionInfo)
-
- ' Execute SQL query
- asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery()
- End Sub
-
- #End Region
-
- #Region "UpdateTaskFail"
-
- '''
- ''' Updates information in the database that the asynchronous task is failed and abort this task [status=Abort]
- '''
- ''' Asynchronous Parameter Values
- ''' Asynchronous Return Values
- Public Sub UpdateTaskFail(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue)
- Dim filename As String = String.Empty
- filename = "UpdateTaskFail.sql"
-
- ' Get SQL query from file.
- Me.SetSqlByFile2(filename)
-
- ' Set SQL parameter values
- Me.SetParameter("P1", asyncParameterValue.TaskId)
- Me.SetParameter("P2", asyncParameterValue.CompletionDateTime)
- Me.SetParameter("P3", asyncParameterValue.StatusId)
- Me.SetParameter("P4", asyncParameterValue.ExceptionInfo)
-
- ' Execute SQL query
- asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery()
- End Sub
-
- #End Region
-
- #Region "UpdateTaskSuccess"
-
- '''
- ''' Updates information in the database that the asynchronous task is completed
- '''
- ''' Asynchronous Parameter Values
- ''' Asynchronous Return Values
- Public Sub UpdateTaskSuccess(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue)
- Dim filename As String = String.Empty
- filename = "UpdateTaskSuccess.sql"
-
- ' Get SQL query from file.
- Me.SetSqlByFile2(filename)
-
- ' Set SQL parameter values
- Me.SetParameter("P1", asyncParameterValue.TaskId)
- Me.SetParameter("P2", asyncParameterValue.CompletionDateTime)
- Me.SetParameter("P3", asyncParameterValue.ProgressRate)
- Me.SetParameter("P4", asyncParameterValue.StatusId)
-
- ' Execute SQL query
- asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery()
- End Sub
-
- #End Region
-
- #Region "UpdateTaskProgress"
-
- '''
- ''' Updates progress rate of the asynchronous task in the database.
- '''
- ''' Asynchronous Parameter Values
- ''' Asynchronous Return Values
- Public Sub UpdateTaskProgress(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue)
- Dim filename As String = String.Empty
- filename = "UpdateTaskProgress.sql"
-
- ' Get SQL query from file.
- Me.SetSqlByFile2(filename)
-
- ' Set SQL parameter values
- Me.SetParameter("P1", asyncParameterValue.TaskId)
- Me.SetParameter("P2", asyncParameterValue.ProgressRate)
-
- ' Execute SQL query
- asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery()
- End Sub
-
- #End Region
-
- #Region "UpdateTaskCommand"
-
- '''
- ''' Updates command value information of a selected asynchronous task
- '''
- ''' Asynchronous Parameter Values
- ''' Asynchronous Return Values
- Public Sub UpdateTaskCommand(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue)
- Dim filename As String = String.Empty
- filename = "UpdateTaskCommand.sql"
-
- ' Get SQL query from file.
- Me.SetSqlByFile2(filename)
-
- ' Set SQL parameter values
- Me.SetParameter("P1", asyncParameterValue.TaskId)
- Me.SetParameter("P2", asyncParameterValue.CommandId)
-
- ' Execute SQL query
- asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery()
- End Sub
-
- #End Region
-
- #Region "StopAllTask"
-
- '''
- ''' Set stop command for all running asynchronous task.
- '''
- ''' Asynchronous Parameter Values
- ''' Asynchronous Return Values
- Public Sub StopAllTask(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue)
- Dim filename As String = String.Empty
- filename = "StopAllTask.sql"
-
- ' Get SQL query from file.
- Me.SetSqlByFile2(filename)
-
- ' Set SQL parameter values
- Me.SetParameter("P1", asyncParameterValue.StatusId)
- Me.SetParameter("P2", asyncParameterValue.CommandId)
-
- ' Execute SQL query
- asyncReturnValue.Obj = Me.ExecInsUpDel_NonQuery()
- End Sub
-
- #End Region
-
- #End Region
-
- #Region "Select"
-
- #Region "SelectCommand"
-
- '''
- ''' Selects user command from database
- '''
- ''' Asynchronous Parameter Values
- ''' Asynchronous Return Values
- Public Sub SelectCommand(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue)
- Dim filename As String = String.Empty
- filename = "SelectCommand.sql"
-
- ' Get SQL query from file.
- Me.SetSqlByFile2(filename)
-
- ' Set SQL parameter values
- Me.SetParameter("P1", asyncParameterValue.TaskId)
-
- ' Execute SQL query
- asyncReturnValue.Obj = Me.ExecSelectScalar()
- End Sub
-
- #End Region
-
- #Region "SelectTask"
-
- '''
- ''' To get Asynchronous Task from the database
- '''
- '''
- '''
- Public Sub SelectTask(asyncParameterValue As AsyncProcessingServiceParameterValue, asyncReturnValue As AsyncProcessingServiceReturnValue)
- Dim filename As String = String.Empty
- filename = "SelectTask.sql"
-
- ' Get SQL query from file.
- Me.SetSqlByFile2(filename)
-
- ' Set SQL parameter values
- Me.SetParameter("P1", asyncParameterValue.RegistrationDateTime)
- Me.SetParameter("P2", asyncParameterValue.NumberOfRetries)
- Me.SetParameter("P3", CInt(AsyncProcessingServiceParameterValue.AsyncStatus.Register))
- Me.SetParameter("P4", CInt(AsyncProcessingServiceParameterValue.AsyncStatus.AbnormalEnd))
- Me.SetParameter("P7", asyncParameterValue.CompletionDateTime)
-
- Dim dt As New DataTable()
-
- ' Get Asynchronous Task from the database
- Me.ExecSelectFill_DT(dt)
- asyncReturnValue.Obj = dt
- End Sub
-
- #End Region
-
- #End Region
- End Class
-End Namespace
diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/Business.vbproj b/root/programs/VB/Frameworks/Infrastructure/Business/Business.vbproj
index b18a4fe..8233002 100644
--- a/root/programs/VB/Frameworks/Infrastructure/Business/Business.vbproj
+++ b/root/programs/VB/Frameworks/Infrastructure/Business/Business.vbproj
@@ -60,24 +60,29 @@
- ..\..\..\..\C#\Frameworks\Infrastructure\Build\OpenTouryo.DamManagedOdp.dll
+ ..\..\..\..\CS\Frameworks\Infrastructure\Build\OpenTouryo.DamManagedOdp.dll
- ..\..\..\..\C#\Frameworks\Infrastructure\Build\OpenTouryo.DamMySQL.dll
+ ..\..\..\..\CS\Frameworks\Infrastructure\Build\OpenTouryo.DamMySQL.dll
- ..\..\..\..\C#\Frameworks\Infrastructure\Build\OpenTouryo.DamPstGrS.dll
+ ..\..\..\..\CS\Frameworks\Infrastructure\Build\OpenTouryo.DamPstGrS.dll
- ..\..\..\..\C#\Frameworks\Infrastructure\Build\OpenTouryo.Framework.dll
+ ..\..\..\..\CS\Frameworks\Infrastructure\Build\OpenTouryo.Framework.dll
- ..\..\..\..\C#\Frameworks\Infrastructure\Build\OpenTouryo.Public.dll
+ ..\..\..\..\CS\Frameworks\Infrastructure\Build\OpenTouryo.Public.dll
+
+
+ ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll
+ True
+
@@ -89,10 +94,11 @@
-
-
-
-
+
+
+
+
+
@@ -121,6 +127,9 @@
MyApplicationCodeGenerator
Application.Designer.vb
+
+ Designer
+
@@ -142,6 +151,7 @@
+
diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/Dao/CmnDao.vb b/root/programs/VB/Frameworks/Infrastructure/Business/Dao/CmnDao.vb
index d69a55d..243824c 100644
--- a/root/programs/VB/Frameworks/Infrastructure/Business/Dao/CmnDao.vb
+++ b/root/programs/VB/Frameworks/Infrastructure/Business/Dao/CmnDao.vb
@@ -39,8 +39,13 @@
'* 2013/07/07 西野 大介 ExecGenerateSQL(SQL生成)メソッド(実行しない)を追加
'* 2014/11/20 Sandeep Implemented CommandTimeout property and SetCommandTimeout method.
'* 2014/11/20 Sai removed IDbCommand property in SetCommandTimeout method.
+'* 2018/08/07 西野 大介 ストアド実行のためCommandType.StoredProcedureを設定可能に。
'**********************************************************************************
+Imports System
+Imports System.Data
+Imports System.Collections.Generic
+
Imports Touryo.Infrastructure.Business.Exceptions
Imports Touryo.Infrastructure.Framework.Exceptions
Imports Touryo.Infrastructure.Public.Db
@@ -52,6 +57,9 @@ Namespace Touryo.Infrastructure.Business.Dao
Inherits MyBaseDao
#Region "インスタンス変数"
+ ''' CommandType
+ Private _cmdType As System.Nullable(Of CommandType) = Nothing
+
#Region "パラメタ"
''' ユーザ パラメタ(文字列置換)用ディクショナリ
@@ -60,12 +68,14 @@ Namespace Touryo.Infrastructure.Business.Dao
''' パラメタ ライズド クエリのパラメタ用ディクショナリ
Private DicParameter As New Dictionary(Of String, Object)()
+ #Region "追加のDictionary"
''' パラメタ ライズド クエリの指定されたパラメータ(の型)を保持するディクショナリ
Private DicParameterType As New Dictionary(Of String, Object)()
''' パラメタ ライズド クエリの指定されたパラメータ(のサイズ)を保持するディクショナリ
Private DicParameterSize As New Dictionary(Of String, Integer)()
''' パラメタ ライズド クエリの指定されたパラメータ(の方向)を保持するディクショナリ
Private DicParameterDirection As New Dictionary(Of String, ParameterDirection)()
+ #End Region
#End Region
@@ -216,7 +226,7 @@ Namespace Touryo.Infrastructure.Business.Dao
''' CommandTimeout
''' 自由に(拡張して)利用できる。
Public WriteOnly Property CommandTimeout() As Integer
- Set(value As Integer)
+ Set
Me._commandTimeout = value
End Set
End Property
@@ -235,6 +245,13 @@ Namespace Touryo.Infrastructure.Business.Dao
MyBase.New(dam)
End Sub
+ ''' コンストラクタ
+ ''' 自由に利用できる。
+ Public Sub New(dam As BaseDam, cmdType As CommandType)
+ MyBase.New(dam)
+ Me._cmdType = cmdType
+ End Sub
+
#End Region
#Region "クエリ メソッド"
@@ -246,10 +263,10 @@ Namespace Touryo.Infrastructure.Business.Dao
''' 自由に(拡張して)利用できる。
Public Shadows Function ExecSelectScalar() As Object
' SQLの設定
- Me.SetSQL()
+ Me.SetSQL()
- ' To Set CommandTimeout
- Me.SetCommandTimeout()
+ ' Set CommandTimeout
+ Me.SetCommandTimeout()
' パラメタの一括設定
Me.SetParameters()
@@ -264,10 +281,10 @@ Namespace Touryo.Infrastructure.Business.Dao
''' 自由に(拡張して)利用できる。
Public Shadows Sub ExecSelectFill_DT(dt As DataTable)
' SQLの設定
- Me.SetSQL()
+ Me.SetSQL()
- ' To Set CommandTimeout
- Me.SetCommandTimeout()
+ ' Set CommandTimeout
+ Me.SetCommandTimeout()
' パラメタの一括設定
Me.SetParameters()
@@ -282,10 +299,10 @@ Namespace Touryo.Infrastructure.Business.Dao
''' 自由に(拡張して)利用できる。
Public Shadows Sub ExecSelectFill_DS(ds As DataSet)
' SQLの設定
- Me.SetSQL()
+ Me.SetSQL()
- ' To Set CommandTimeout
- Me.SetCommandTimeout()
+ ' Set CommandTimeout
+ Me.SetCommandTimeout()
' パラメタの一括設定
Me.SetParameters()
@@ -300,10 +317,10 @@ Namespace Touryo.Infrastructure.Business.Dao
''' 自由に(拡張して)利用できる。
Public Shadows Function ExecSelect_DR() As IDataReader
' SQLの設定
- Me.SetSQL()
+ Me.SetSQL()
- ' To Set CommandTimeout
- Me.SetCommandTimeout()
+ ' Set CommandTimeout
+ Me.SetCommandTimeout()
' パラメタの一括設定
Me.SetParameters()
@@ -318,10 +335,10 @@ Namespace Touryo.Infrastructure.Business.Dao
''' 自由に(拡張して)利用できる。
Public Shadows Function ExecInsUpDel_NonQuery() As Integer
' SQLの設定
- Me.SetSQL()
+ Me.SetSQL()
- ' To Set CommandTimeout
- Me.SetCommandTimeout()
+ ' Set CommandTimeout
+ Me.SetCommandTimeout()
' パラメタの一括設定
Me.SetParameters()
@@ -337,10 +354,10 @@ Namespace Touryo.Infrastructure.Business.Dao
''' 自由に(拡張して)利用できる。
Public Shadows Function ExecGenerateSQL(sqlUtil As SQLUtility) As String
' SQLの設定
- Me.SetSQL()
+ Me.SetSQL()
- ' To Set CommandTimeout
- Me.SetCommandTimeout()
+ ' Set CommandTimeout
+ Me.SetCommandTimeout()
' パラメタの一括設定
Me.SetParameters()
@@ -359,24 +376,33 @@ Namespace Touryo.Infrastructure.Business.Dao
' SQL指定
If Me._sQLFileName <> "" Then
' ファイルから
- Me.SetSqlByFile2(Me._sQLFileName)
+ If Me._cmdType.HasValue Then
+ Me.SetSqlByFile2(Me._sQLFileName, Me._cmdType.Value)
+ Else
+ Me.SetSqlByFile2(Me._sQLFileName)
+ End If
ElseIf Me._sQLText <> "" Then
' テキストから
- Me.SetSqlByCommand(Me._sQLText)
+ If Me._cmdType.HasValue Then
+ Me.SetSqlByCommand(Me._sQLText, Me._cmdType.Value)
+ Else
+ Me.SetSqlByCommand(Me._sQLText)
+
+ End If
Else
' SQLエラー
Throw New BusinessSystemException(MyBusinessSystemExceptionMessage.CMN_DAO_ERROR(0), [String].Format(MyBusinessSystemExceptionMessage.CMN_DAO_ERROR(1), MyBusinessSystemExceptionMessage.CMN_DAO_ERROR_SQL))
End If
- End Sub
-
- ''' To Set CommandTimeout
- Private Sub SetCommandTimeout()
- ' If CommandTimeout is >= 0 then set CommandTimeout.
- ' Else skip, automatically it will set default CommandTimeout.
- If Me._commandTimeout >= 0 Then
- Me.GetDam().DamIDbCommand.CommandTimeout = Me._commandTimeout
- End If
- End Sub
+ End Sub
+
+ ''' To Set CommandTimeout
+ Private Sub SetCommandTimeout()
+ ' If CommandTimeout is >= 0 then set CommandTimeout.
+ ' Else skip, automatically it will set default CommandTimeout.
+ If Me._commandTimeout >= 0 Then
+ Me.GetDam().DamIDbCommand.CommandTimeout = Me._commandTimeout
+ End If
+ End Sub
''' パラメタの一括設定(内部用)
Private Sub SetParameters()
diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/Dao/MyBaseDao.vb b/root/programs/VB/Frameworks/Infrastructure/Business/Dao/MyBaseDao.vb
index e829404..c2de176 100644
--- a/root/programs/VB/Frameworks/Infrastructure/Business/Dao/MyBaseDao.vb
+++ b/root/programs/VB/Frameworks/Infrastructure/Business/Dao/MyBaseDao.vb
@@ -33,9 +33,12 @@
'* 2012/06/14 西野 大介 SetSqlByFile2を追加(SetSqlByFile強化版)
'* ・sqlTextFilePathを自動連結
'* ・EmbeddedResourceLoaderに対応
+'* 2018/08/07 西野 大介 CommandType.StoredProcedureを設定可能に。
'**********************************************************************************
+Imports System
Imports System.IO
+Imports System.Data
Imports Touryo.Infrastructure.Business.Util
Imports Touryo.Infrastructure.Framework.Dao
@@ -54,13 +57,28 @@ Namespace Touryo.Infrastructure.Business.Dao
''' SetSqlByFileの強化版メソッド
''' ファイル名
Public Sub SetSqlByFile2(sQLFileName As String)
+ Me.SetSqlByFile2(sQLFileName, Nothing)
+ End Sub
+
+ ''' SetSqlByFileの強化版メソッド
+ ''' ファイル名
+ ''' CommandType
+ Public Sub SetSqlByFile2(sQLFileName As String, cmdType As System.Nullable(Of CommandType))
' SQLを設定する。
If MyBaseDao.UseEmbeddedResource Then
' 埋め込まれたリソースファイル
- Me.SetSqlByFile(GetConfigParameter.GetConfigValue("sqlTextFilePath") & "." & sQLFileName)
+ If cmdType.HasValue Then
+ Me.SetSqlByFile(GetConfigParameter.GetConfigValue("sqlTextFilePath") & "." & sQLFileName, cmdType.Value)
+ Else
+ Me.SetSqlByFile(GetConfigParameter.GetConfigValue("sqlTextFilePath") & "." & sQLFileName)
+ End If
Else
' 通常のファイル
- Me.SetSqlByFile(Path.Combine(GetConfigParameter.GetConfigValue("sqlTextFilePath"), sQLFileName))
+ If cmdType.HasValue Then
+ Me.SetSqlByFile(Path.Combine(GetConfigParameter.GetConfigValue("sqlTextFilePath"), sQLFileName), cmdType.Value)
+ Else
+ Me.SetSqlByFile(Path.Combine(GetConfigParameter.GetConfigValue("sqlTextFilePath"), sQLFileName))
+ End If
End If
End Sub
@@ -103,50 +121,48 @@ Namespace Touryo.Infrastructure.Business.Dao
' 性能測定終了
Me.perfRec.EndsPerformanceRecord()
- ' SQLトレースログ出力
-
- ' ------------
- ' メッセージ部
- ' ------------
- ' 処理時間(実行時間), 処理時間(CPU時間), 実行したSQLの情報
- ' ------------
- Dim strLogMessage As String =
- Me.perfRec.ExecTime &
- "," & Me.perfRec.CpuTime & "," & sql
-
- ' Log4Netへログ出力
- If String.IsNullOrEmpty(GetConfigParameter.GetConfigValue(PubLiteral.SQL_TRACELOG)) Then
- ' SQLトレースログ(OFF)
- ElseIf GetConfigParameter.GetConfigValue(PubLiteral.SQL_TRACELOG).ToUpper() = PubLiteral.[ON] Then
- LogIF.InfoLog("SQLTRACE", strLogMessage)
- ElseIf GetConfigParameter.GetConfigValue(PubLiteral.SQL_TRACELOG).ToUpper() = PubLiteral.OFF Then
- ' SQLトレースログ(OFF)
- Else
- ' パラメータ・エラー(書式不正)
- Throw New ArgumentException([String].Format(PublicExceptionMessage.SWITCH_ERROR, PubLiteral.SQL_TRACELOG))
- End If
-
- ' ---
-
- ' 以下も、ログ出力で使用可能
- Dim obj As Object = Nothing
-
- ' UOC_Connection等で情報を設定しておく。
- ' UserInfoなどの情報を想定している。
- obj = Me.GetDam().Obj
-
- ' SQL実行時に情報が自動設定される。
- ' ・ExecSelectFill_DT
- ' DataTable
- ' ・ExecSelectFill_DS
- ' DataSet
- ' ・ExecSelect_DR
- ' IDataReader
- ' ・ExecSelectScalar
- ' object
- ' ・ExecInsUpDel_NonQuery
- ' int
- obj = Me.LogInfo
+ ' SQLトレースログ出力
+
+ ' ------------
+ ' メッセージ部
+ ' ------------
+ ' 処理時間(実行時間), 処理時間(CPU時間), 実行したSQLの情報
+ ' ------------
+ Dim strLogMessage As String = Convert.ToString(Me.perfRec.ExecTime) & "," & Convert.ToString(Me.perfRec.CpuTime) & "," & sql
+
+ ' Log4Netへログ出力
+ ' SQLトレースログ(OFF)
+ If String.IsNullOrEmpty(GetConfigParameter.GetConfigValue(PubLiteral.SQL_TRACELOG)) Then
+ ElseIf GetConfigParameter.GetConfigValue(PubLiteral.SQL_TRACELOG).ToUpper() = PubLiteral.[ON] Then
+ LogIF.InfoLog("SQLTRACE", strLogMessage)
+ ' SQLトレースログ(OFF)
+ ElseIf GetConfigParameter.GetConfigValue(PubLiteral.SQL_TRACELOG).ToUpper() = PubLiteral.OFF Then
+ Else
+ ' パラメータ・エラー(書式不正)
+ Throw New ArgumentException([String].Format(PublicExceptionMessage.SWITCH_ERROR, PubLiteral.SQL_TRACELOG))
+ End If
+
+ ' ---
+
+ ' 以下も、ログ出力で使用可能
+ Dim obj As Object = Nothing
+
+ ' UOC_Connection等で情報を設定しておく。
+ ' UserInfoなどの情報を想定している。
+ obj = Me.GetDam().Obj
+
+ ' SQL実行時に情報が自動設定される。
+ ' ・ExecSelectFill_DT
+ ' DataTable
+ ' ・ExecSelectFill_DS
+ ' DataSet
+ ' ・ExecSelect_DR
+ ' IDataReader
+ ' ・ExecSelectScalar
+ ' object
+ ' ・ExecInsUpDel_NonQuery
+ ' int
+ obj = Me.LogInfo
End Sub
''' SQL実行終了処理を実装する共通UOCメソッド(異常時)
@@ -157,51 +173,48 @@ Namespace Touryo.Infrastructure.Business.Dao
' 性能測定終了
Me.perfRec.EndsPerformanceRecord()
- ' SQLトレースログ出力
-
- ' ------------
- ' メッセージ部
- ' ------------
- ' 処理時間(実行時間), 処理時間(CPU時間), ユーザ名, 実行したSQLの情報
- ' ------------
- Dim strLogMessage As String =
- Me.perfRec.ExecTime &
- "," & Me.perfRec.CpuTime &
- "," & DirectCast(Me.GetDam().Obj, MyUserInfo).UserName & "," & sql
-
- ' Log4Netへログ出力
- If String.IsNullOrEmpty(GetConfigParameter.GetConfigValue(PubLiteral.SQL_TRACELOG)) Then
- ' SQLトレースログ(OFF)
- ElseIf GetConfigParameter.GetConfigValue(PubLiteral.SQL_TRACELOG).ToUpper() = PubLiteral.[ON] Then
- LogIF.ErrorLog("SQLTRACE", strLogMessage)
- ElseIf GetConfigParameter.GetConfigValue(PubLiteral.SQL_TRACELOG).ToUpper() = PubLiteral.OFF Then
- ' SQLトレースログ(OFF)
- Else
- ' パラメータ・エラー(書式不正)
- Throw New ArgumentException([String].Format(PublicExceptionMessage.SWITCH_ERROR, PubLiteral.SQL_TRACELOG))
- End If
-
- ' ---
-
- ' 以下も、ログ出力で使用可能
- Dim obj As Object = Nothing
-
- ' UOC_Connection等で情報を設定しておく。
- ' UserInfoなどの情報を想定している。
- obj = Me.GetDam().Obj
-
- ' SQL実行時に情報が自動設定される。
- ' ・ExecSelectFill_DT
- ' DataTable
- ' ・ExecSelectFill_DS
- ' DataSet
- ' ・ExecSelect_DR
- ' IDataReader
- ' ・ExecSelectScalar
- ' object
- ' ・ExecInsUpDel_NonQuery
- ' int
- obj = Me.LogInfo
+ ' SQLトレースログ出力
+
+ ' ------------
+ ' メッセージ部
+ ' ------------
+ ' 処理時間(実行時間), 処理時間(CPU時間), ユーザ名, 実行したSQLの情報
+ ' ------------
+ Dim strLogMessage As String = (Convert.ToString(Me.perfRec.ExecTime) & "," & Convert.ToString(Me.perfRec.CpuTime) & ",") + DirectCast(Me.GetDam().Obj, MyUserInfo).UserName & "," & sql
+
+ ' Log4Netへログ出力
+ ' SQLトレースログ(OFF)
+ If String.IsNullOrEmpty(GetConfigParameter.GetConfigValue(PubLiteral.SQL_TRACELOG)) Then
+ ElseIf GetConfigParameter.GetConfigValue(PubLiteral.SQL_TRACELOG).ToUpper() = PubLiteral.[ON] Then
+ LogIF.ErrorLog("SQLTRACE", strLogMessage)
+ ' SQLトレースログ(OFF)
+ ElseIf GetConfigParameter.GetConfigValue(PubLiteral.SQL_TRACELOG).ToUpper() = PubLiteral.OFF Then
+ Else
+ ' パラメータ・エラー(書式不正)
+ Throw New ArgumentException([String].Format(PublicExceptionMessage.SWITCH_ERROR, PubLiteral.SQL_TRACELOG))
+ End If
+
+ ' ---
+
+ ' 以下も、ログ出力で使用可能
+ Dim obj As Object = Nothing
+
+ ' UOC_Connection等で情報を設定しておく。
+ ' UserInfoなどの情報を想定している。
+ obj = Me.GetDam().Obj
+
+ ' SQL実行時に情報が自動設定される。
+ ' ・ExecSelectFill_DT
+ ' DataTable
+ ' ・ExecSelectFill_DS
+ ' DataSet
+ ' ・ExecSelect_DR
+ ' IDataReader
+ ' ・ExecSelectScalar
+ ' object
+ ' ・ExecInsUpDel_NonQuery
+ ' int
+ obj = Me.LogInfo
End Sub
#End Region
diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/Util/MyCmnFunction.vb b/root/programs/VB/Frameworks/Infrastructure/Business/Util/MyCmnFunction.vb
new file mode 100644
index 0000000..6d75857
--- /dev/null
+++ b/root/programs/VB/Frameworks/Infrastructure/Business/Util/MyCmnFunction.vb
@@ -0,0 +1,256 @@
+'**********************************************************************************
+'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
+'**********************************************************************************
+
+#Region "Apache License"
+'
+' Licensed under the Apache License, Version 2.0 (the "License");
+' you may not use this file except in compliance with the License.
+' You may obtain a copy of the License at
+'
+' http://www.apache.org/licenses/LICENSE-2.0
+'
+' Unless required by applicable law or agreed to in writing, software
+' distributed under the License is distributed on an "AS IS" BASIS,
+' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+' See the License for the specific language governing permissions and
+' limitations under the License.
+'
+#End Region
+
+'**********************************************************************************
+'* クラス名 :MyCmnFunction
+'* クラス日本語名 :Business層の共通クラス(テンプレート)
+'*
+'* 作成者 :生技 西野
+'* 更新履歴 :
+'*
+'* 日時 更新者 内容
+'* ---------- ---------------- -------------------------------------------------
+'* 20xx/xx/xx XX XX 新規作成(テンプレート)
+'* 2009/06/02 西野 大介 sln - IR版からの修正
+'* ・#5 : コントロール数取得処理(デフォルト値不正)
+'* 2009/07/21 西野 大介 コントロール取得処理の仕様変更
+'* 2009/08/10 西野 大介 同名のコントロール追加に対応(GridView/ItemTemplate)。
+'* 2010/09/24 西野 大介 ジェネリック対応(Dictionary、List、Queue、Stack)
+'* nullチェック方法、Contains → ContainsKeyなどに注意
+'* 2010/10/21 西野 大介 幾つかのイベント処理の正式対応(ベースクラス2→1へ)
+'* 2012/06/14 西野 大介 コントロール検索の再帰処理性能の集約&効率化。
+'* 2014/05/16 西野 大介 キャスト可否チェックのロジックを見直した。
+'* 2017/01/31 西野 大介 System.Webを使用しているCalculateSessionSizeメソッドをPublicから移動
+'**********************************************************************************
+
+Imports System.Web
+Imports System.Web.UI
+Imports System.Web.UI.WebControls
+
+Imports Touryo.Infrastructure.Framework.Exceptions
+Imports Touryo.Infrastructure.Framework.Util
+Imports Touryo.Infrastructure.Public.IO
+Imports Touryo.Infrastructure.Public.Util
+
+Namespace Touryo.Infrastructure.Business.Util
+ ''' Business層の共通クラス
+ Public Class MyCmnFunction
+
+#Region "CalculateSessionSize"
+
+ ''' Sessionサイズ測定
+ ''' Sessionサイズ(MB)
+ ''' シリアル化できないオブジェクトを含む場合は落ちる。
+ Public Shared Function CalculateSessionSizeMB() As Long
+ 'return MyCmnFunction.CalculateSessionSizeKB() / 1000;
+ Return CLng(Math.Truncate(Math.Round(MyCmnFunction.CalculateSessionSize() / 1000000.0, 0, MidpointRounding.AwayFromZero)))
+
+ End Function
+
+ ''' Sessionサイズ測定
+ ''' Sessionサイズ(KB)
+ ''' シリアル化できないオブジェクトを含む場合は落ちる。
+ Public Shared Function CalculateSessionSizeKB() As Long
+ 'return MyCmnFunction.CalculateSessionSize() / 1000;
+ Return CLng(Math.Truncate(Math.Round(MyCmnFunction.CalculateSessionSize() / 1000.0, 0, MidpointRounding.AwayFromZero)))
+ End Function
+
+ ''' Sessionサイズ測定
+ ''' Sessionサイズ(バイト)
+ ''' シリアル化できないオブジェクトを含む場合は落ちる。
+ Public Shared Function CalculateSessionSize() As Long
+ ' ワーク変数
+ Dim size As Long = 0
+
+ ' SessionのオブジェクトをBinarySerializeしてサイズを取得。
+ For Each key As String In HttpContext.Current.Session.Keys
+ ' 当該キーのオブジェクト・サイズを足しこむ。
+ size += BinarySerialize.ObjectToBytes(HttpContext.Current.Session(key)).Length
+ Next
+
+ ' Sessionサイズ(バイト)
+ Return size
+ End Function
+
+#End Region
+
+ ' 2009/07/21-start
+
+#Region "コントロール取得&イベントハンドラ設定"
+
+ ''' コントロール取得&イベントハンドラ設定(下位互換)
+ ''' コントロール
+ ''' プレフィックス
+ ''' イベント ハンドラ
+ ''' ディクショナリ
+ Friend Shared Sub GetCtrlAndSetClickEventHandler(ctrl As Control, prefix As String, eventHandler As Object, controlHt As Dictionary(Of String, Control))
+ '#Region "チェック処理"
+
+ ' コントロール指定が無い場合
+ If ctrl Is Nothing Then
+ ' 何もしないで戻る。
+ Return
+ End If
+
+ ' プレフィックス指定が無い場合
+ If prefix Is Nothing OrElse prefix = "" Then
+ ' 何もしないで戻る。
+ Return
+ End If
+
+ '#End Region
+
+ '#Region "コントロール取得&イベントハンドラ設定"
+
+ ' コントロールのIDチェック
+ ' コントロールID無し
+ If ctrl.ID Is Nothing Then
+ Else
+ ' コントロールID有り
+
+ ' コントロールのID長確認
+ If prefix.Length <= ctrl.ID.Length Then
+ ' 指定のプレフィックス
+ If prefix = ctrl.ID.Substring(0, prefix.Length) Then
+ ' イベントハンドラを設定する。
+ If prefix = GetConfigParameter.GetConfigValue(MyLiteral.PREFIX_OF_CHECK_BOX) Then
+ ' CHECK BOX
+ Dim checkBox As CheckBox = Nothing
+
+ Try
+ ' キャストできる
+ checkBox = DirectCast(ctrl, CheckBox)
+ Catch ex As Exception
+ ' キャストできない
+ Throw New FrameworkException(
+ FrameworkExceptionMessage.CONTROL_TYPE_ERROR(0),
+ [String].Format(FrameworkExceptionMessage.CONTROL_TYPE_ERROR(1), prefix, ctrl.[GetType]().ToString()), ex)
+ End Try
+
+ AddHandler checkBox.CheckedChanged, DirectCast(eventHandler, EventHandler)
+
+ ' ディクショナリに格納
+ ' ControlHt.Add(ctrl.ID, ctrl);
+ ' ControlHt[ctrl.ID] = ctrl;
+ ' 2011/02/12
+ FxCmnFunction.AddControlToDic(ctrl, controlHt)
+ End If
+ End If
+ End If
+ End If
+
+ '#End Region
+
+ '#Region "再帰"
+
+ ' 子コントロールがある場合、
+ If ctrl.HasControls() Then
+ ' 子コントロール毎に
+ For Each childCtrl As Control In ctrl.Controls
+ ' 再帰する。
+ MyCmnFunction.GetCtrlAndSetClickEventHandler(childCtrl, prefix, eventHandler, controlHt)
+ Next
+ End If
+
+ '#End Region
+ End Sub
+
+ ''' コントロール取得&イベントハンドラ設定
+ ''' コントロール
+ ''' プレフィックスとイベント ハンドラのディクショナリ
+ ''' コントロールのディクショナリ
+ Friend Shared Sub GetCtrlAndSetClickEventHandler2(ctrl As Control, prefixAndEvtHndHt As Dictionary(Of String, Object), controlHt As Dictionary(Of String, Control))
+ ' ループ
+ For Each prefix As String In prefixAndEvtHndHt.Keys
+ Dim eventHandler As Object = prefixAndEvtHndHt(prefix)
+
+ '#Region "チェック処理"
+
+ ' コントロール指定が無い場合
+ If ctrl Is Nothing Then
+ ' 何もしないで戻る。
+ Return
+ End If
+
+ ' プレフィックス指定が無い場合
+ If prefix Is Nothing OrElse prefix = "" Then
+ ' 何もしないで戻る。
+ Return
+ End If
+
+ '#End Region
+
+ '#Region "コントロール取得&イベントハンドラ設定"
+
+ ' コントロールのIDチェック
+ ' コントロールID無し
+ If ctrl.ID Is Nothing Then
+ Else
+ ' コントロールID有り
+
+ ' コントロールのID長確認
+ If prefix.Length <= ctrl.ID.Length Then
+ ' 指定のプレフィックス
+ If prefix = ctrl.ID.Substring(0, prefix.Length) Then
+ ' イベントハンドラを設定する。
+ If prefix = GetConfigParameter.GetConfigValue(MyLiteral.PREFIX_OF_CHECK_BOX) Then
+ ' CHECK BOX
+ Dim checkBox As CheckBox = Nothing
+
+ If TypeOf ctrl Is CheckBox Then
+ ' キャストできる
+ checkBox = DirectCast(ctrl, CheckBox)
+ Else
+ ' キャストできない
+ Throw New FrameworkException(FrameworkExceptionMessage.CONTROL_TYPE_ERROR(0), [String].Format(FrameworkExceptionMessage.CONTROL_TYPE_ERROR(1), prefix, ctrl.[GetType]().ToString()))
+ End If
+
+ AddHandler checkBox.CheckedChanged, DirectCast(eventHandler, EventHandler)
+
+ ' ディクショナリに格納
+ controlHt(ctrl.ID) = ctrl
+ Exit For
+ End If
+ End If
+ End If
+
+ '#End Region
+ End If
+ Next
+
+ '#Region "再帰"
+
+ ' 子コントロールがある場合、
+ If ctrl.HasControls() Then
+ ' 子コントロール毎に
+ For Each childCtrl As Control In ctrl.Controls
+ ' 再帰する。
+ MyCmnFunction.GetCtrlAndSetClickEventHandler2(childCtrl, prefixAndEvtHndHt, controlHt)
+ Next
+ End If
+
+ '#End Region
+ End Sub
+
+#End Region
+
+ ' 2009/07/21-end
+ End Class
+End Namespace
diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/Util/MyTimeZone.vb b/root/programs/VB/Frameworks/Infrastructure/Business/Util/MyTimeZone.vb
new file mode 100644
index 0000000..f4421cf
--- /dev/null
+++ b/root/programs/VB/Frameworks/Infrastructure/Business/Util/MyTimeZone.vb
@@ -0,0 +1,167 @@
+'**********************************************************************************
+'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
+'**********************************************************************************
+
+#Region "Apache License"
+'
+' Licensed under the Apache License, Version 2.0 (the "License");
+' you may not use this file except in compliance with the License.
+' You may obtain a copy of the License at
+'
+' http://www.apache.org/licenses/LICENSE-2.0
+'
+' Unless required by applicable law or agreed to in writing, software
+' distributed under the License is distributed on an "AS IS" BASIS,
+' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+' See the License for the specific language governing permissions and
+' limitations under the License.
+'
+#End Region
+
+'**********************************************************************************
+'* クラス名 :MyTimeZone
+'* クラス日本語名 :TimeZoneのIDとオフセット(分)の管理クラス
+'*
+'* 作成者 :生技 西野
+'* 更新履歴 :
+'*
+'* 日時 更新者 内容
+'* ---------- ---------------- -------------------------------------------------
+'* 2012/06/20 西野 大介 新規作成
+'**********************************************************************************
+
+Namespace Touryo.Infrastructure.Business.Util
+ '''
+ ''' TimeZoneのIDとオフセット(分)の管理クラス
+ '''
+ '''
+ ''' TimeZoneInfo.GetSystemTimeZones()から取得した情報を基に作成
+ '''
+ Friend Class MyTimeZone
+ ''' TimeZoneのIDとオフセット(分)のディクショナリ
+ Private Shared ReadOnly TimeZoneDictionary As New Dictionary(Of MyTimeZoneEnum, Integer)()
+
+#Region "コンストラクタ"
+
+ '''
+ ''' コンストラクタ
+ ''' TimeZoneのIDに対応するオフセット(分)を指定(定義から読む等の変更可能)
+ '''
+ Public Sub New()
+ ' UTCと指定のTimeZoneとの時差を分単位で設定する。
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.MoroccoStandardTime, 0)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.GMTStandardTime, 0)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.GreenwichStandardTime, 0)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.UTC, 0)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.W_EuropeStandardTime, 60)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.NamibiaStandardTime, 60)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.CentralEuropeanStandardTime, 60)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.RomanceStandardTime, 60)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.CentralEuropeStandardTime, 60)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.W_CentralAfricaStandardTime, 60)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.GTBStandardTime, 120)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.JordanStandardTime, 120)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.TurkeyStandardTime, 120)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.IsraelStandardTime, 120)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.EgyptStandardTime, 120)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.SyriaStandardTime, 120)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.E_EuropeStandardTime, 120)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.SouthAfricaStandardTime, 120)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.FLEStandardTime, 120)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.MiddleEastStandardTime, 120)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.KaliningradStandardTime, 180)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.ArabStandardTime, 180)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.E_AfricaStandardTime, 180)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.ArabicStandardTime, 180)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.IranStandardTime, 210)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.ArabianStandardTime, 240)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.ArmenianStandardTime, 240)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.CaucasusStandardTime, 240)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.GeorgianStandardTime, 240)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.AzerbaijanStandardTime, 240)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.MauritiusStandardTime, 240)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.RussianStandardTime, 240)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.AfghanistanStandardTime, 270)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.PakistanStandardTime, 300)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.WestAsiaStandardTime, 300)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.SriLankaStandardTime, 330)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.IndiaStandardTime, 330)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.NepalStandardTime, 345)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.CentralAsiaStandardTime, 360)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.EkaterinburgStandardTime, 360)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.BangladeshStandardTime, 360)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.MyanmarStandardTime, 390)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.N_CentralAsiaStandardTime, 420)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.SEAsiaStandardTime, 420)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.UlaanbaatarStandardTime, 480)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.SingaporeStandardTime, 480)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.NorthAsiaStandardTime, 480)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.W_AustraliaStandardTime, 480)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.ChinaStandardTime, 480)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.TaipeiStandardTime, 480)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.NorthAsiaEastStandardTime, 540)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.KoreaStandardTime, 540)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.TokyoStandardTime, 540)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.Cen_AustraliaStandardTime, 570)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.AUSCentralStandardTime, 570)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.AUSEasternStandardTime, 600)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.WestPacificStandardTime, 600)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.E_AustraliaStandardTime, 600)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.TasmaniaStandardTime, 600)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.YakutskStandardTime, 600)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.VladivostokStandardTime, 660)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.CentralPacificStandardTime, 660)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.NewZealandStandardTime, 720)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.FijiStandardTime, 720)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.KamchatkaStandardTime, 720)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.MagadanStandardTime, 720)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.UTC_12, 720)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.SamoaStandardTime, 780)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.TongaStandardTime, 780)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.AzoresStandardTime, -60)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.CapeVerdeStandardTime, -60)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.Mid_AtlanticStandardTime, -120)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.UTC_02, -120)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.SAEasternStandardTime, -180)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.GreenlandStandardTime, -180)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.BahiaStandardTime, -180)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.ArgentinaStandardTime, -180)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.E_SouthAmericaStandardTime, -180)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.MontevideoStandardTime, -180)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.NewfoundlandStandardTime, -210)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.ParaguayStandardTime, -240)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.CentralBrazilianStandardTime, -240)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.PacificSAStandardTime, -240)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.SAWesternStandardTime, -240)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.AtlanticStandardTime, -240)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.VenezuelaStandardTime, -270)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.USEasternStandardTime, -300)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.SAPacificStandardTime, -300)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.EasternStandardTime, -300)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.CentralStandardTime_Mexico, -360)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.MexicoStandardTime, -360)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.CanadaCentralStandardTime, -360)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.CentralAmericaStandardTime, -360)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.CentralStandardTime, -360)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.USMountainStandardTime, -420)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.MountainStandardTime_Mexico, -420)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.MexicoStandardTime2, -420)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.MountainStandardTime, -420)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.PacificStandardTime_Mexico, -480)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.PacificStandardTime, -480)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.AlaskanStandardTime, -540)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.HawaiianStandardTime, -600)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.UTC_11, -660)
+ MyTimeZone.TimeZoneDictionary.Add(MyTimeZoneEnum.DatelineStandardTime, -720)
+ End Sub
+
+#End Region
+
+ ''' TimeZoneのオフセットを取得
+ '''
+ ''' TimeZoneのオフセット(分)
+ Public Function GetTimezoneOffset(myTimeZoneEnum As MyTimeZoneEnum) As Integer
+ Return MyTimeZone.TimeZoneDictionary(myTimeZoneEnum)
+ End Function
+ End Class
+End Namespace
diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/Util/MyTimeZoneEnum.vb b/root/programs/VB/Frameworks/Infrastructure/Business/Util/MyTimeZoneEnum.vb
new file mode 100644
index 0000000..b5580d2
--- /dev/null
+++ b/root/programs/VB/Frameworks/Infrastructure/Business/Util/MyTimeZoneEnum.vb
@@ -0,0 +1,245 @@
+'**********************************************************************************
+'* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
+'**********************************************************************************
+
+#Region "Apache License"
+'
+' Licensed under the Apache License, Version 2.0 (the "License");
+' you may not use this file except in compliance with the License.
+' You may obtain a copy of the License at
+'
+' http://www.apache.org/licenses/LICENSE-2.0
+'
+' Unless required by applicable law or agreed to in writing, software
+' distributed under the License is distributed on an "AS IS" BASIS,
+' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+' See the License for the specific language governing permissions and
+' limitations under the License.
+'
+#End Region
+
+'**********************************************************************************
+'* クラス名 :MyTimeZoneEnum
+'* クラス日本語名 :TimeZoneのID
+'*
+'* 作成者 :生技 西野
+'* 更新履歴 :
+'*
+'* 日時 更新者 内容
+'* ---------- ---------------- -------------------------------------------------
+'* 2012/06/20 西野 大介 新規作成
+'**********************************************************************************
+
+Namespace Touryo.Infrastructure.Business.Util
+ ''' TimeZoneのID
+ Public Enum MyTimeZoneEnum
+ ''' (GMT) カサブランカ
+ MoroccoStandardTime
+ ''' (GMT) グリニッジ標準時: ダブリン、エジンバラ、リスボン、ロンドン
+ GMTStandardTime
+ ''' (GMT) モンロビア、レイキャビク
+ GreenwichStandardTime
+ ''' (GMT) 協定世界時
+ UTC
+ ''' (GMT+01:00) アムステルダム、ベルリン、ベルン、ローマ、ストックホルム、ウィーン
+ W_EuropeStandardTime
+ ''' (GMT+01:00) ウィントフック
+ NamibiaStandardTime
+ ''' (GMT+01:00) サラエボ、スコピエ、ワルシャワ、ザグレブ
+ CentralEuropeanStandardTime
+ ''' (GMT+01:00) ブリュッセル、コペンハーゲン、マドリード、パリ
+ RomanceStandardTime
+ ''' (GMT+01:00) ベオグラード、ブラチスラバ、ブダペスト、リュブリャナ、プラハ
+ CentralEuropeStandardTime
+ ''' (GMT+01:00) 西中央アフリカ
+ W_CentralAfricaStandardTime
+ ''' (GMT+02:00) アテネ、ブカレスト
+ GTBStandardTime
+ ''' (GMT+02:00) アンマン
+ JordanStandardTime
+ ''' (GMT+02:00) イスタンブール
+ TurkeyStandardTime
+ ''' (GMT+02:00) エルサレム
+ IsraelStandardTime
+ ''' (GMT+02:00) カイロ
+ EgyptStandardTime
+ ''' (GMT+02:00) ダマスカス
+ SyriaStandardTime
+ ''' (GMT+02:00) ニコシア
+ E_EuropeStandardTime
+ ''' (GMT+02:00) ハラーレ、プレトリア
+ SouthAfricaStandardTime
+ ''' (GMT+02:00) ヘルシンキ、キエフ、リガ、スコピエ、ソフィア、タリン、ビリニュス
+ FLEStandardTime
+ ''' (GMT+02:00) ベイルート
+ MiddleEastStandardTime
+ ''' (GMT+03:00) カリーニングラード、ミンスク
+ KaliningradStandardTime
+ ''' (GMT+03:00) クウェート、リヤド
+ ArabStandardTime
+ ''' (GMT+03:00) ナイロビ
+ E_AfricaStandardTime
+ ''' (GMT+03:00) バグダッド
+ ArabicStandardTime
+ ''' (GMT+03:30) テヘラン
+ IranStandardTime
+ ''' (GMT+04:00) アブダビ、マスカット
+ ArabianStandardTime
+ ''' (GMT+04:00) エレバン
+ ArmenianStandardTime
+ ''' (GMT+04:00) コーカサス標準時
+ CaucasusStandardTime
+ ''' (GMT+04:00) トビリシ
+ GeorgianStandardTime
+ ''' (GMT+04:00) バク
+ AzerbaijanStandardTime
+ ''' (GMT+04:00) ポートルイス
+ MauritiusStandardTime
+ ''' (GMT+04:00) モスクワ、サンクトペテルブルク、ボルゴグラード
+ RussianStandardTime
+ ''' (GMT+04:30) カブール
+ AfghanistanStandardTime
+ ''' (GMT+05:00) イスラマバード、カラチ
+ PakistanStandardTime
+ ''' (GMT+05:00) タシケント
+ WestAsiaStandardTime
+ ''' (GMT+05:30) スリジャヤワルダナプラコッテ
+ SriLankaStandardTime
+ ''' (GMT+05:30) チェンナイ、コルカタ、ムンバイ、ニューデリー
+ IndiaStandardTime
+ ''' (GMT+05:45) カトマンズ
+ NepalStandardTime
+ ''' (GMT+06:00) アスタナ
+ CentralAsiaStandardTime
+ ''' (GMT+06:00) エカテリンバーグ
+ EkaterinburgStandardTime
+ ''' (GMT+06:00) ダッカ
+ BangladeshStandardTime
+ ''' (GMT+06:30) ヤンゴン (ラングーン)
+ MyanmarStandardTime
+ ''' (GMT+07:00) ノボシビルスク
+ N_CentralAsiaStandardTime
+ ''' (GMT+07:00) バンコク、ハノイ、ジャカルタ
+ SEAsiaStandardTime
+ ''' (GMT+08:00) ウランバートル
+ UlaanbaatarStandardTime
+ ''' (GMT+08:00) クアラルンプール、シンガポール
+ SingaporeStandardTime
+ ''' (GMT+08:00) クラスノヤルスク
+ NorthAsiaStandardTime
+ ''' (GMT+08:00) パース
+ W_AustraliaStandardTime
+ ''' (GMT+08:00) 北京、重慶、香港、ウルムチ
+ ChinaStandardTime
+ ''' (GMT+08:00) 台北
+ TaipeiStandardTime
+ ''' (GMT+09:00) イルクーツク
+ NorthAsiaEastStandardTime
+ ''' (GMT+09:00) ソウル
+ KoreaStandardTime
+ ''' (GMT+09:00) 大阪、札幌、東京
+ TokyoStandardTime
+ ''' (GMT+09:30) アデレード
+ Cen_AustraliaStandardTime
+ ''' (GMT+09:30) ダーウィン
+ AUSCentralStandardTime
+ ''' (GMT+10:00) キャンベラ、メルボルン、シドニー
+ AUSEasternStandardTime
+ ''' (GMT+10:00) グアム、ポートモレスビー
+ WestPacificStandardTime
+ ''' (GMT+10:00) ブリスベン
+ E_AustraliaStandardTime
+ ''' (GMT+10:00) ホバート
+ TasmaniaStandardTime
+ ''' (GMT+10:00) ヤクーツク
+ YakutskStandardTime
+ ''' (GMT+11:00) ウラジオストク
+ VladivostokStandardTime
+ ''' (GMT+11:00) ソロモン諸島、ニューカレドニア
+ CentralPacificStandardTime
+ ''' (GMT+12:00) オークランド、ウェリントン
+ NewZealandStandardTime
+ ''' (GMT+12:00) フィジー
+ FijiStandardTime
+ ''' (GMT+12:00) ペトロパブロフスク-カムチャツキー - 廃止
+ KamchatkaStandardTime
+ ''' (GMT+12:00) マガダン
+ MagadanStandardTime
+ ''' (GMT+12:00) 協定世界時+12
+ UTC_12
+ ''' (GMT+13:00) サモア
+ SamoaStandardTime
+ ''' (GMT+13:00) ヌクアロファ
+ TongaStandardTime
+ ''' (GMT-01:00) アゾレス諸島
+ AzoresStandardTime
+ ''' (GMT-01:00) カーボベルデ諸島
+ CapeVerdeStandardTime
+ ''' (GMT-02:00) 中央大西洋
+ Mid_AtlanticStandardTime
+ ''' (GMT-02:00) 協定世界時-02
+ UTC_02
+ ''' (GMT-03:00) カイエンヌ、フォルタレザ
+ SAEasternStandardTime
+ ''' (GMT-03:00) グリーンランド
+ GreenlandStandardTime
+ ''' (GMT-03:00) サルバドル
+ BahiaStandardTime
+ ''' (GMT-03:00) ブエノスアイレス
+ ArgentinaStandardTime
+ ''' (GMT-03:00) ブラジリア
+ E_SouthAmericaStandardTime
+ ''' (GMT-03:00) モンテビデオ
+ MontevideoStandardTime
+ ''' (GMT-03:30) ニューファンドランド
+ NewfoundlandStandardTime
+ ''' (GMT-04:00) アスンシオン
+ ParaguayStandardTime
+ ''' (GMT-04:00) クイアバ
+ CentralBrazilianStandardTime
+ ''' (GMT-04:00) サンティアゴ
+ PacificSAStandardTime
+ ''' (GMT-04:00) ジョージタウン、ラパス、マナウス、サンフアン
+ SAWesternStandardTime
+ ''' (GMT-04:00) 大西洋標準時 (カナダ)
+ AtlanticStandardTime
+ ''' (GMT-04:30) カラカス
+ VenezuelaStandardTime
+ ''' (GMT-05:00) インディアナ東部
+ USEasternStandardTime
+ ''' (GMT-05:00) ボゴタ、リマ、キト
+ SAPacificStandardTime
+ ''' (GMT-05:00) 東部標準時 (米国およびカナダ)
+ EasternStandardTime
+ ''' (GMT-06:00) グアダラハラ、メキシコシティ、モンテレー - 新
+ CentralStandardTime_Mexico
+ ''' (GMT-06:00) グアダラハラ、メキシコシティ、モンテレー - 旧
+ MexicoStandardTime
+ ''' (GMT-06:00) サスカチュワン
+ CanadaCentralStandardTime
+ ''' (GMT-06:00) 中央アメリカ
+ CentralAmericaStandardTime
+ ''' (GMT-06:00) 中部標準時 (米国およびカナダ)
+ CentralStandardTime
+ ''' (GMT-07:00) アリゾナ
+ USMountainStandardTime
+ ''' (GMT-07:00) チワワ、ラパス、マサトラン - 新
+ MountainStandardTime_Mexico
+ ''' (GMT-07:00) チワワ、ラパス、マサトラン - 旧
+ MexicoStandardTime2
+ ''' (GMT-07:00) 山地標準時 (米国およびカナダ)
+ MountainStandardTime
+ ''' (GMT-08:00) バハカリフォルニア
+ PacificStandardTime_Mexico
+ ''' (GMT-08:00) 太平洋標準時 (米国およびカナダ)
+ PacificStandardTime
+ ''' (GMT-09:00) アラスカ
+ AlaskanStandardTime
+ ''' (GMT-10:00) ハワイ
+ HawaiianStandardTime
+ ''' (GMT-11:00) 協定世界時-11
+ UTC_11
+ ''' (GMT-12:00) 国際日付変更線 西側
+ DatelineStandardTime
+ End Enum
+End Namespace
diff --git a/root/programs/VB/Frameworks/Infrastructure/Business/packages.config b/root/programs/VB/Frameworks/Infrastructure/Business/packages.config
new file mode 100644
index 0000000..5b6dce1
--- /dev/null
+++ b/root/programs/VB/Frameworks/Infrastructure/Business/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/root/programs/VB/Samples/AsyncSvc_sample/AsyncSvc_sample/AsyncSvc_sample.vbproj b/root/programs/VB/Samples/AsyncSvc_sample/AsyncSvc_sample/AsyncSvc_sample.vbproj
index 4f79389..f2de5bb 100644
--- a/root/programs/VB/Samples/AsyncSvc_sample/AsyncSvc_sample/AsyncSvc_sample.vbproj
+++ b/root/programs/VB/Samples/AsyncSvc_sample/AsyncSvc_sample/AsyncSvc_sample.vbproj
@@ -48,6 +48,10 @@
On
+
+ ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll
+ True
+
False
..\..\..\Frameworks\Infrastructure\Build\OpenTouryo.Business.dll
@@ -72,6 +76,9 @@
+
+
+