private void ibnLogout_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            FormsAuthentication.SignOut();

            string[] dirs = TemplateSourceDirectory.Split(new Char[] { (Char)0x2f });

            if (dirs[1].ToUpper().Equals("CDA")) //source dir is root
            {
                Response.Redirect("/Default.aspx");
            }
            else
            {
                Response.Redirect("/" + dirs[1] + "/Default.aspx");
            }
        }
Example #2
0
        public void Page_Error(string error)
        {
            // Simple code to find root directory where edms.NET resides
            // Only supports 0 or 1 deep root directory
            string[] dirs = TemplateSourceDirectory.Split(new Char[] { (Char)0x2f });

            if (dirs[1].Equals("Administration")) // source dir is root
            {
                Response.Redirect("/Error.aspx?errmsg=" + HttpUtility.UrlEncode(error));
            }
            else if (dirs[1].Equals("CDA")) //source dir is root
            {
                Response.Redirect("/Error.aspx?errmsg=" + HttpUtility.UrlEncode(error));
            }
            else
            {
                Response.Redirect("/" + dirs[1] + "/Error.aspx?errmsg=" +
                                  HttpUtility.UrlEncode(error));
            }
        }
Example #3
0
        private string GetMacKeyModifier()
        {
            //NOTE:  duplicate of the version in page.cs, keep in sync

            // Use the page's directory and class name as part of the key (ASURT 64044)
            // We need to make sure that the hash is case insensitive, since the file system
            // is, and strange view state errors could otherwise happen (ASURT 128657)
            int pageHashCode = TemplateSourceDirectory.ToLower(CultureInfo.InvariantCulture).GetHashCode();

            pageHashCode += GetType().FullName.ToLower(CultureInfo.InvariantCulture).GetHashCode();

            string strKey = pageHashCode.ToString(NumberFormatInfo.InvariantInfo);

            // Modify the key with the ViewStateUserKey, if any (ASURT 126375)
            if (ViewStateUserKey != null)
            {
                strKey += ViewStateUserKey;
            }

            return(strKey);
        }
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [cnurse]	9/17/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        /// -----------------------------------------------------------------------------
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            cmdCancel.Click += OnCancelClick;
            cmdDelete.Click += OnDeleteClick;
            cmdUpdate.Click += OnUpdateClick;

            try
            {
                var objTabs = new TabController();

                var blnBanner = false;
                var blnSignup = false;

                if ((Request.QueryString["VendorID"] != null))
                {
                    VendorID = Int32.Parse(Request.QueryString["VendorID"]);
                }
                if (Request.QueryString["ctl"] != null && VendorID == -1)
                {
                    blnSignup = true;
                }
                if (Request.QueryString["banner"] != null)
                {
                    blnBanner = true;
                }
                if (Page.IsPostBack == false)
                {
                    ctlLogo.FileFilter = Globals.glbImageFileTypes;

                    addresssVendor.ModuleId      = ModuleId;
                    addresssVendor.StartTabIndex = 4;

                    var objVendors = new VendorController();
                    if (VendorID != -1)
                    {
                        VendorInfo objVendor;
                        if (Globals.IsHostTab(PortalSettings.ActiveTab.TabID) && UserInfo.IsSuperUser)
                        {
                            //Get Host Vendor
                            objVendor = objVendors.GetVendor(VendorID, Null.NullInteger);
                        }
                        else
                        {
                            //Get Portal Vendor
                            objVendor = objVendors.GetVendor(VendorID, PortalId);
                        }
                        if (objVendor != null)
                        {
                            txtVendorName.Text       = objVendor.VendorName;
                            txtFirstName.Text        = objVendor.FirstName;
                            txtLastName.Text         = objVendor.LastName;
                            ctlLogo.Url              = objVendor.LogoFile;
                            addresssVendor.Unit      = objVendor.Unit;
                            addresssVendor.Street    = objVendor.Street;
                            addresssVendor.City      = objVendor.City;
                            addresssVendor.Region    = objVendor.Region;
                            addresssVendor.Country   = objVendor.Country;
                            addresssVendor.Postal    = objVendor.PostalCode;
                            addresssVendor.Telephone = objVendor.Telephone;
                            addresssVendor.Fax       = objVendor.Fax;
                            addresssVendor.Cell      = objVendor.Cell;
                            txtEmail.Text            = objVendor.Email;
                            txtWebsite.Text          = objVendor.Website;
                            chkAuthorized.Checked    = objVendor.Authorized;
                            txtKeyWords.Text         = objVendor.KeyWords;

                            ctlAudit.CreatedByUser = objVendor.CreatedByUser;
                            ctlAudit.CreatedDate   = objVendor.CreatedDate.ToString();
                        }

                        //use dispatch method to load modules
                        var banners = ControlUtilities.LoadControl <Banners>(this, TemplateSourceDirectory.Remove(0, Globals.ApplicationPath.Length) + "/Banners.ascx");
                        banners.ID                  = "/Banners.ascx";
                        banners.VendorID            = VendorID;
                        banners.ModuleConfiguration = ModuleConfiguration;
                        divBanners.Controls.Add(banners);


                        var affiliates = ControlUtilities.LoadControl <Affiliates>(this, TemplateSourceDirectory.Remove(0, Globals.ApplicationPath.Length) + "/Affiliates.ascx");
                        affiliates.ID                  = "/Affiliates.ascx";
                        affiliates.VendorID            = VendorID;
                        affiliates.ModuleConfiguration = ModuleConfiguration;
                        divAffiliates.Controls.Add(affiliates);
                    }
                    else
                    {
                        chkAuthorized.Checked = true;
                        ctlAudit.Visible      = false;
                        cmdDelete.Visible     = false;
                        pnlBanners.Visible    = false;
                        pnlAffiliates.Visible = false;
                    }
                    if (blnSignup || blnBanner)
                    {
                        rowVendor1.Visible = false;
                        rowVendor2.Visible = false;
                        pnlVendor.Visible  = false;
                        cmdDelete.Visible  = false;
                        ctlAudit.Visible   = false;
                        if (blnBanner)
                        {
                            cmdUpdate.Visible = false;
                        }
                        else
                        {
                            cmdUpdate.Text = "Signup";
                        }
                    }
                    else
                    {
                        TabInfo objTab;
                        if (Globals.IsHostTab(PortalSettings.ActiveTab.TabID))
                        {
                            objTab = objTabs.GetTabByName("Vendors", Null.NullInteger);
                        }
                        else
                        {
                            objTab = objTabs.GetTabByName("Vendors", PortalId);
                        }
                        if (objTab != null)
                        {
                            ViewState["filter"] = Request.QueryString["filter"];
                        }
                    }
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }