private static void AddSiftaAdminLinks(Telerik.Web.UI.RadMenu menu)
        {
            var mainItem = new Telerik.Web.UI.RadMenuItem()
            {
                Text = "SIFTA Admin", OuterCssClass = "adminMenuItem"
            };

            mainItem.Items.Add(new Telerik.Web.UI.RadMenuItem("Metrics", "~/Reports/Metrics/national.aspx"));
            mainItem.Items.Add(new Telerik.Web.UI.RadMenuItem("Image Search", "~/Reports/Metrics/ImageSearch.aspx"));
            menu.Items.Add(mainItem);
        }
        public static void AddLinks(this Telerik.Web.UI.RadMenu menu)
        {
            menu.DataBind();
            SiftaDBDataContext siftaDB = new SiftaDBDataContext();
            User   user;
            String OrgCode;
            var    reportsItem = menu.Items.FirstOrDefault(p => p.Text == "Reports");

            if (!String.IsNullOrEmpty(HttpContext.Current.Request.QueryString["OrgCode"]))
            {
                OrgCode = HttpContext.Current.Request.QueryString["OrgCode"];
                user    = new User(OrgCode);
                reportsItem.Items.Add(new Telerik.Web.UI.RadMenuItem()
                {
                    Text = "Center", NavigateUrl = String.Format("~/Reports/Center/CenterReport.aspx?OrgCode={0}", OrgCode)
                });
                reportsItem.Items.Add(new Telerik.Web.UI.RadMenuItem()
                {
                    Text = "Coop Funding", NavigateUrl = String.Format("~/Reports/Center/CoopFunding.aspx?OrgCode={0}", OrgCode)
                });
                if (user.AdminPortalVisible)
                {
                    menu.Items.Add(new Telerik.Web.UI.RadMenuItem()
                    {
                        Text = "Center Admin", NavigateUrl = String.Format("~/Admin.aspx?OrgCode={0}", OrgCode), OuterCssClass = "adminMenuItem"
                    });
                }
                if (user.IsSuperUser)
                {
                    AddSiftaAdminLinks(menu);
                }
            }
            else if (!String.IsNullOrEmpty(HttpContext.Current.Request.QueryString["CustomerID"]))
            {
                var CustomerID = Convert.ToInt32(HttpContext.Current.Request.QueryString["CustomerID"]);
                OrgCode = siftaDB.Customers.FirstOrDefault(p => p.CustomerID == CustomerID).OrgCode;
                user    = new User(OrgCode);
                reportsItem.Items.Add(new Telerik.Web.UI.RadMenuItem()
                {
                    Text = "Center", NavigateUrl = String.Format("~/Reports/Center/CenterReport.aspx?OrgCode={0}", OrgCode)
                });
                if (user.AdminPortalVisible)
                {
                    menu.Items.Add(new Telerik.Web.UI.RadMenuItem()
                    {
                        Text = "Center Admin", NavigateUrl = String.Format("~/Admin.aspx?OrgCode={0}", OrgCode), OuterCssClass = "adminMenuItem"
                    });
                }
                if (user.IsSuperUser)
                {
                    AddSiftaAdminLinks(menu);
                }
            }
            else if (!String.IsNullOrEmpty(HttpContext.Current.Request.QueryString["AgreementID"]))
            {
                var AgreementID = Convert.ToInt32(HttpContext.Current.Request.QueryString["AgreementID"]);
                OrgCode = siftaDB.Agreements.FirstOrDefault(p => p.AgreementID == AgreementID).Customer.OrgCode;
                user    = new User(OrgCode);
                reportsItem.Items.Add(new Telerik.Web.UI.RadMenuItem()
                {
                    Text = "Center", NavigateUrl = String.Format("~/Reports/Center/CenterReport.aspx?OrgCode={0}", OrgCode)
                });
                reportsItem.Items.Add(new Telerik.Web.UI.RadMenuItem()
                {
                    Text = "Agreement", NavigateUrl = AppendBaseURL(String.Format("Reports/Agreement/AgreementReport.aspx?AgreementID={0}", AgreementID))
                });
                if (user.AdminPortalVisible)
                {
                    menu.Items.Add(new Telerik.Web.UI.RadMenuItem()
                    {
                        Text = "Center Admin", NavigateUrl = String.Format("~/Admin.aspx?OrgCode={0}", OrgCode), OuterCssClass = "adminMenuItem"
                    });
                }
                if (user.IsSuperUser)
                {
                    AddSiftaAdminLinks(menu);
                }
            }
            else if (!String.IsNullOrEmpty(HttpContext.Current.Request.QueryString["SalesOrderNumber"]))
            {
                var SalesOrderNumber = HttpContext.Current.Request.QueryString["SalesorderNumber"];
                var agreement        = siftaDB.Agreements.FirstOrDefault(p => p.SalesDocument == SalesOrderNumber);
                OrgCode = agreement.Customer.OrgCode;
                user    = new User(OrgCode);
                reportsItem.Items.Add(new Telerik.Web.UI.RadMenuItem()
                {
                    Text = "Center", NavigateUrl = String.Format("~/Reports/Center/CenterReport.aspx?OrgCode={0}", OrgCode)
                });
                reportsItem.Items.Add(new Telerik.Web.UI.RadMenuItem()
                {
                    Text = "Agreement", NavigateUrl = AppendBaseURL(String.Format("Reports/Agreement/AgreementReport.aspx?AgreementID={0}", agreement.AgreementID))
                });
                if (user.AdminPortalVisible)
                {
                    menu.Items.Add(new Telerik.Web.UI.RadMenuItem()
                    {
                        Text = "Center Admin", NavigateUrl = String.Format("~/Admin.aspx?OrgCode={0}", OrgCode), OuterCssClass = "adminMenuItem"
                    });
                }
                if (user.IsSuperUser)
                {
                    AddSiftaAdminLinks(menu);
                }
            }
            else if (!String.IsNullOrEmpty(HttpContext.Current.Request.QueryString["PurchaseOrderNumber"]))
            {
                var PurchaseOrderNumber = HttpContext.Current.Request.QueryString["PurchaseOrderNumber"];
                var agreement           = siftaDB.Agreements.FirstOrDefault(p => p.PurchaseOrderNumber == PurchaseOrderNumber);
                OrgCode = agreement.Customer.OrgCode;
                user    = new User(OrgCode);
                reportsItem.Items.Add(new Telerik.Web.UI.RadMenuItem()
                {
                    Text = "Center", NavigateUrl = String.Format("~/Reports/Center/CenterReport.aspx?OrgCode={0}", OrgCode)
                });
                reportsItem.Items.Add(new Telerik.Web.UI.RadMenuItem()
                {
                    Text = "Agreement", NavigateUrl = AppendBaseURL(String.Format("Reports/Agreement/AgreementReport.aspx?AgreementID={0}", agreement.AgreementID))
                });
                if (user.AdminPortalVisible)
                {
                    menu.Items.Add(new Telerik.Web.UI.RadMenuItem()
                    {
                        Text = "Center Admin", NavigateUrl = String.Format("~/Admin.aspx?OrgCode={0}", OrgCode), OuterCssClass = "adminMenuItem"
                    });
                }
                if (user.IsSuperUser)
                {
                    AddSiftaAdminLinks(menu);
                }
            }
            else
            {
                user = new User();
                if (user.IsSuperUser)
                {
                    AddSiftaAdminLinks(menu);
                }
            }
        }