示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 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();
     }
 }
示例#4
0
            /// <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;
            }
示例#5
0
 public static T[] ToArray <T>(RLExcel_ContactsRecordList recordlist, Func <RCExcel_ContactsRecord, T> converter)
 {
     return(InnerToArray(recordlist, converter));
 }