protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         OrgID = System.Convert.ToInt32(Session["TenantID"]);
     }
     catch (Exception ex)
     {
         try
         {
             OrgID = System.Convert.ToInt32(Request.QueryString["OrgID"]);
         }
         catch (Exception ex2)
         {
         }
     }
     Header.InnerText = GUIDataLayer.getHeader(OrgID);
     footer.InnerText = GUIDataLayer.getFooter(OrgID);
     container.Style.Remove("background-image");
     container.Style.Add("background-image", "url('" + GUIDataLayer.getImage(OrgID) + "')");
     string[] linkIDs   = GUIDataLayer.getLinks(OrgID);
     string[] linkNames = GUIDataLayer.getLinkNames(linkIDs);
     string[] linkURLs  = GUIDataLayer.getLinkURLs(linkIDs);
     for (int x = 0; x < linkURLs.Length; x++)
     {
         links.Controls.Add(new LiteralControl("<li><a href=" + linkURLs[x] + " class=\"style1\">" + linkNames[x] + "</a></li>"));
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["user"] == null)
        {
            Response.Redirect("login.aspx");
        }
        if (System.Convert.ToInt32(Session["admin"]) != 1)
        {
            Response.Redirect("CustomerLogin.aspx");
        }
        else
        {
            try
            {
                OrgID = System.Convert.ToInt32(Session["TenantID"]);
            }
            catch (Exception ex)
            {
                OrgID = 0;
            }
        }
        ListItem toAdd;
        int      count = 0;
        bool     done  = false;

        if (!IsPostBack)
        {
            links     = GUIDataLayer.getLinks(OrgID);
            linkNames = GUIDataLayer.getLinkNames(links);
            while (count < 20 & !done)
            {
                if (links[count] == null)
                {
                    done = true;
                }
                else
                {
                    toAdd       = null;
                    toAdd       = new ListItem();
                    toAdd.Text  = linkNames[count];
                    toAdd.Value = links[count];
                    blLinks.Items.Add(toAdd);
                    count++;
                }
            }
        }
    }