示例#1
0
        //────────────────────────────────────────
        #endregion



        #region 判定
        //────────────────────────────────────────

        public override bool Equals(System.Object obj)
        {
            // 引数がヌルの場合は、偽です。
            if (obj == null)
            {
                return(false);
            }

            // 型が違えば偽です。
            Bool_HumaninputImpl obj2 = obj as Bool_HumaninputImpl;

            if (null != obj2)
            {
                // 空欄同士なら真です。
                if (this.IsSpaces() && obj2.IsSpaces())
                {
                    return(true);
                }

                if (this.IsValidated && obj2.IsValidated)
                {
                    // お互いがブール値なら

                    return(this.bValue_Bool == obj2.bValue_Bool);
                }
                else
                {
                    // どちらか片方でも非ブール値なら

                    return(this.Text == obj2.Text);
                }
            }

            if (obj is bool)
            {
                bool bValue = (bool)obj;

                // このオブジェクトが空欄なら偽。
                if (this.IsSpaces())
                {
                    return(false);
                }

                // このオブジェクトが非bool値なら偽。
                if (!this.IsValidated)
                {
                    return(false);
                }

                // bool値で比較
                return(this.bValue_Bool == bValue);
            }

            return(false);
        }
示例#2
0
        //────────────────────────────────────────

        /// <summary>
        /// O_TableImpl#AddRecordListで使います。
        /// </summary>
        /// <param name="columnIndex"></param>
        /// <param name="value"></param>
        /// <param name="oTable"></param>
        /// <param name="log_Reports"></param>
        /// <returns></returns>
        public static Value_Humaninput ConfigurationTo_Field(
            int index_Column,
            string value,
            RecordFielddefinition recordFielddefinition,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl();

            log_Method.BeginMethod(Info_Table.Name_Library, "Utility_Row", "ConfigurationTo_Field", log_Reports);
            //

            //
            // セルのソースヒント名
            string nodeConfigtree;

            try
            {
                nodeConfigtree = recordFielddefinition.ValueAt(index_Column).Name_Humaninput;
            }
            catch (ArgumentOutOfRangeException)
            {
                // エラー
                goto gt_Error_Index;
            }

            Value_Humaninput result;

            // 型毎に処理を分けます。
            switch (recordFielddefinition.ValueAt(index_Column).Type_Field)
            {
            case EnumTypeFielddefinition.Int:
            {
                // 空白データも自動処理
                Int_HumaninputImpl cellData = new Int_HumaninputImpl(nodeConfigtree);
                cellData.Text = value;
                result        = cellData;
            }
            break;

            case EnumTypeFielddefinition.Bool:
            {
                // 空白データも自動処理
                Bool_HumaninputImpl cellData = new Bool_HumaninputImpl(nodeConfigtree);
                cellData.Text = value;
                result        = cellData;
            }
            break;

            default:
            {
                String_HumaninputImpl cellData = new String_HumaninputImpl(nodeConfigtree);
                cellData.Text = value;
                result        = cellData;
            }
            break;
            }

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

                Log_TextIndented t = new Log_TextIndentedImpl();

                t.Append("列インデックス[" + index_Column + "](0スタート)が指定されましたが、");
                t.Newline();
                t.Append("列は[" + recordFielddefinition.Count + "]個しかありません。(列定義リストは、絞りこまれている場合もあります)");
                t.Newline();

                // ヒント

                r.Message = t.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return(result);
        }
