public static void SaveLoadOrUnLoadEvidence(Common.geWinGroupType winGroupType,
                                                    Common.geWinType winType,
                                                    DataPgEvidence.geOperationType operationType)
        {
            switch (winGroupType)
            {
            case Common.geWinGroupType.NameList:
                break;

            case Common.geWinGroupType.InpList:
                switch (winType)
                {
                case Common.geWinType.ListOrder:
                    DataPgEvidence.gAddEvidence(DataPgEvidence.PGName.Order.OrderList, (int)operationType, "");
                    break;

                default:
                    break;
                }
                break;

            case Common.geWinGroupType.MstList:
                break;

            default:
                break;
            }
        }
        public static void SaveLoadOrUnLoadEvidence(Common.gePageGroupType pageGroupType,
                                                    Common.gePageType pageType,
                                                    DataPgEvidence.geOperationType operationType)
        {
            switch (pageGroupType)
            {
            case Common.gePageGroupType.StartUp:
            case Common.gePageGroupType.Menu:
                break;

            case Common.gePageGroupType.Inp:
                switch (pageType)
                {
                case Common.gePageType.InpOrder:
                    DataPgEvidence.gAddEvidence(DataPgEvidence.PGName.Order.OrderInp, (int)operationType, "");
                    break;

                default:
                    break;
                }
                break;

            default:
                break;
            }
        }
        public static string GetOperationTypeName(DataPgEvidence.geOperationType type)
        {
            switch ((int)type)
            {
            case 0:
                return("開始");

            case 1:
                return("終了");

            case 2:
                return("選択");

            case 3:
                return("更新");

            case 4:
                return("追加");

            case 5:
                return("削除");

            case 6:
                return("PDF出力");

            case 7:
                return("Excel出力");

            case 8:
                return("CSV出力");

            default:
                return("");
            }
        }
        public static void SaveLoadOrUnLoadEvidence(Common.geWinGroupType winGroupType,
                                                    Common.geWinMsterType winMstType,
                                                    DataPgEvidence.geOperationType operationType)
        {
            switch (winGroupType)
            {
            case Common.geWinGroupType.InpMaster:
            case Common.geWinGroupType.InpMasterDetail:
                switch (winMstType)
                {
                case  Common.geWinMsterType.Customer:
                    DataPgEvidence.gAddEvidence(DataPgEvidence.PGName.Mst.Customer, (int)operationType, "");
                    break;

                case Common.geWinMsterType.Person:
                    DataPgEvidence.gAddEvidence(DataPgEvidence.PGName.Mst.Person, (int)operationType, "");
                    break;

                case Common.geWinMsterType.Commodity:
                    DataPgEvidence.gAddEvidence(DataPgEvidence.PGName.Mst.Commodity, (int)operationType, "");
                    break;

                case Common.geWinMsterType.Condition:
                    DataPgEvidence.gAddEvidence(DataPgEvidence.PGName.Mst.Condition, (int)operationType, "");
                    break;

                case Common.geWinMsterType.Class:
                    DataPgEvidence.gAddEvidence(DataPgEvidence.PGName.Mst.Class, (int)operationType, "");
                    break;

                default:
                    break;
                }
                break;

            default:
                break;
            }
        }
        public static void gAddEvidence(int saveFlg, string companyId, string userId, string ipAdress, string sessionString, string pgId, DataPgEvidence.geOperationType type, string memo)
        {
            if (saveFlg != 1)
            {
                return;
            }

            StringBuilder sb = new StringBuilder();
            DataTable     dt;

            ExMySQLData db = ExSession.GetSessionDb(ExCast.zCInt(userId), sessionString);

            // 日時取得
            string   date        = "";
            string   time        = "";
            int      millisecond = 0;
            DateTime now         = DateTime.Now;

            date        = now.ToString("yyyy/MM/dd");
            time        = now.ToString("HH:mm:ss");
            millisecond = now.Millisecond;

            // PG実行履歴登録
            try
            {
                sb.Length = 0;
                sb.Append("INSERT INTO H_PG_EXEC_HISTORY " + Environment.NewLine);
                sb.Append("       (COMPANY_ID" + Environment.NewLine);
                sb.Append("       ,USER_ID" + Environment.NewLine);
                sb.Append("       ,PG_ID" + Environment.NewLine);
                sb.Append("       ,OPERATION_DATE" + Environment.NewLine);
                sb.Append("       ,OPERATION_TIME" + Environment.NewLine);
                sb.Append("       ,OPERATION_MILLISECOND" + Environment.NewLine);
                sb.Append("       ,OPERATION_TYPE" + Environment.NewLine);
                sb.Append("       ,PG_NAME" + Environment.NewLine);
                sb.Append("       ,OPERATION_TYPE_NAME" + Environment.NewLine);
                sb.Append("       ,MEMO" + Environment.NewLine);
                sb.Append("       ,UPDATE_FLG" + Environment.NewLine);
                sb.Append("       ,DELETE_FLG" + Environment.NewLine);
                sb.Append("       ,CREATE_PG_ID" + Environment.NewLine);
                sb.Append("       ,CREATE_ADRESS" + Environment.NewLine);
                sb.Append("       ,CREATE_USER_ID" + Environment.NewLine);
                sb.Append("       ,CREATE_DATE" + Environment.NewLine);
                sb.Append("       ,CREATE_TIME" + Environment.NewLine);
                sb.Append("       ,UPDATE_PG_ID" + Environment.NewLine);
                sb.Append("       ,UPDATE_ADRESS" + Environment.NewLine);
                sb.Append("       ,UPDATE_USER_ID" + Environment.NewLine);
                sb.Append("       ,UPDATE_DATE" + Environment.NewLine);
                sb.Append("       ,UPDATE_TIME" + Environment.NewLine);
                sb.Append(")" + Environment.NewLine);
                sb.Append("VALUES (" + companyId + Environment.NewLine);                                                   // COMPANY_ID
                sb.Append("       ," + userId + Environment.NewLine);                                                      // USER_ID
                sb.Append("       ," + ExEscape.zRepStr(pgId) + Environment.NewLine);                                      // PG_ID
                sb.Append("       ," + ExEscape.zRepStr(date) + Environment.NewLine);                                      // OPERATION_DATE
                sb.Append("       ," + ExEscape.zRepStr(time) + Environment.NewLine);                                      // OPERATION_TIME
                sb.Append("       ," + millisecond.ToString() + Environment.NewLine);                                      // OPERATION_MILLISECOND
                sb.Append("       ," + (int)type + Environment.NewLine);                                                   // OPERATION_TYPE
                sb.Append("       ," + ExEscape.zRepStr(DataPgEvidence.GetPgName(pgId)) + Environment.NewLine);            // PG_NAME
                sb.Append("       ," + ExEscape.zRepStr(DataPgEvidence.GetOperationTypeName(type)) + Environment.NewLine); // OPERATION_TYPE_NAME
                sb.Append("       ," + ExEscape.zRepStr(memo) + Environment.NewLine);                                      // MEMO
                sb.Append("       ,0" + Environment.NewLine);                                                              // UPDATE_FLG
                sb.Append("       ,0" + Environment.NewLine);                                                              // DELETE_FLG
                sb.Append("       ,'SYSTEM'" + Environment.NewLine);                                                       // CREATE_PG_ID
                sb.Append("       ," + ExEscape.zRepStr(ipAdress) + Environment.NewLine);                                  // CREATE_ADRESS
                sb.Append("       ," + ExEscape.zRepStr(userId) + Environment.NewLine);                                    // CREATE_USER_ID
                sb.Append("       ," + ExEscape.zRepStr(date) + Environment.NewLine);                                      // CREATE_DATE
                sb.Append("       ," + ExEscape.zRepStr(time) + Environment.NewLine);                                      // CREATE_TIME
                sb.Append("       ,'SYSTEM'" + Environment.NewLine);                                                       // UPDATE_PG_ID
                sb.Append("       ," + ExEscape.zRepStr(ipAdress) + Environment.NewLine);                                  // UPDATE_ADRESS
                sb.Append("       ," + ExEscape.zRepStr(userId) + Environment.NewLine);                                    // UPDATE_USER_ID
                sb.Append("       ," + ExEscape.zRepStr(date) + Environment.NewLine);                                      // UPDATE_DATE
                sb.Append("       ," + ExEscape.zRepStr(time) + Environment.NewLine);                                      // UPDATE_TIME
                sb.Append(")");

                if (db.ExecuteSQL(sb.ToString(), true) == false)
                {
                    CommonUtl.ExLogger.Error(CLASS_NM + ".gAddEvidence(ExecuteSQL) : " + Environment.NewLine + ExSession.GetSessionDb(ExCast.zCInt(userId), sessionString).errMessage);
                    return;
                }

                switch (type)
                {
                case DataPgEvidence.geOperationType.Start:
                case DataPgEvidence.geOperationType.End:
                    if (pgId == DataPgEvidence.PGName.System)
                    {
                        DataPgLock.DelLockPg(companyId, userId, "", "", ipAdress, true, db);
                    }
                    else
                    {
                        DataPgLock.DelLockPg(companyId, userId, pgId, "", ipAdress, true, db);
                    }
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                CommonUtl.ExLogger.Error(CLASS_NM + ".gAddEvidence(Insert)", ex);
                db.ExRollbackTransaction();
            }
        }
 public static void SaveLoadOrUnLoadEvidence(string pgId,
                                             DataPgEvidence.geOperationType operationType)
 {
     DataPgEvidence.gAddEvidence(pgId, (int)operationType, "");
 }