Exemple #1
0
 private static int _GetRecordCount(User user, DBConnect connection, FilterInfo filter)
 {
     try
     {
         int recCount = 0;
         using (var queryPage = connection.Select("COUNT(*)", SrcH850, $"WHERE {filter.ToSearchQueryString(user, searchCols)} AND POStatus IN (0, 1)"))
         {
             if (queryPage.Read())
             {
                 if (!int.TryParse(queryPage.Field(0), out recCount))
                 {
                     recCount = 0;
                 }
             }
         }
         return(recCount);
     }
     catch (Exception e)
     {
         ProgramLog.LogError(user, nameof(PdsManager), nameof(_GetRecordCount), e.Message);
         return(0);
     }
 }
Exemple #2
0
        private static int _GetRecordCount(User user, DBConnect connection, FilterInfo filter)
        {
            int recCount = 0;

            try
            {
                using (var queryPage = connection.Select("COUNT(*)", CatXref, $"WHERE {filter.ToSearchQueryString(user, searchCols)}"))
                {
                    if (queryPage.Read())
                    {
                        if (!int.TryParse(queryPage.Field(0), out recCount))
                        {
                            recCount = 0;
                        }
                    }
                }
            }
            catch (Exception e)
            {
                ProgramLog.LogError(user, nameof(CatalogXrefManager), nameof(_GetRecordCount), e.Message);
            }
            return(recCount);
        }