示例#3
0
        //────────────────────────────────────────

        public static Value_Humaninput NewInstance(
            object value,
            bool isRequired,
            string nodeConfigtree,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0);

            log_Method.BeginMethod(Info_Table.Name_Library, "Utility_HumaninputValue", "NewInstance", log_Reports);

            Value_Humaninput result;

            if (value is String_HumaninputImpl)
            {
                result = new String_HumaninputImpl(nodeConfigtree);
            }
            else if (value is Int_HumaninputImpl)
            {
                result = new Int_HumaninputImpl(nodeConfigtree);
            }
            else if (value is Bool_HumaninputImpl)
            {
                result = new Bool_HumaninputImpl(nodeConfigtree);
            }
            else
            {
                result = null;

                if (isRequired)
                {
                    //エラー
                    goto gt_Error_AnotherType;
                }
            }

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

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append("▲エラー201!(" + Info_Table.Name_Library + ")");
                s.Newline();
                s.Append("string,int,boolセルデータクラス以外のオブジェクトが指定されました。");
                s.Newline();

                s.Append("指定された値のクラス=[");
                s.Append(value.GetType().Name);
                s.Append("]");

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return(result);
        }
示例#4
0
        //────────────────────────────────────────
        public static Value_Humaninput NewInstance(
            object value,
            bool isRequired,
            string nodeConfigtree,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            log_Method.BeginMethod(Info_Table.Name_Library, "Utility_HumaninputValue", "NewInstance", log_Reports);

            Value_Humaninput result;

            if(value is String_HumaninputImpl)
            {
                result = new String_HumaninputImpl(nodeConfigtree);
            }
            else if(value is Int_HumaninputImpl)
            {
                result = new Int_HumaninputImpl(nodeConfigtree);
            }
            else if(value is Bool_HumaninputImpl)
            {
                result = new Bool_HumaninputImpl(nodeConfigtree);
            }
            else
            {
                result = null;

                if (isRequired)
                {
                    //エラー
                    goto gt_Error_AnotherType;
                }
            }

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

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append("▲エラー201!(" + Info_Table.Name_Library + ")");
                s.Newline();
                s.Append("string,int,boolセルデータクラス以外のオブジェクトが指定されました。");
                s.Newline();

                s.Append("指定された値のクラス=[");
                s.Append(value.GetType().Name);
                s.Append("]");

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return result;
        }
示例#5
0
        //────────────────────────────────────────
        /// <summary>
        /// DataRow → Dictionary
        /// </summary>
        /// <param name="row"></param>
        /// <param name="log_Reports"></param>
        public void Add(DataRow row, Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            log_Method.BeginMethod(Info_Table.Name_Library, this, "Add",log_Reports);

            Dictionary<string, Value_Humaninput> record = new Dictionary<string, Value_Humaninput>();

            int nFieldCount = row.ItemArray.Length;
            for (int nFieldIndex = 0; nFieldIndex < nFieldCount; nFieldIndex++)
            {
                // フィールド名
                string sFieldName = xenonTable.RecordFielddefinition.ValueAt(nFieldIndex).Name_Trimupper;

                // 値
                Value_Humaninput oValue;
                if (row[nFieldIndex] is DBNull)
                {
                    //// デバッグ
                    //if (true)
                    //{
                    //Log_TextIndented txt = new Log_TextIndentedImpl();

                    //    txt.Append(InfxenonTable.LibraryName + ":" + this.GetType().Name + "#Add:【ヌル】");
                    //    txt.Append(" field=[" + sFieldName + "]");

                    //    ystem.Console.WriteLine(txt.ToString());
                    //}

                    String sConfigStack = xenonTable.Expression_Filepath_ConfigStack.Execute4_OnExpressionString(
                        EnumHitcount.Unconstraint, log_Reports);
                    if (!log_Reports.Successful)
                    {
                        // 既エラー。
                        goto gt_EndMethod;
                    }

                    EnumTypeFielddefinition typeField = xenonTable.RecordFielddefinition.ValueAt(nFieldIndex).Type_Field;
                    switch (typeField)
                    {
                        case EnumTypeFielddefinition.String:
                            oValue = new String_HumaninputImpl(sConfigStack);
                            break;
                        case EnumTypeFielddefinition.Int:
                            oValue = new Int_HumaninputImpl(sConfigStack);
                            break;
                        case EnumTypeFielddefinition.Bool:
                            oValue = new Bool_HumaninputImpl(sConfigStack);
                            break;
                        default:
                            // エラー。
                            goto gt_Error_UndefinedType;
                    }
                }
                else
                {
                    oValue = (Value_Humaninput)row[nFieldIndex];

                    //// デバッグ
                    //if (true)
                    //{
                    //Log_TextIndented txt = new Log_TextIndentedImpl();

                    //    txt.Append(InfxenonTable.LibraryName + ":" + this.GetType().Name + "#Add:【○】");
                    //    txt.Append(" 値=[" + oValue.HumanInputString + "]");

                    //    ystem.Console.WriteLine(txt.ToString());
                    //}
                }

                record.Add(sFieldName, oValue);
            }

            this.List_Field.Add(record);

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

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append(" 未定義の型です。プログラムのミスの可能性があります。");
                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);
            return;
        }
