コード例 #1
0
ファイル: scStatements.cs プロジェクト: campbeln/cn-namespace
        ///############################################################
        /// <summary>
        /// Initializes the class based on the provided data.
        /// </summary>
        /// <param name="oInputData">InputData representing the column's metadata.</param>
        ///############################################################
        /// <LastUpdated>January 11, 2010</LastUpdated>
        public void Reset(Web.Inputs.InputData oInputData)
        {
            //#### Set the local variables to the passed data
            g_sColumnName = oInputData.ColumnName;
            g_sValue      = oInputData.Value;

            //#### Determine the oInputData's .SaveType, translating it into the proper enumValueOperators
            switch (oInputData.SaveType)
            {
            case Web.Inputs.enumSaveTypes.cnID: {
                g_eOperator = enumValueOperators.cnWhereEqualTo;
                break;
            }

            case Web.Inputs.enumSaveTypes.cnIgnore: {
                g_eOperator = enumValueOperators.cnIgnore;
                break;
            }

            case Web.Inputs.enumSaveTypes.cnInsertNull: {
                g_eOperator = enumValueOperators.cnInsertNull;
                break;
            }

            case Web.Inputs.enumSaveTypes.cnInsertNullString: {
                g_eOperator = enumValueOperators.cnInsertNullString;
                break;
            }

            default: {
                g_eOperator = enumValueOperators.cnInsertIfPresent;
                break;
            }
            }

            //#### If the .ValueType is of a .cnVerbatum, set g_bQuote to false
            if (oInputData.ValueType == MetaData.enumValueTypes.cnVerbatum)
            {
                g_bQuote = false;
            }
            //#### Else if the .DataType is numeric, .Make(the g_sValue a)Number and set g_bQuote to false
            else if (oInputData.DataType == MetaData.enumDataTypes.cnInteger ||
                     oInputData.DataType == MetaData.enumDataTypes.cnFloat ||
                     oInputData.DataType == MetaData.enumDataTypes.cnCurrency
                     )
            {
//! what about (1.0) negetive numbers?
                g_sValue = Data.Tools.MakeNumeric(g_sValue, "0");
                g_bQuote = false;
            }
            //#### Else the .DataType is non-numeric and non-verbatum, so set g_bQuote to true
            else
            {
                g_bQuote = true;
            }
        }
コード例 #2
0
ファイル: scStatements.cs プロジェクト: campbeln/cn-namespace
 ///############################################################
 /// <summary>
 /// Resets the class to its initilized state based on the provided data.
 /// </summary>
 /// <param name="oInputData">InputData representing the column's metadata.</param>
 ///############################################################
 /// <LastUpdated>January 11, 2010</LastUpdated>
 public ColumnDescription(Web.Inputs.InputData oInputData)
 {
     //#### Call .Reset to init the class vars
     Reset(oInputData);
 }