Exemplo n.º 1
0
        private string[] getAuthorizedUsers()
        {
            AprService srv = new AprService();

            var cached_users = srv.getCachedAdminUserNames();

            if (cached_users != null)
            {
                return(cached_users);
            }

            var db_sers = srv.getAdminUserNames();

            if (db_sers.Length > 0)
            {
                srv.CacheAdminUsernames(db_sers);
            }

            return(db_sers);
        }
Exemplo n.º 2
0
        private PageInput getLocationsDropdown()
        {
            PageInput LocationInput = new PageInput("select", "SELECT A Location", "CID", "CID", "");

            try
            {
                ManagerService service = new ManagerService();

                List <Models.EF.Corporate> locations = service.getLocations();

                if (locations == null || locations.Count == 0)
                {
                    LocationInput.errorFlag    = true;
                    LocationInput.errorMessage = "ERROR: No Locations found in database.";
                    return(LocationInput);
                }

                AprService aprservice = new AprService();

                locations = aprservice.filterInActiveLocations(locations);

                foreach (var item in locations)
                {
                    LocationInput.input.options.Add(new InputObject.option {
                        text = item.CorporateName, value = item.CID.ToString()
                    });
                }
            }
            catch (Exception ex)
            {
                LocationInput.errorFlag    = true;
                LocationInput.errorMessage = "ERROR CREATING FB SELECT LIST: " + ex.Message;
            }

            return(LocationInput);
        }