示例#6
0
        //────────────────────────────────────────
        #endregion



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

        /// <summary>
        /// DataRow → Dictionary
        /// </summary>
        /// <param name="row"></param>
        /// <param name="log_Reports"></param>
        public void Add(DataRow row, Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0);

            log_Method.BeginMethod(Info_Table.Name_Library, this, "Add", log_Reports);

            Dictionary <string, Value_Humaninput> record = new Dictionary <string, Value_Humaninput>();

            int nFieldCount = row.ItemArray.Length;

            for (int nFieldIndex = 0; nFieldIndex < nFieldCount; nFieldIndex++)
            {
                // フィールド名
                string sFieldName = xenonTable.RecordFielddefinition.ValueAt(nFieldIndex).Name_Trimupper;

                // 値
                Value_Humaninput oValue;
                if (row[nFieldIndex] is DBNull)
                {
                    //// デバッグ
                    //if (true)
                    //{
                    //Log_TextIndented txt = new Log_TextIndentedImpl();

                    //    txt.Append(InfxenonTable.LibraryName + ":" + this.GetType().Name + "#Add:【ヌル】");
                    //    txt.Append(" field=[" + sFieldName + "]");

                    //    ystem.Console.WriteLine(txt.ToString());
                    //}

                    String sConfigStack = xenonTable.Expression_Filepath_ConfigStack.Execute4_OnExpressionString(
                        EnumHitcount.Unconstraint, log_Reports);
                    if (!log_Reports.Successful)
                    {
                        // 既エラー。
                        goto gt_EndMethod;
                    }

                    EnumTypeFielddefinition typeField = xenonTable.RecordFielddefinition.ValueAt(nFieldIndex).Type_Field;
                    switch (typeField)
                    {
                    case EnumTypeFielddefinition.String:
                        oValue = new String_HumaninputImpl(sConfigStack);
                        break;

                    case EnumTypeFielddefinition.Int:
                        oValue = new Int_HumaninputImpl(sConfigStack);
                        break;

                    case EnumTypeFielddefinition.Bool:
                        oValue = new Bool_HumaninputImpl(sConfigStack);
                        break;

                    default:
                        // エラー。
                        goto gt_Error_UndefinedType;
                    }
                }
                else
                {
                    oValue = (Value_Humaninput)row[nFieldIndex];

                    //// デバッグ
                    //if (true)
                    //{
                    //Log_TextIndented txt = new Log_TextIndentedImpl();

                    //    txt.Append(InfxenonTable.LibraryName + ":" + this.GetType().Name + "#Add:【○】");
                    //    txt.Append(" 値=[" + oValue.HumanInputString + "]");

                    //    ystem.Console.WriteLine(txt.ToString());
                    //}
                }

                record.Add(sFieldName, oValue);
            }

            this.List_Field.Add(record);

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

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append(" 未定義の型です。プログラムのミスの可能性があります。");
                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);
            return;
        }
