Example #1
0
        //────────────────────────────────────────
        /// <summary>
        /// コンストラクター。
        /// </summary>
        public Log_RecordReportsImpl(Log_Reports parent_Log_Logging)
        {
            this.Owner = parent_Log_Logging;
            this.errorSymbol = "";
            this.fullnameMethod = "";
            this.p1pText = new Builder_TexttemplateP1pImpl();
            this.sConfigStack = "";
            this.sGroupTag = "";

            this.enumReport = EnumReport.Error;
        }
Example #2
0
        //────────────────────────────────────────
        #endregion



        #region アクション
        //────────────────────────────────────────

        public void CreateErrorReport(
            string errorSymbol,
            Builder_TexttemplateP1p texttemplateBuilder_ParameterSetted,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);

            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "CreateErrorReport", log_Reports);
            //

            int errorNumber;

            {
                string tempErrorSymbol = errorSymbol;
                if (tempErrorSymbol.StartsWith("Er:"))
                {
                    tempErrorSymbol = tempErrorSymbol.Substring(3);
                    if (tempErrorSymbol.EndsWith(";"))
                    {
                        tempErrorSymbol = tempErrorSymbol.Substring(0, tempErrorSymbol.Length - 1);
                        if (int.TryParse(tempErrorSymbol, out errorNumber))
                        {
                        }
                        else
                        {
                            goto gt_Error_Symbol;
                        }
                    }
                    else
                    {
                        goto gt_Error_Symbol;
                    }
                }
                else
                {
                    goto gt_Error_Symbol;
                }
            }

            if (log_Reports.CanCreateReport)
            {
                string strTypedata             = ValuesTypeData.S_TABLE_ERRORMESSAGES;
                Configurationtree_Node  cur_Ct = new Configurationtree_NodeImpl(log_Method.Fullname, null);
                List <Table_Humaninput> tables = this.MemoryTables.GetTable_HumaninputByTypedata(
                    new Expression_Leaf_StringImpl(strTypedata, null, cur_Ct), true, log_Reports);

                bool hit = false;
                foreach (Table_Humaninput table in tables)
                {
                    foreach (DataRow dataRow in table.DataTable.Rows)
                    {
                        Int_HumaninputImpl xenonValue_Int = (Int_HumaninputImpl)dataRow["ID"];

                        int valueInt;
                        xenonValue_Int.TryGet(out valueInt);

                        if (valueInt == errorNumber)
                        {
                            //ヒット
                            hit = true;

                            Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                            r.SetTitle("Er:" + errorNumber + ";", log_Method);

                            String_HumaninputImpl xenonValue_String = (String_HumaninputImpl)dataRow["MESSAGE"];

                            string valueStr;
                            xenonValue_String.TryGet(out valueStr);

                            texttemplateBuilder_ParameterSetted.Text = valueStr;
                            r.Message = texttemplateBuilder_ParameterSetted.Compile(log_Reports).Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                            //log_Method.WriteDebug_ToConsole(texttemplateBuilder_ParameterSetted.Compile(log_Reports).Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));

                            goto gt_EndLoop1;
                        }
                    }
                }
gt_EndLoop1:

                if (!hit)
                {
                    //エラーメッセージの登録がない。

                    Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                    r.SetTitle("Er:0;", log_Method);

                    Log_TextIndented s = new Log_TextIndentedImpl();
                    s.Append("エラーメッセージテーブルに、エラーメッセージの登録がありませんでした。\n%1%=[%2%]\nテーブル数=[%3%]");

                    Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(s.ToString());
                    tmpl.SetParameter(1, NamesFld.S_TYPE_DATA, log_Reports);
                    tmpl.SetParameter(2, strTypedata, log_Reports);
                    tmpl.SetParameter(3, tables.Count.ToString(), log_Reports);

                    r.Message = tmpl.Compile(log_Reports).Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                }

                log_Reports.EndCreateReport();
            }

            goto gt_EndMethod;
            //
            #region 異常系
            //────────────────────────────────────────
