public static RLExcel_ContactsRecordList ToList <T>(T[] array, Func <T, RCExcel_ContactsRecord> converter) { RLExcel_ContactsRecordList result = new RLExcel_ContactsRecordList(); result.InnerFromArray(array, converter); return(result); }
public static RLExcel_ContactsRecordList FromRestList <T>(RestList <T> restList, Func <T, RCExcel_ContactsRecord> converter) { RLExcel_ContactsRecordList result = new RLExcel_ContactsRecordList(); result.InnerFromRestList(restList, converter); return(result); }
public WORLExcel_ContactsRecordList(RLExcel_ContactsRecordList rl) { rl = (RLExcel_ContactsRecordList)rl.Duplicate(); Array = new WORCExcel_ContactsRecord[rl.Length]; while (!rl.Eof) { Array[rl.CurrentRowNumber] = new WORCExcel_ContactsRecord(rl.CurrentRec); rl.Advance(); } }
/// <summary> /// Excel To RecordList : ExcelToRLBootstrapContactsConvertFromExcel of Action "BootstrapContacts" /// </summary> public static void ExcelToRLBootstrapContactsConvertFromExcel(HeContext heContext, byte[] excelContent, string tableName, out RLExcel_ContactsRecordList outParamOut) { int totalColumns = 4; if (excelContent.GetLength(0) == 0) { throw new Exception("Error - Empty (0 bytes) excel file received."); } string userTableName = tableName; // for error msg ExcelResultSet reader = new ExcelResultSet( excelContent, tableName, totalColumns, new string[] { typeof(string).Name, typeof(string).Name, typeof(string).Name, typeof(string).Name } , new string[] { "Name", "JobTitle", "Phone", "Email" } , new string[] { "Name", "Job Title", "Phone", "Email" } , new string[] { "Name", "JobTitle", "Phone", "Email" } , new string[] { "Name", "Job Title", "Phone", "Email" }); string errorMsg; if (!reader.DataTypesValid(out errorMsg)) { throw new Exception(errorMsg); } RLExcel_ContactsRecordList tmp = new RLExcel_ContactsRecordList(); tmp.Reader = reader; outParamOut = (RLExcel_ContactsRecordList)tmp; }
public static T[] ToArray <T>(RLExcel_ContactsRecordList recordlist, Func <RCExcel_ContactsRecord, T> converter) { return(InnerToArray(recordlist, converter)); }