示例#7
0
        //────────────────────────────────────────

        public void Judge(
            out bool isJudge,
            string name_KeyField,
            string value_Expected,
            bool isRequired_ExpectedValue,
            DataRow row,
            Configuration_Node parent_Query,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl();

            log_Method.BeginMethod(Info_Table.Name_Library, this, "Judge", log_Reports);

            //
            //
            //
            //

            try
            {
                Value_Humaninput valueH = (Value_Humaninput)row[name_KeyField];

                // (5)キーが空欄で、検索ヒット必須でなければ、無視します。【bool型フィールドの場合】
                if (Bool_HumaninputImpl.IsSpaces(valueH))
                {
                    isJudge = false;
                    goto gt_EndMethod;
                }



                //
                // (6)この行の、キー_フィールドの値を取得。
                //
                bool isKeyValue;

                bool isParsedSuccessful = Bool_HumaninputImpl.TryParse(
                    valueH,
                    out isKeyValue,
                    EnumOperationIfErrorvalue.Error,
                    null,
                    log_Reports
                    );
                if (log_Reports.Successful)
                {
                    if (!isParsedSuccessful)
                    {
                        // エラー。
                        isJudge = false;
                        if (log_Reports.CanCreateReport)
                        {
                            Log_RecordReports d_Report = log_Reports.BeginCreateReport(EnumReport.Error);
                            d_Report.SetTitle("▲エラー699!", log_Method);
                            d_Report.Message = "bool型パース失敗。";
                            log_Reports.EndCreateReport();
                        }
                        goto gt_EndMethod;
                    }
                }


                bool isExpectedValue;
                if (log_Reports.Successful)
                {
                    // (8)キー値をbool型に変換します。
                    bool isParseSuccessful2 = bool.TryParse(value_Expected, out isExpectedValue);
                    if (!isParseSuccessful2)
                    {
                        isJudge = false;
                        if (isRequired_ExpectedValue)
                        {
                            // 空値ではダメという設定の場合。
                            goto gt_Error_Parse;
                        }
                        goto gt_EndMethod;
                    }
                }
                else
                {
                    isExpectedValue = false;
                }



                // (8)該当行をレコードセットに追加。
                if (log_Reports.Successful)
                {
                    if (isKeyValue == isExpectedValue)
                    {
                        isJudge = true;
                    }
                    else
                    {
                        isJudge = false;
                    }
                }
                else
                {
                    isJudge = false;
                }
            }
            catch (RowNotInTableException)
            {
                // (9)指定行がなかった場合は、スルー。
                isJudge = false;

                //
                // 指定の行は、テーブルの中にありませんでした。
                // 再描画と、行の削除が被ったのかもしれません。
                // いわゆる「処理中」です。
                //

                //.WriteLine(this.GetType().Name+"#GetValueStringList: ["+refTable.Name+"]テーブルには、["+ttbwIndex+"]行が存在しませんでした。もしかすると、削除されたのかもしれません。エラー:"+e.Message);
            }

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

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.AppendI(0, "<Select_KeyBoolImplクラス>");
                s.Append(Environment.NewLine);

                s.AppendI(1, "これはbool型値のプログラムです。他の型のプログラムを使ってください。");
                s.Append(Environment.NewLine);

                s.AppendI(1, "sExpectedValue=[");
                s.Append(value_Expected);
                s.Append("]");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                // ヒント
                parent_Query.ToText_Locationbreadcrumbs(s);

                s.AppendI(0, "</Select_KeyBoolImplクラス>");

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

        public Value_Humaninput NewField(string nodeConfigtree, Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0);

            log_Method.BeginMethod(Info_Table.Name_Library, this, "NewField", log_Reports);

            Value_Humaninput result;

            switch (this.Type_Field)
            {
            case EnumTypeFielddefinition.String:
            {
                result = new String_HumaninputImpl(nodeConfigtree);
            }
            break;

            case EnumTypeFielddefinition.Int:
            {
                result = new Int_HumaninputImpl(nodeConfigtree);
            }
            break;

            case EnumTypeFielddefinition.Bool:
            {
                result = new Bool_HumaninputImpl(nodeConfigtree);
            }
            break;

            default:
            {
                // 未該当
                result = null;
                goto gt_Error_Unspported;
            }
            }

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

                Log_TextIndented s = new Log_TextIndentedImpl();

                s.Append("フィールド定義を元にして、フィールド値を用意しようとしましたが、未定義のフィールド型でした。");
                s.Newline();

                s.Append("this.Type.ToString()=[");
                s.Append(this.ToString_Type());
                s.Append("]");
                s.Newline();

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return(result);
        }
