Пример #1
0
        // Static Factory

        public static IList <IUser> GetAllUsers(AExternalReader externalData)
        {
            IList <IUser> users = new List <IUser>();

            foreach (IList <string> row in externalData.GetAllCells())
            {
                if (row[2].ToLower().Equals("password") &&
                    row[7].ToLower().Equals("state"))
                {
                    continue;
                }

                users.Add(Get()
                          .SetFirstName(row[0])
                          .SetLastName(row[1])
                          .SetPassword(row[2])
                          .SetAddress1(row[3])
                          .SetCountry(row[4])
                          .SetCity(row[5])
                          .SetPostalCode(row[6])
                          .SetState(row[7])
                          .SetHomePhone(row[8])
                          .SetSex(row[9])
                          .SetMobilePhone(row[10])
                          .SetSpecialOffers(row[11].ToLower().Equals("true"))
                          .SetSingNewsletter(row[12].ToLower().Equals("true"))
                          .SetDateOfBirth(row[13].Remove(10))
                          .SetEmail(row[14])
                          .Build());
            }
            return(users);
        }
Пример #2
0
        // Static Factory

        public static IList <IUser> GetAllUsers(AExternalReader externalData)
        {
            //logger.Debug("Start GetAllUsers, path = " + path);
            IList <IUser> users = new List <IUser>();

            foreach (IList <string> row in externalData.GetAllCells())
            {
                if (row[3].ToLower().Equals("email") &&
                    row[10].ToLower().Equals("password"))
                {
                    continue;
                }
                users.Add(Get()
                          .SetLogin(row[0])
                          .SetFirstname(row[1])
                          .SetLastname(row[2])
                          .SetEmail(row[3])
                          .SetPhone(row[4])
                          .SetAddressMain(row[5])
                          .SetCity(row[6])
                          .SetPostcode(row[7])
                          .SetCoutry(row[8])
                          .SetRegionState(row[9])
                          .SetPassword(row[10])
                          .SetSubscribe(row[11].ToLower().Equals("true"))
                          .Build());
                //logger.Debug("Add User Firstname= " + row[1] + " Lastname = " + row[2] + " Email = " + row[3]);
            }
            //logger.Debug("Done GetAllUsers, path = " + externalData.GetConnection());
            return(users);
        }
Пример #3
0
        public static IList <IUser> GetAllUsers(AExternalReader externalData)
        {
            IList <IUser> users     = new List <IUser>();
            bool          isCaption = true;

            foreach (IList <string> row in externalData.GetAllCells())
            {
                if (isCaption)
                {
                    isCaption = false;
                    continue;
                }
                users.Add(new User(row[0], row[1]));
            }
            return(users);
        }