Beispiel #1
0
        public void RetrieveAll(Data_AppUserFile.SortType sort, d1_Data_AppUserFile d, IMyLog log)
        {
            string strCmdFmt = "SELECT * FROM {0} ORDER BY {1}";
            string strCmd    = "";

            switch (sort)
            {
            case Data_AppUserFile.SortType.Date:
                strCmd = string.Format(strCmdFmt, TABLE_NAME, "[CreationDateUtc]"); break;

            case Data_AppUserFile.SortType.State:
                strCmd = string.Format(strCmdFmt, TABLE_NAME, "[AccountStatus]"); break;

            case Data_AppUserFile.SortType.Email:
                strCmd = string.Format(strCmdFmt, TABLE_NAME, "[Email]"); break;

            default: throw new NotSupportedException("Unknown sort - " + sort.ToString());
            }

            using (SqlDisposable s = new SqlDisposable(Db, strCmd))
            {
                while (s.Reader.Read())
                {
                    Data_AppUserFile r1 = readOneRecord(s.Reader);
                    d(r1);
                }
            }
        }
Beispiel #2
0
        public void RetrieveAll(Data_AppUserFile.SortType sort, d1_Data_AppUserFile d, IMyLog log)
        {
            List <Data_AppUserFile> allUsers = new List <Data_AppUserFile>();

            foreach (string s1 in Directory.GetFiles(FolderNames.GetFolder(NiceSystemInfo.DEFAULT, MyFolders.ASP_UserAccountFolder_)))
            {
                string           file = Path.GetFileNameWithoutExtension(s1);
                Data_AppUserFile u1   = this.RetrieveOne(file, log);
                allUsers.Add(u1);
            }
            Sort(allUsers, sort);
            foreach (Data_AppUserFile u1 in allUsers)
            {
                if (d != null)
                {
                    d(u1);
                }
            }
        }