示例#9
0
        //────────────────────────────────────────

        static public bool TryParse(
            object data,
            out bool bValue_Out,
            EnumOperationIfErrorvalue enumCellDataErrorSupport,
            object altValue,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl(0);

            log_Method.BeginMethod(Info_Table.Name_Library, "XenonValue_BoolImpl", "TryParse", log_Reports);

            bool bResult;

            Bool_HumaninputImpl err_BoolCellData;

            if (data is Boolean)
            {
                bValue_Out = (bool)data;

                bResult = true;
            }
            else if (data is Bool_HumaninputImpl)
            {
                Bool_HumaninputImpl boolCellData = (Bool_HumaninputImpl)data;

                if (boolCellData.IsSpaces())
                {
                    // 空白の場合

                    if (EnumOperationIfErrorvalue.Spaces_To_Alt_Value == enumCellDataErrorSupport)
                    {
                        if (altValue is bool)
                        {
                            bValue_Out = (bool)altValue;

                            bResult = true;
                        }
                        else
                        {
                            // エラー
                            bValue_Out       = false;//ゴミ値
                            bResult          = false;
                            err_BoolCellData = boolCellData;
                            goto gt_Error_AnotherType;
                        }
                    }
                    else
                    {
                        // エラー
                        bValue_Out       = false;//ゴミ値
                        bResult          = false;
                        err_BoolCellData = boolCellData;
                        goto gt_Error_EmptyString;
                    }
                }
                else if (!boolCellData.isValidated)
                {
                    // エラー(変換に失敗した場合)
                    bValue_Out       = false;//ゴミ値
                    bResult          = false;
                    err_BoolCellData = boolCellData;
                    goto gt_Error_Invalid;
                }
                else
                {
                    bValue_Out = boolCellData.GetBool();

                    bResult = true;
                }
            }
            else if (null == data)
            {
                // エラー
                bValue_Out = false;//ゴミ値
                bResult    = false;
                goto gt_Error_Null;
            }
            else if (!(data is Value_Humaninput))
            {
                // エラー
                bValue_Out = false;//ゴミ値
                bResult    = false;
                goto gt_Error_AnotherTypeData;
            }
            else
            {
                // エラー
                bValue_Out = false;//ゴミ値
                bResult    = false;
                goto gt_Error_Class;
            }

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

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append(" altValue引数には、bool型の値を指定してください。");
                s.Append(Environment.NewLine);
                s.Append("  boolセル値=[");
                s.Append(err_BoolCellData.Text);
                s.Append("]");

                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);
                s.Append("  問題箇所ヒント:");
                err_BoolCellData.ToText_Locationbreadcrumbs(s);

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_EmptyString:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー531!", log_Method);

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append(" セルに、bool型の値を入れてください。空欄にしないでください。");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);
                s.Append("  boolセル値=[");
                s.Append(err_BoolCellData.Text);
                s.Append("]");

                //
                // ヒント
                err_BoolCellData.ToText_Locationbreadcrumbs(s);

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_Invalid:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー112!", log_Method);

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append(" bool型に変換できませんでした。[");
                s.Append(err_BoolCellData.Text);
                s.Append("]");

                //
                // ヒント
                err_BoolCellData.ToText_Locationbreadcrumbs(s);

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_Null:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー231!", log_Method);

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append(" 指定の引数dataに、BoolCellData型の値を指定してください。空っぽでした。");

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_AnotherTypeData:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー332!", log_Method);

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append(" bool型のデータを入れるところで、");
                s.Append(Environment.NewLine);
                s.Append(" 別の型[" + data.GetType().Name + "]でした。");

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
gt_Error_Class:
            if (log_Reports.CanCreateReport)
            {
                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                r.SetTitle("▲エラー233!", log_Method);

                Log_TextIndented s = new Log_TextIndentedImpl();
                s.Append("指定の引数の値[");
                s.Append(((Value_Humaninput)data).Text);
                s.Append("]は、BoolCellData型ではありませんでした。");
                s.Append(Environment.NewLine);
                s.Append(Environment.NewLine);

                s.Append(" 型=[");
                s.Append(data.GetType().Name);
                s.Append("]");
                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);
            return(bResult);
        }