gt_Error_Symbol:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー204!", log_Method);

                StringBuilder s = new StringBuilder();
                s.Append("エラーシンボルがおかしい。[" + errorSymbol + "]。プログラムのミス?");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }
Example #3
0
        //────────────────────────────────────────
        public void CreateErrorReport(
            string errorSymbol,
            Builder_TexttemplateP1p texttemplateBuilder_ParameterSetted,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            log_Method.BeginMethod(Info_MiddleImpl.Name_Library, this, "CreateErrorReport", log_Reports);
            //

            int errorNumber;
            {
                string tempErrorSymbol = errorSymbol;
                if (tempErrorSymbol.StartsWith("Er:"))
                {
                    tempErrorSymbol = tempErrorSymbol.Substring(3);
                    if (tempErrorSymbol.EndsWith(";"))
                    {
                        tempErrorSymbol = tempErrorSymbol.Substring(0, tempErrorSymbol.Length - 1);
                        if (int.TryParse(tempErrorSymbol, out errorNumber))
                        {
                        }
                        else
                        {
                            goto gt_Error_Symbol;
                        }
                    }
                    else
                    {
                        goto gt_Error_Symbol;
                    }
                }
                else
                {
                    goto gt_Error_Symbol;
                }
            }

            if (log_Reports.CanCreateReport)
            {
                string strTypedata = ValuesTypeData.S_TABLE_ERRORMESSAGES;
                Configurationtree_Node cur_Ct = new Configurationtree_NodeImpl(log_Method.Fullname, null);
                List<Table_Humaninput> tables = this.MemoryTables.GetTable_HumaninputByTypedata(
                    new Expression_Leaf_StringImpl(strTypedata, null, cur_Ct), true, log_Reports);

                bool hit = false;
                foreach (Table_Humaninput table in tables)
                {
                    foreach (DataRow dataRow in table.DataTable.Rows)
                    {
                        Int_HumaninputImpl xenonValue_Int = (Int_HumaninputImpl)dataRow["ID"];

                        int valueInt;
                        xenonValue_Int.TryGet(out valueInt);

                        if (valueInt == errorNumber)
                        {
                            //ヒット
                            hit = true;

                            Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                            r.SetTitle("Er:" + errorNumber + ";", log_Method);

                            String_HumaninputImpl xenonValue_String = (String_HumaninputImpl)dataRow["MESSAGE"];

                            string valueStr;
                            xenonValue_String.TryGet(out valueStr);

                            texttemplateBuilder_ParameterSetted.Text = valueStr;
                            r.Message = texttemplateBuilder_ParameterSetted.Compile(log_Reports).Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                            //log_Method.WriteDebug_ToConsole(texttemplateBuilder_ParameterSetted.Compile(log_Reports).Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports));

                            goto gt_EndLoop1;
                        }
                    }
                }
            gt_EndLoop1:

                if (!hit)
                {
                    //エラーメッセージの登録がない。

                    Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                    r.SetTitle("Er:0;", log_Method);

                    Log_TextIndented s = new Log_TextIndentedImpl();
                    s.Append("エラーメッセージテーブルに、エラーメッセージの登録がありませんでした。\n%1%=[%2%]\nテーブル数=[%3%]");

                    Builder_TexttemplateP1p tmpl = new Builder_TexttemplateP1pImpl(s.ToString());
                    tmpl.SetParameter(1, NamesFld.S_TYPE_DATA,log_Reports);
                    tmpl.SetParameter(2, strTypedata,log_Reports);
                    tmpl.SetParameter(3, tables.Count.ToString(),log_Reports);

                    r.Message = tmpl.Compile(log_Reports).Execute4_OnExpressionString(EnumHitcount.Unconstraint, log_Reports);
                }

                log_Reports.EndCreateReport();
            }

            goto gt_EndMethod;
            //
            #region 異常系
            //────────────────────────────────────────
            gt_Error_Symbol:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー204!", log_Method);

                StringBuilder s = new StringBuilder();
                s.Append("エラーシンボルがおかしい。[" + errorSymbol + "]。プログラムのミス?");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
        }