public SobekCM_Item Next() { // Is this a valid row? if (row >= excelData.Rows.Count) { return(null); } // Create the object based on the column mapping SobekCM_Item returnPackage = new SobekCM_Item(); // reset the static variables in the mappings class Bibliographic_Mapping.clear_static_variables(); // Add data from each column into the bib package // Step through each column in the data row DataRow thisRow = excelData.Rows[row++]; for (int i = 0; i < excelData.Columns.Count; i++) { if ((thisRow[i] != null) && (thisRow[i].ToString().Length > 0) && (columnMaps.isMapped(i))) { Bibliographic_Mapping.Add_Data(returnPackage, thisRow[i].ToString(), columnMaps.Get_Field(i).Field); } } return(returnPackage); }
public void Add_To_Package(SobekCM_Item Package) { // reset the static variables in the mappings class Bibliographic_Mapping.clear_static_variables(); // Step through each constant data and add it foreach (Constant_Field_Data thisData in constantCollection) { Bibliographic_Mapping.Add_Data(Package, thisData.Data, thisData.Field); } }
private SobekCM_Item Load_Data_From_DataRow_And_Constants(DataRow currentRow) { // Check to see if this is a completely empty row bool empty_row = true; for (int i = 0; i < currentRow.ItemArray.Length; i++) { if (currentRow[i].ToString().Trim().Length > 0) { empty_row = false; break; } } // If this is empty, skip it if (empty_row) { return(null); } // Create the bibliographic package SobekCM_Item bibPackage = new SobekCM_Item(); // reset the static variables in the mappings class Bibliographic_Mapping.clear_static_variables(); // Step through each column in the data row and add the data into the bib package for (int i = 0; (i < inputDataTbl.Columns.Count) && (i < mapping.Count); i++) { if (currentRow[i].ToString().Length > 0) { Bibliographic_Mapping.Add_Data(bibPackage, currentRow[i].ToString(), mapping[i]); } } // Copy all user settings to this package base.Copy_User_Settings_To_Package(bibPackage); // Return the built object return(bibPackage); }