示例#10
0
        //────────────────────────────────────────
        /// <summary>
        /// 選択されているセルに、指定の値を上書きします。
        /// </summary>
        /// <param nFcName="outputValueStr"></param>
        /// <param nFcName="row"></param>
        /// <param nFcName="selFldDefinition">選択フィールド</param>
        /// <param nFcName="log_Reports"></param>
        public void ToMemory_ToSelectedField(
            string sValue_Output,
            Expression_Node_String ec_Fcell,
            DataRow row,
            Fielddefinition selFldDefinition,//選択したフィールド定義
            Log_Reports log_Reports
            )
        {
            //essageBox.Show("アップデートデータ【開始】 outputValueStr=[" + outputValueStr + "]\n", "(FormsImpl)" + this.GetType().NFcName );

            //.WriteLine(this.GetType().NFcName + "#: 【開始】データのアップデートを始める。");

            Log_Method pg_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static);
            pg_Method.BeginMethod(Info_Controls.Name_Library, this, "ToM_ToSelectedField",log_Reports);
            //
            //

            string sName_SelectedFld;
            {
                bool bHit = ec_Fcell.TrySelectAttribute(
                    out sName_SelectedFld,
                    PmNames.S_SELECT.Name_Pm,
                    EnumHitcount.One,
                    log_Reports
                    );
            }

            string sConfigStack_StringOfCell = sName_SelectedFld;

            switch (selFldDefinition.Type_Field)
            {
                case EnumTypeFielddefinition.String:
                    {
                        // 空欄も自動処理
                        String_HumaninputImpl cellData = new String_HumaninputImpl(sConfigStack_StringOfCell);
                        cellData.Text = sValue_Output;

                        row[sName_SelectedFld] = cellData;
                    }
                    break;
                case EnumTypeFielddefinition.Int:
                    {
                        // 空欄も自動処理
                        Int_HumaninputImpl cellData = new Int_HumaninputImpl(sConfigStack_StringOfCell);
                        cellData.Text = sValue_Output;
                        row[sName_SelectedFld] = cellData;
                    }
                    break;
                case EnumTypeFielddefinition.Bool:
                    {
                        // 空欄も自動処理
                        Bool_HumaninputImpl cellData = new Bool_HumaninputImpl(sConfigStack_StringOfCell);
                        cellData.Text = sValue_Output;
                        row[sName_SelectedFld] = cellData;
                    }
                    break;
                default:
                    {
                        if (log_Reports.CanCreateReport)
                        {
                            Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Error);
                            r.SetTitle("▲エラー398!", pg_Method);

                            StringBuilder t = new StringBuilder();

                            t.Append("予期しない、フィールドの型です。");
                            t.Append(Environment.NewLine);
                            t.Append("selFldDefinition.Type=[");
                            t.Append(selFldDefinition.ToString_Type());
                            t.Append("]");
                            t.Append(Environment.NewLine);
                            t.Append(Environment.NewLine);

                            // ヒント
                            t.Append(r.Message_Configuration(
                                ec_Fcell.Cur_Configuration));

                            r.Message = t.ToString();
                            log_Reports.EndCreateReport();
                        }
                    }
                    break;
            }

            //
            pg_Method.EndMethod(log_Reports);
        }
