Пример #1
0
        public CreatePocoClassSoftWiredTemplate(DbfRow row)
        {
            if (fieldColumns == null)
            { // First/Reinitialized use of this class (WARNING! DbfRow.IColumn[] definition must same in all call or use Reinitialize() smartly.
                string[] names = Enum.GetNames(typeof(FieldNames));
                fieldColumns = new IColumn[names.Length];

                for (int i = 0; i < names.Length; i++)
                {
                    fieldColumns[i] = row.FindColumnByName(names[i], partiallyFilledEnable); // if ! partiallyFilledEnable and not found a field, it throw an exeption
                }
            }

            //

            _recNo_ = row.recNo;

            IColumn column;

            // assign properties with values of fields of DBF table
            // '/*FIELDASSIGNS*/' changed to makes target text, do not delete next line!      /*DROP_LINE*/
            /*FIELDASSIGNS*/
            column = fieldColumns[(int)FieldNames.FIELDNAME]; /*DROP_LINE*/                         // syntax check/template for generated code
            if ((column != null) && !row.IsNull(column)) /*DROP_LINE*/                              // syntax check/template for generated code
            { /*DROP_LINE*/                                                                         // syntax check/template for generated code
                FIELDNAME = row.GetInt32(column); /*DROP_LINE*/                                     // syntax check/template for generated code
            } /*DROP_LINE*/                                                                         // syntax check/template for generated code
        }
Пример #2
0
        public CreatePocoClassDynamicTemplate(DbfRow row, bool partiallyFilledEnable)
        {
            _recNo_ = row.recNo;

            IColumn column;

            // assign properties with values of fields of DBF table
            // '/*FIELDASSIGNS*/' changed to makes target text, do not delete next line!      /*DROP_LINE*/
            /*FIELDASSIGNS*/
            column = row.FindColumnByName("FIELDNAME", partiallyFilledEnable); /*DROP_LINE*/        // syntax check/template for generated code
            if ((column != null) && !row.IsNull(column)) /*DROP_LINE*/                              // syntax check/template for generated code
            { /*DROP_LINE*/                                                                         // syntax check/template for generated code
                FIELDNAME = row.GetInt32(column); /*DROP_LINE*/                                     // syntax check/template for generated code
            } /*DROP_LINE*/                                                                         // syntax check/template for generated code
        }