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 }
public CreatePocoClassHardWiredTemplate(DbfRow row) { _recNo_ = row.recNo; // assign properties with values of fields of DBF table // '/*FIELDASSIGNS*/' changed to makes target text, do not delete next line! /*DROP_LINE*/ /*FIELDASSIGNS*/ FIELDNAME = row.GetInt32(row.columns[(int)FieldNames.FIELDNAME]); /*DROP_LINE*/ // syntax check/template for generated code }
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 }