示例#11
0
        //────────────────────────────────────────
        public Value_Humaninput NewField(string nodeConfigtree, Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            log_Method.BeginMethod(Info_Table.Name_Library, this, "NewField", log_Reports);

            Value_Humaninput result;

            switch (this.Type_Field)
            {
                case EnumTypeFielddefinition.String:
                    {
                        result = new String_HumaninputImpl(nodeConfigtree);
                    }
                    break;
                case EnumTypeFielddefinition.Int:
                    {
                        result = new Int_HumaninputImpl(nodeConfigtree);
                    }
                    break;
                case EnumTypeFielddefinition.Bool:
                    {
                        result = new Bool_HumaninputImpl(nodeConfigtree);
                    }
                    break;
                default:
                    {
                        // 未該当
                        result = null;
                        goto gt_Error_Unspported;
                    }
            }

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

                Log_TextIndented s = new Log_TextIndentedImpl();

                s.Append("フィールド定義を元にして、フィールド値を用意しようとしましたが、未定義のフィールド型でした。");
                s.Newline();

                s.Append("this.Type.ToString()=[");
                s.Append(this.ToString_Type());
                s.Append("]");
                s.Newline();

                r.Message = s.ToString();
                log_Reports.EndCreateReport();
            }
            goto gt_EndMethod;
            //────────────────────────────────────────
            #endregion
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return result;
        }
示例#12
0
        /// <summary>
        /// 空行を作成します。
        /// </summary>
        /// <returns></returns>
        public Record_Humaninput CreateNewRecord(string config, Log_Reports log_Reports)
        {
            Log_Method log_Method = new Log_MethodImpl(0);
            log_Method.BeginMethod(Info_Table.Name_Library, this, "CreateNewRecord", log_Reports);

            // 新しいレコードを1つ作ります。
            DataRow newDataRow = this.DataTable.NewRow();
            // 全ての列は現在、DBNullになっています。

            // ひとまず、全ての列に有効なインスタンスを設定します。

            int indexColumn = 0;
            this.RecordFielddefinition.ForEach(delegate(Fielddefinition fielddefinition, ref bool isBreak2, Log_Reports log_Reports2)
            {
                // 列の型を調べます。

                // セルのソースヒント名
                string nodeConfigtree_NameOfCell;
                if ("" == fielddefinition.Name_Trimupper)
                {
                    // 名無しフィールド

                    // フィールド名がないので、インデックスで指定します。
                    Log_TextIndented s = new Log_TextIndentedImpl();
                    s.Append("(");
                    s.Append(indexColumn);
                    s.Append(")番フィールド");
                    nodeConfigtree_NameOfCell = s.ToString();
                }
                else
                {
                    nodeConfigtree_NameOfCell = fielddefinition.Name_Humaninput;
                }

                switch (fielddefinition.Type_Field)
                {
                    case EnumTypeFielddefinition.String:
                        {
                            String_HumaninputImpl stringH = new String_HumaninputImpl(nodeConfigtree_NameOfCell);
                            stringH.Text = "";

                            if ("" == fielddefinition.Name_Trimupper)
                            {
                                // 名無しフィールド
                                // フィールド名がないので、インデックスで指定します。
                                newDataRow[indexColumn] = stringH;
                            }
                            else
                            {
                                newDataRow[fielddefinition.Name_Trimupper] = stringH;
                            }
                        }
                        break;
                    case EnumTypeFielddefinition.Int:
                        {
                            Int_HumaninputImpl intH = new Int_HumaninputImpl(nodeConfigtree_NameOfCell);
                            intH.Text = "";

                            if ("" == fielddefinition.Name_Trimupper)
                            {
                                // 名無しフィールド
                                // フィールド名がないので、インデックスで指定します。
                                newDataRow[indexColumn] = intH;
                            }
                            else
                            {
                                newDataRow[fielddefinition.Name_Trimupper] = intH;
                            }
                        }
                        break;
                    case EnumTypeFielddefinition.Bool:
                        {
                            Bool_HumaninputImpl boolH = new Bool_HumaninputImpl(nodeConfigtree_NameOfCell);
                            boolH.Text = "";

                            if ("" == fielddefinition.Name_Trimupper)
                            {
                                // 名無しフィールド
                                // フィールド名がないので、インデックスで指定します。
                                newDataRow[indexColumn] = boolH;
                            }
                            else
                            {
                                newDataRow[fielddefinition.Name_Trimupper] = boolH;
                            }
                        }
                        break;
                    default:
                        {
                            // 正常(警告は出したい)

                            if (log_Reports.CanCreateReport)
                            {
                                Log_RecordReports r = log_Reports.BeginCreateReport(EnumReport.Warning);
                                r.SetTitle("▲エラー431!", log_Method);

                                Log_TextIndented s = new Log_TextIndentedImpl();
                                s.Newline();
                                s.Append("この列は、未定義の型です。[" + fielddefinition.ToString_Type() + "]");
                                r.Message = s.ToString();

                                log_Reports.EndCreateReport();
                            }

                            // 文字列型を入れる。
                            String_HumaninputImpl stringH = new String_HumaninputImpl(nodeConfigtree_NameOfCell);
                            stringH.Text = "";

                            if ("" == fielddefinition.Name_Trimupper)
                            {
                                // 名無しフィールド
                                // フィールド名がないので、インデックスで指定します。
                                newDataRow[indexColumn] = stringH;
                            }
                            else
                            {
                                newDataRow[fielddefinition.Name_Trimupper] = stringH;
                            }
                        }
                        break;
                }

                indexColumn++;
            }, log_Reports);

            goto gt_EndMethod;
            //
            gt_EndMethod:
            log_Method.EndMethod(log_Reports);
            return new Record_HumaninputImpl(config, newDataRow, this);
        }
