コード例 #1
0
        /// <summary>
        /// Extract value from RfcColumn by using the correct method for the
        /// column type and put extracted value into the DataColumn.
        /// </summary>
        /// <param name="rfcColumn">Value source.</param>
        /// <param name="dataRow">Value destination.</param>
        /// <param name="dataColumn">Column to be set from destination.</param>
        private void SetDataColumnValueFromRfcColumn(IRfcField rfcColumn, DataRow dataRow, DataColumn dataColumn)
        {
            if (dataColumn.DataType == typeof(byte[]))
            {
                dataRow[dataColumn.ColumnName] = rfcColumn.GetByteArray();

                return;
            }

            if (dataColumn.DataType == typeof(int))
            {
                dataRow[dataColumn.ColumnName] = rfcColumn.GetInt();

                return;
            }

            if (dataColumn.DataType == typeof(byte))
            {
                dataRow[dataColumn.ColumnName] = rfcColumn.GetByte();

                return;
            }

            if (dataColumn.DataType == typeof(short))
            {
                dataRow[dataColumn.ColumnName] = rfcColumn.GetShort();

                return;
            }

            if (dataColumn.DataType == typeof(double))
            {
                dataRow[dataColumn.ColumnName] = rfcColumn.GetDouble();

                return;
            }

            dataRow[dataColumn.ColumnName] = rfcColumn.GetString();
        }
コード例 #2
0
ファイル: SapCommand.cs プロジェクト: peder/NSAPConnector
        /// <summary>
        /// Extract value from RfcColumn by using the correct method for the 
        /// column type and put extracted value into the DataColumn.
        /// </summary>
        /// <param name="rfcColumn">Value source.</param>
        /// <param name="dataRow">Value destination.</param>
        /// <param name="dataColumn">Column to be set from destination.</param>
        private void SetDataColumnValueFromRfcColumn(IRfcField rfcColumn, DataRow dataRow, DataColumn dataColumn)
        {
            if( dataColumn.DataType == typeof(byte[]))
            {
                dataRow[dataColumn.ColumnName] = rfcColumn.GetByteArray();

                return;
            }

            if (dataColumn.DataType == typeof(int))
            {
                dataRow[dataColumn.ColumnName] = rfcColumn.GetInt();

                return;
            }

            if (dataColumn.DataType == typeof(byte))
            {
                dataRow[dataColumn.ColumnName] = rfcColumn.GetByte();

                return;
            }

            if (dataColumn.DataType == typeof(short))
            {
                dataRow[dataColumn.ColumnName] = rfcColumn.GetShort();

                return;
            }

            if (dataColumn.DataType == typeof(double))
            {
                dataRow[dataColumn.ColumnName] = rfcColumn.GetDouble();

                return;
            }

            dataRow[dataColumn.ColumnName] = rfcColumn.GetString();
        }