Пример #1
0
        public WebsiteSecurity Website(int websiteId)
        {
            if (websiteSecurity.Count > 0)
            {
                for (int x = 0; x <= websiteSecurity.Count - 1; x++)
                {
                    if (websiteSecurity[x].websiteId == websiteId)
                    {
                        websiteSecurity[x].Init(this);
                        return(websiteSecurity[x]);
                    }
                }
            }

            //last resort, create a new website security object
            WebsiteSecurity ws = new WebsiteSecurity(this);

            ws.websiteId = websiteId;
            websiteSecurity.Add(ws);
            return(websiteSecurity[websiteSecurity.Count - 1]);
        }
Пример #2
0
        public WebsiteSecurity Website(int websiteId)
        {
            if (websiteSecurity.Count > 0)
            {
                for (int x = 0; x <= websiteSecurity.Count - 1; x++)
                {
                    if (websiteSecurity[x].websiteId == websiteId)
                    {
                        websiteSecurity[x].Init(this);
                        return websiteSecurity[x];
                    }

                }
            }

            //last resort, create a new website security object
            WebsiteSecurity ws = new WebsiteSecurity(this);
            ws.websiteId = websiteId;
            websiteSecurity.Add(ws);
            return websiteSecurity[websiteSecurity.Count - 1];
        }