示例#13
0
        //────────────────────────────────────────
        /// <summary>
        /// O_TableImpl#AddRecordListで使います。
        /// </summary>
        /// <param name="columnIndex"></param>
        /// <param name="value"></param>
        /// <param name="oTable"></param>
        /// <param name="log_Reports"></param>
        /// <returns></returns>
        public static Value_Humaninput ConfigurationTo_Field(
            int index_Column,
            string value,
            RecordFielddefinition recordFielddefinition,
            Log_Reports log_Reports
            )
        {
            Log_Method log_Method = new Log_MethodImpl();
            log_Method.BeginMethod(Info_Table.Name_Library, "Utility_Row", "ConfigurationTo_Field", log_Reports);
            //

            //
            // セルのソースヒント名
            string nodeConfigtree;
            try
            {
                nodeConfigtree = recordFielddefinition.ValueAt(index_Column).Name_Humaninput;
            }
            catch (ArgumentOutOfRangeException)
            {
                // エラー
                goto gt_Error_Index;
            }

            Value_Humaninput result;

            // 型毎に処理を分けます。
            switch (recordFielddefinition.ValueAt(index_Column).Type_Field)
            {
                case EnumTypeFielddefinition.Int:
                    {
                        // 空白データも自動処理
                        Int_HumaninputImpl cellData = new Int_HumaninputImpl(nodeConfigtree);
                        cellData.Text = value;
                        result = cellData;
                    }
                    break;
                case EnumTypeFielddefinition.Bool:
                    {
                        // 空白データも自動処理
                        Bool_HumaninputImpl cellData = new Bool_HumaninputImpl(nodeConfigtree);
                        cellData.Text = value;
                        result = cellData;
                    }
                    break;
                default:
                    {
                        String_HumaninputImpl cellData = new String_HumaninputImpl(nodeConfigtree);
                        cellData.Text = value;
                        result = cellData;
                    }
                    break;
            }

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

                Log_TextIndented t = new Log_TextIndentedImpl();

                t.Append("列インデックス[" + index_Column + "](0スタート)が指定されましたが、");
                t.Newline();
                t.Append("列は[" + recordFielddefinition.Count + "]個しかありません。(列定義リストは、絞りこまれている場合もあります)");
                t.Newline();

                // ヒント

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