Esempio n. 1
0
    public void BindPageDetail(int id)
    {
        try
        {
            DotNetNuke.Framework.CDefault p = (DotNetNuke.Framework.CDefault) this.Page;
            objDAEntities.PageTypeId = id;
            dsBindPageDetail         = Cache["SpecialtyPage_BindPageDetailCache"] as DataSet;

            if (dsBindPageDetail == null)
            {
                dsBindPageDetail = new DataSet();
                dsBindPageDetail = (DataSet)objBusinessLogic.GetBannerPageContentDetail(id);
                Cache.Insert("SpecialtyPage_BindPageDetailCache", dsBindPageDetail);
            }

            if (dsBindPageDetail.Tables[1].Rows.Count > 0)
            {
                innerParagraph.InnerHtml = Convert.ToString(dsBindPageDetail.Tables[1].Rows[0]["Content"]);
                p.Title       = Convert.ToString(dsBindPageDetail.Tables[1].Rows[0]["PageTitle"]);
                p.KeyWords    = Convert.ToString(dsBindPageDetail.Tables[1].Rows[0]["PageKeywords"]);
                p.Description = Convert.ToString(dsBindPageDetail.Tables[1].Rows[0]["PageDescription"]);
            }
            else
            {
                Div1.Visible = false;
            }
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 2
0
    public void BindPageDetail(int id)
    {
        try
        {
            DotNetNuke.Framework.CDefault p = (DotNetNuke.Framework.CDefault) this.Page;

            objDAEntities.PageTypeId = id;
            //dsBindPageDetail = (DataSet)objBusinessLogic.GetBannerPageContentDetail(objDAEntities);

            dsBindPageDetail = (DataSet)Cache[AppGlobal.SpecialityOPD_detailCache];

            if (dsBindPageDetail == null)
            {
                dsBindPageDetail = (DataSet)objBusinessLogic.GetBannerPageContentDetail(id);
                Cache.Insert(AppGlobal.SpecialityOPD_detailCache, dsBindPageDetail);
            }



            if (Convert.ToString(dsBindPageDetail.Tables[1].Rows[0]["Content"]) != null || Convert.ToString(dsBindPageDetail.Tables[1].Rows[0]["Content"]) != "")
            {
                p.Title       = dsBindPageDetail.Tables[1].Rows[0]["PageTitle"].ToString();
                p.KeyWords    = dsBindPageDetail.Tables[1].Rows[0]["PageKeywords"].ToString();
                p.Description = dsBindPageDetail.Tables[1].Rows[0]["PageDescription"].ToString();
            }
            else
            {
                // contentpane.Visible = false;
            }
        }
        catch (Exception ex)
        {
        }
    }
    public void BindUserDetail(int uid)
    {
        try
        {
            DataSet ds = new DataSet();
            ds = null;
            objDAEntities.UserId = uid;

            ds = (DataSet)objBusinessLogic.GetUserDetails(objDAEntities);
            if (ds.Tables[0].Rows.Count > 0)
            {
                imgProfile.ImageUrl            = Convert.ToString(ds.Tables[0].Rows[0]["ImageUrl"]);
                FindDName.InnerText            = Convert.ToString(ds.Tables[0].Rows[0]["Name"]);
                lblDoctorDesignation.InnerText = Convert.ToString(ds.Tables[0].Rows[0]["Designation"]);
                //pbodyDesignation.InnerText = Convert.ToString(ds.Tables[0].Rows[0]["Designation"]);
                pbodyDescription.InnerHtml = Convert.ToString(ds.Tables[0].Rows[0]["Description"]);

                DotNetNuke.Framework.CDefault p = (DotNetNuke.Framework.CDefault) this.Page;
                if (!string.IsNullOrEmpty(FindDName.InnerText))
                {
                    p.Title = FindDName.InnerText + " | Jaslok Hospital";
                }
            }
            else
            {
                DivNotfound.Visible = true;
                DivDetail.Visible   = false;
            }
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 4
0
    public void BindPageDetail(int id)
    {
        try
        {
            DotNetNuke.Framework.CDefault p = (DotNetNuke.Framework.CDefault) this.Page;
            DataSet ds = new DataSet();

            if (Request.QueryString["SI"] != null && Convert.ToInt32(Request.QueryString["SI"]) > 0)
            {
                int SID = Convert.ToInt32(Request.QueryString["SI"]);
                ds = (DataSet)objBusinessLogic.GetSpecialtiesDescription(SID);
                // string _specialtyName = GetBanner(ds);
                if (!string.IsNullOrEmpty(Convert.ToString(ds.Tables[0].Rows[0]["BannerImage"])))
                {
                    imgbanner.ImageUrl = Convert.ToString(ds.Tables[0].Rows[0]["BannerImage"]);
                }
                else
                {
                    imgbanner.Visible = false;
                }
            }
            else
            {
                imgbanner.Visible = false;
            }


            //imgbanner.ImageUrl = CommonFn.DefaultInnerpageBanner;
            ds = null;
            ds = (DataSet)objBusinessLogic.GetDoctorDetails(objDAEntities.DoctorId);
            if (ds.Tables[0].Rows.Count > 0)
            {
                imgDoctor.ImageUrl        = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["ImageUrl"].ToString()) ? CommonFn.DefaultImagePath : ds.Tables[0].Rows[0]["ImageUrl"].ToString();
                lblDoctorName.Text        = Convert.ToString(ds.Tables[0].Rows[0]["Name"]);
                divDesignation.InnerText  = Convert.ToString(ds.Tables[0].Rows[0]["Designation"]);
                divDescription.InnerHtml  = Convert.ToString(ds.Tables[0].Rows[0]["Description"]);
                divBriefWriteUp.InnerHtml = Convert.ToString(ds.Tables[0].Rows[0]["BriefWriteUp"]);
                divAwards.InnerHtml       = Convert.ToString(ds.Tables[0].Rows[0]["Awards"]);
                p.Title    = "Find a Doctor | Jaslok Hospital";
                p.KeyWords = lblDoctorName.Text;
            }
            if (ds.Tables[1].Rows.Count > 0)
            {
                DataRow[] foundRows;
                string    sortOrder = "SpecialtyName ASC";
                foundRows = ds.Tables[1].Select("SpecialityId =" + objDAEntities.SpecialtyId, sortOrder);
                lblDocotrSpecialty.Text = Convert.ToString(foundRows[0]["SpecialtyName"]);
            }
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 5
0
    public void BindPageDetail(int id)
    {
        try
        {
            DotNetNuke.Framework.CDefault p = (DotNetNuke.Framework.CDefault) this.Page;

            DataSet ds = new DataSet();
            ds = null;
            objDAEntities.PageTypeId = id;
            ds = (DataSet)Cache[id.ToString()];
            if (ds == null)
            {
                //Response.Write("Content - database call");
                ds = (DataSet)objBusinessLogic.GetBannerPageContentDetail(id);
                Cache.Insert(id.ToString(), ds);
            }

            /*else
             *  Response.Write("Content - Cache call");*/

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (Request.RawUrl.ToLower().Contains("corporate-Profile") || Request.RawUrl.ToLower().Contains("corporate-profile"))
                {
                    //imgbanner.ImageUrl = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["ImageUrl"].ToString()) ? CommonFn.DefaultInnerpageBanner : ds.Tables[0].Rows[0]["ImageUrl"].ToString();
                    imgbanner.ImageUrl = "/Content/Banner/3_header_corporate_profile-20151217113731433.jpg";
                }
            }
            else
            {
                imgbanner.Visible = false;
            }
            // imgbanner.Visible = (Request.RawUrl.ToLower().ToLower() == "/corporate-profile" || "/corporate-profile") ? true : false;
            //if (Convert.ToString(ds.Tables[1].Rows[0]["Content"]) != null || Convert.ToString(ds.Tables[1].Rows[0]["Content"]) != "")

            if (ds.Tables[1].Rows.Count > 0)
            {
                contentpane.InnerHtml = Convert.ToString(ds.Tables[1].Rows[0]["Content"]);

                p.Title       = Convert.ToString(ds.Tables[1].Rows[0]["PageTitle"]);
                p.KeyWords    = Convert.ToString(ds.Tables[1].Rows[0]["PageKeywords"]);
                p.Description = Convert.ToString(ds.Tables[1].Rows[0]["PageDescription"]);
            }
            else
            {
                contentpane.Visible = false;
            }
        }
        catch (Exception ex)
        {
            Response.Write(ex.ToString());
        }
    }
Esempio n. 6
0
        /// <summary>
        /// Page_Init runs when the control is initialised
        /// </summary>
        /// <history>
        ///     [cnurse]	9/8/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        protected void Page_Init(Object sender, EventArgs e)
        {
            this.cmdProceed.Click += new EventHandler(cmdProceed_Click);
            //Set the Password Control Properties
            ctlPassword.ID = "Password";

            //Set the Profile Control Properties
            ctlProfile.ID = "Profile";

            //Override the redirected page title
            DotNetNuke.Framework.CDefault myPage = null;
            myPage       = (CDefault)this.Page;
            myPage.Title = Localization.GetString("ControlTitle_login", this.LocalResourceFile);
        }
    public void BindPageDetail(int id)
    {
        try
        {
            DotNetNuke.Framework.CDefault p = (DotNetNuke.Framework.CDefault) this.Page;

            DataSet ds = new DataSet();
            ds = null;
            objDAEntities.PageTypeId = id;

            //HomePageBanner.Visible = (Request.RawUrl.ToLower() == "/international-patients") ? true : false;
            ds = (DataSet)Cache[id.ToString()];
            if (ds == null)
            {
                //Response.Write("Content - database call");
                ds = (DataSet)objBusinessLogic.GetBannerPageContentDetail(id);
                Cache.Insert(id.ToString(), ds);
            }

            /*else
             *  Response.Write("Content - Cache call");*/
            //ds = (DataSet)objBusinessLogic.GetBannerPageContentDetail(objDAEntities);

            /*if (ds.Tables[0].Rows.Count > 0)
             * {
             *  imgbanner.ImageUrl = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["ImageUrl"].ToString()) ? CommonFn.DefaultInnerpageBanner : ds.Tables[0].Rows[0]["ImageUrl"].ToString();
             * }
             * else
             * {
             *  imgbanner.ImageUrl = CommonFn.DefaultInnerpageBanner;
             * }*/
            if (ds.Tables[1].Rows.Count > 0)
            {
                innerParagraph.InnerHtml = ds.Tables[1].Rows[0]["Content"].ToString();
                p.Title       = ds.Tables[1].Rows[0]["PageTitle"].ToString();
                p.KeyWords    = ds.Tables[1].Rows[0]["PageKeywords"].ToString();
                p.Description = ds.Tables[1].Rows[0]["PageDescription"].ToString();
            }
            else
            {
                innerParagraph.Visible = false;
            }
        }
        catch (Exception ex)
        {
            //Response.Write(ex.ToString());
        }
    }
Esempio n. 8
0
    public void BindPageBanner(int id)
    {
        try
        {
            DotNetNuke.Framework.CDefault p = (DotNetNuke.Framework.CDefault) this.Page;

            DataSet ds = new DataSet();
            ds = null;
            objDAEntities.PageTypeId = id;
            ds = (DataSet)objBusinessLogic.GetBannerPageContentDetail(objDAEntities.PageTypeId);
            if (ds.Tables[1].Rows.Count > 0)
            {
                p.Title       = ds.Tables[1].Rows[0]["PageTitle"].ToString();
                p.KeyWords    = ds.Tables[1].Rows[0]["PageKeywords"].ToString();
                p.Description = ds.Tables[1].Rows[0]["PageDescription"].ToString();
            }
        }
        catch (Exception ex)
        {
        }
    }
    public void BindPageDetail(int id)
    {
        try
        {
            DotNetNuke.Framework.CDefault p = (DotNetNuke.Framework.CDefault) this.Page;

            objDAEntities.PageTypeId = id;
            ds = (DataSet)objBusinessLogic.GetBannerPageContentDetail(id);

            //if (ds.Tables[0].Rows.Count > 0)
            //{
            //    imgbanner.ImageUrl = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["ImageUrl"].ToString()) ? CommonFn.DefaultInnerpageBanner : ds.Tables[0].Rows[0]["ImageUrl"].ToString();
            //}
            //else
            //{
            //    imgbanner.ImageUrl = CommonFn.DefaultInnerpageBanner;
            //}
            // imgbanner.Visible = (Request.RawUrl == "/corporate-profile") ? true : false;
            if (ds != null)
            {
                if (Convert.ToString(ds.Tables[1].Rows[0]["Content"]) != null || Convert.ToString(ds.Tables[1].Rows[0]["Content"]) != "")
                {
                    //contentpane.InnerHtml = ds.Tables[1].Rows[0]["Content"].ToString();

                    p.Title       = ds.Tables[1].Rows[0]["PageTitle"].ToString();
                    p.KeyWords    = ds.Tables[1].Rows[0]["PageKeywords"].ToString();
                    p.Description = ds.Tables[1].Rows[0]["PageDescription"].ToString();
                }
                else
                {
                    // contentpane.Visible = false;
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
    public void BindPageDetail(int id)
    {
        try
        {
            DotNetNuke.Framework.CDefault p = (DotNetNuke.Framework.CDefault) this.Page;

            DataSet ds = new DataSet();
            ds = null;
            objDAEntities.PageTypeId = id;
            ds = (DataSet)objBusinessLogic.GetBannerPageContentDetail(id);

            if (ds.Tables[0].Rows.Count > 0)
            {
                imgbanner.ImageUrl = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["ImageUrl"].ToString()) ? CommonFn.DefaultInnerpageBanner : ds.Tables[0].Rows[0]["ImageUrl"].ToString();
            }
            else
            {
                imgbanner.ImageUrl = CommonFn.DefaultInnerpageBanner;
            }

            if (Convert.ToString(ds.Tables[1].Rows[0]["Content"]) != null || Convert.ToString(ds.Tables[1].Rows[0]["Content"]) != "")
            {
                contentpane.InnerHtml = ds.Tables[1].Rows[0]["Content"].ToString();

                p.Title       = ds.Tables[1].Rows[0]["PageTitle"].ToString();
                p.KeyWords    = ds.Tables[1].Rows[0]["PageKeywords"].ToString();
                p.Description = ds.Tables[1].Rows[0]["PageDescription"].ToString();
            }
            else
            {
                contentpane.Visible = false;
            }
        }
        catch (Exception ex)
        {
        }
    }
    public void BindResearchPapersPageDetail()
    {
        try
        {
            DotNetNuke.Framework.CDefault p = (DotNetNuke.Framework.CDefault) this.Page;

            DataSet ds = new DataSet();

            ds = (DataSet)objBusinessLogic.GetResearchPapersPageContentDetail();

            if (ds.Tables[0].Rows.Count > 0)
            {
                rptResearchPapers.DataSource = ds;
                rptResearchPapers.DataBind();
            }
            else
            {
                contentpane.Visible = false;
            }
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 12
0
    public void BindPageDetail(int id)
    {
        try
        {
            DotNetNuke.Framework.CDefault p = (DotNetNuke.Framework.CDefault) this.Page;

            DataSet ds = new DataSet();
            ds = null;
            objDAEntities.PageTypeId = id;
            ds = (DataSet)objBusinessLogic.GetBannerPageContentDetail(id);
            HomePageBanner.Visible = (Request.RawUrl.ToLower() == "/patientfacilities") ? true : false;

            /*if (ds.Tables[0].Rows.Count > 0)
             * {
             *  imgbanner.ImageUrl = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["ImageUrl"].ToString()) ? CommonFn.DefaultInnerpageBanner : ds.Tables[0].Rows[0]["ImageUrl"].ToString();
             * }
             * else
             * {
             *  imgbanner.ImageUrl = CommonFn.DefaultInnerpageBanner;
             * }*/
            if (ds.Tables[1].Rows.Count > 0)
            {
                innerParagraph.InnerHtml = ds.Tables[1].Rows[0]["Content"].ToString();
                p.Title       = ds.Tables[1].Rows[0]["PageTitle"].ToString();
                p.KeyWords    = ds.Tables[1].Rows[0]["PageKeywords"].ToString();
                p.Description = ds.Tables[1].Rows[0]["PageDescription"].ToString();
            }
            else
            {
                innerParagraph.Visible = false;
            }
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 13
0
    public void BindTestimonials()
    {
        try
        {
            DataSet ds = new DataSet();
            ds = null;
            int id = Convert.ToInt32(Request.QueryString["TID"]);
            objDAEntities.TestimonialId = id;
            ds = (DataSet)objBusinessLogic.GetTestimonialByParm(objDAEntities);
            if (ds.Tables[0].Rows.Count > 0)
            {
                h4testimonialName.InnerHtml = ds.Tables[0].Rows[0]["Name"].ToString();
                imgTestimonialD.ImageUrl    = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["ProfileImageUrl"].ToString()) ? CommonFn.DefaultImagePath : ds.Tables[0].Rows[0]["ProfileImageUrl"].ToString();
                pTestimonial.InnerHtml      = ds.Tables[0].Rows[0]["Comment"].ToString();
                if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["ImageUrl"].ToString()) && string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Comment"].ToString()))
                {
                    imgTestimonial.Visible  = true;
                    imgTestimonial.ImageUrl = ds.Tables[0].Rows[0]["ImageUrl"].ToString();
                }

                DotNetNuke.Framework.CDefault p = (DotNetNuke.Framework.CDefault) this.Page;
                if (!string.IsNullOrEmpty(h4testimonialName.InnerHtml))
                {
                    p.Title = h4testimonialName.InnerHtml + " - Testimonial | Jaslok Hospital";
                }
            }



            //rptInnerTestimonials.DataSource = dsTestimonials;
            //rptInnerTestimonials.DataBind();
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 14
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="defaultPage"></param>
        /// <param name="prevLink"></param>
        /// <param name="nextLink"></param>
        private static void SetPagingMeta(CDefault defaultPage, string prevLink, string nextLink)
        {
            if (prevLink != null)
            {
                var linkPrev = new HyperLink();
                linkPrev.Attributes.Add("rel", "prev");
                linkPrev.NavigateUrl = prevLink;
                defaultPage.Header.Controls.Add(linkPrev);
            }

            if (nextLink != null)
            {
                var linkNext = new HyperLink();
                linkNext.Attributes.Add("rel", "next");
                linkNext.NavigateUrl = nextLink;
                defaultPage.Header.Controls.Add(linkNext);
            }
        }
Esempio n. 15
0
        /// <summary>
        /// This method is meant to update SEO related meta information in the DotNetNuke base page. It is passed different information based on which specific 'page' in the module is being viewed.
        /// </summary>
        /// <param name="defaultPage"></param>
        /// <param name="modContext"></param>
        /// <param name="title"></param>
        /// <param name="content"></param>
        /// <param name="keyWords"></param>
        /// <param name="link"></param>
        private static void SetPageMetaAndOpenGraph(CDefault defaultPage, ModuleInstanceContext modContext, string title, string content, string keyWords, string link)
        {
            defaultPage.Title = title;

            var meta = new HtmlMeta();
            meta.Attributes.Add("property", "og:title");
            meta.Attributes.Add("content", title);
            defaultPage.Header.Controls.Add(meta);

            content = StripTagsCharArray(HttpUtility.HtmlDecode(content));
            var description = TruncateString(content, Constants.SeoDescriptionLimit, false);

            if (description.Length > 0)
            {
                defaultPage.Description = description;

                meta = new HtmlMeta();
                meta.Attributes.Add("property", "og:description");
                meta.Attributes.Add("content", description);
                defaultPage.Header.Controls.Add(meta);
            }

            meta = new HtmlMeta();
            meta.Attributes.Add("property", "og:type");
            meta.Attributes.Add("content", "article");
            defaultPage.Header.Controls.Add(meta);

            if (keyWords.Length > 0)
            {
                defaultPage.KeyWords = keyWords;

                meta = new HtmlMeta();
                meta.Attributes.Add("property", "article:tag");
                meta.Attributes.Add("content", keyWords);
                defaultPage.Header.Controls.Add(meta);
            }

            meta = new HtmlMeta();
            meta.Attributes.Add("property", "og:url");
            meta.Attributes.Add("content", link);
            defaultPage.Header.Controls.Add(meta);

            meta = new HtmlMeta();
            meta.Attributes.Add("property", "og:site_name");
            meta.Attributes.Add("content", modContext.PortalSettings.PortalName);
            defaultPage.Header.Controls.Add(meta);

            if (modContext.PortalSettings.LogoFile.Trim().Length > 0)
            {
                meta = new HtmlMeta();
                meta.Attributes.Add("property", "og:image");
                meta.Attributes.Add("content", "http://" + modContext.PortalAlias.HTTPAlias + "/Portals/" + modContext.PortalId + "/" + modContext.PortalSettings.LogoFile);
                defaultPage.Header.Controls.Add(meta);

            }
        }
Esempio n. 16
0
        /// <summary>
        /// Sets the Page Meta information for the TagDetail.ascx view. 
        /// </summary>
        /// <param name="defaultPage"></param>
        /// <param name="objTerm"></param>
        /// <param name="modContext"></param>
        /// <param name="pageTitle"></param>
        /// <param name="description"></param>
        public static void SetTermPageMeta(CDefault defaultPage, TermInfo objTerm, ModuleInstanceContext modContext, string pageTitle, string description)
        {
            var title = TruncateString(pageTitle + " - " + modContext.PortalSettings.PortalName, Constants.SeoTitleLimit, false);
            var content = TruncateString(description, Constants.SeoDescriptionLimit, false);
            var link = Links.ViewTagDetail(modContext, modContext.TabId, objTerm.Name);
            var keyWords = objTerm.Name;

            SetPageMetaAndOpenGraph(defaultPage, modContext, title, content, keyWords, link);
        }
Esempio n. 17
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="defaultPage"></param>
        /// <param name="modContext"></param>
        /// <param name="pageTitle"></param>
        /// <param name="description"></param>
        /// <param name="link"></param>
        /// <param name="prevLink"></param>
        /// <param name="nextLink"></param>
        public static void SetTagsPageMeta(CDefault defaultPage, ModuleInstanceContext modContext, string pageTitle, string description, string link, string prevLink, string nextLink)
        {
            var title = TruncateString(pageTitle + " - " + modContext.PortalSettings.PortalName, Constants.SeoTitleLimit, false);
            var content = TruncateString(description, Constants.SeoDescriptionLimit, false);
            var keyWords = defaultPage.KeyWords;

            SetPageMetaAndOpenGraph(defaultPage, modContext, title, content, keyWords, link);
            SetPagingMeta(defaultPage, prevLink, nextLink);
        }
Esempio n. 18
0
        /// <summary>
        ///  Sets the Page Meta information for the Question.ascx view. 
        /// </summary>
        /// <param name="defaultPage"></param>
        /// <param name="objQuestion"></param>
        /// <param name="modContext"></param>
        /// <remarks>Need to wire in page to accept page param in URL.</remarks>
        public static void SetQuestionPageMeta(CDefault defaultPage,AlbumInfo objQuestion, ModuleInstanceContext modContext)
        {
            var title = TruncateString(objQuestion.AlbumName + " - " + modContext.PortalSettings.PortalName, Constants.SeoTitleLimit, false);
            var content = TruncateString(objQuestion.ShortContent, Constants.SeoDescriptionLimit, false);
            var link = Links.ViewQuestion(objQuestion.AlbumID, objQuestion.AlbumName, modContext.PortalSettings.ActiveTab, modContext.PortalSettings);
            var keyWords = "";
            var keyCount = 1;
            var count = keyCount;

            var terms=Conten

            foreach (var term in objQuestion.Terms.TakeWhile(term => count <= Constants.SeoKeywordsLimit))
            {
                keyWords += "," + term.Name;
                keyCount += 1;
            }

            SetPageMetaAndOpenGraph(defaultPage, modContext, title, content, keyWords, link);
        }
Esempio n. 19
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="defaultPage"></param>
 /// <param name="modContext"></param>
 /// <param name="title"></param>
 /// <param name="description"></param>
 public static void SetPrivilegePageMeta(CDefault defaultPage, ModuleInstanceContext modContext, string title, string description)
 {
     var link = Links.ViewPrivilege(modContext, title);
     SetPageMetaAndOpenGraph(defaultPage, modContext, title, description, "", link);
 }
Esempio n. 20
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="defaultPage"></param>
        /// <param name="modContext"></param>
        /// <remarks>In this method we don't really want to override the dnn stuff, we simply want to add the OG stuff.</remarks>
        public static void SetHomePageMeta(CDefault defaultPage, ModuleInstanceContext modContext)
        {
            var link = Links.Home(modContext.TabId);
            var content = defaultPage.Description;
            var title = defaultPage.Title;
            var keyWords = defaultPage.KeyWords;

            SetPageMetaAndOpenGraph(defaultPage, modContext, title, content, keyWords, link);
        }
Esempio n. 21
0
 public static void SetBadgesPageMeta(CDefault defaultPage, ModuleInstanceContext modContext, string title, string description, string link)
 {
     SetPageMetaAndOpenGraph(defaultPage, modContext, title, description, "", link);
 }
        private static void Handle404OrException(FriendlyUrlSettings settings, HttpContext context, Exception ex, UrlAction result, bool transfer, bool showDebug)
        {
            //handle Auto-Add Alias
            if (result.Action == ActionType.Output404 && CanAutoAddPortalAlias())
            {
                //Need to determine if this is a real 404 or a possible new alias.
                var portalId = Host.Host.HostPortalID;
                if (portalId > Null.NullInteger)
                {
                    if (string.IsNullOrEmpty(result.DomainName))
                    {
                        result.DomainName = Globals.GetDomainName(context.Request); //parse the domain name out of the request
                    }

                    //Get all the existing aliases
                    var aliases = PortalAliasController.Instance.GetPortalAliasesByPortalId(portalId).ToList();

                    bool autoaddAlias;
                    bool isPrimary = false;
                    if (!aliases.Any())
                    {
                        autoaddAlias = true;
                        isPrimary = true;
                    }
                    else
                    {
                        autoaddAlias = true;
                        foreach (var alias in aliases)
                        {
                            if (result.DomainName.ToLowerInvariant().IndexOf(alias.HTTPAlias, StringComparison.Ordinal) == 0
                                    && result.DomainName.Length >= alias.HTTPAlias.Length)
                            {
                                autoaddAlias = false;
                                break;
                            }
                        }
                    }

                    if (autoaddAlias)
                    {
                        var portalAliasInfo = new PortalAliasInfo
                                                  {
                                                      PortalID = portalId, 
                                                      HTTPAlias = result.DomainName,
                                                      IsPrimary = isPrimary
                                                  };
                        PortalAliasController.Instance.AddPortalAlias(portalAliasInfo);

                        context.Response.Redirect(context.Request.Url.ToString(), true);
                    }
                }
            }


            if (context != null)
            {
                HttpRequest request = context.Request;
                HttpResponse response = context.Response;
                HttpServerUtility server = context.Server;

                const string errorPageHtmlHeader = @"<html><head><title>{0}</title></head><body>";
                const string errorPageHtmlFooter = @"</body></html>";
                var errorPageHtml = new StringWriter();
                CustomErrorsSection ceSection = null;
                //876 : security catch for custom error reading
                try
                {
                    ceSection = (CustomErrorsSection) WebConfigurationManager.GetSection("system.web/customErrors");
                }
// ReSharper disable EmptyGeneralCatchClause
                catch (Exception)
// ReSharper restore EmptyGeneralCatchClause
                {
                    //on some medium trust environments, this will throw an exception for trying to read the custom Errors
                    //do nothing
                }

                /* 454 new 404/500 error handling routine */
                bool useDNNTab = false;
                int errTabId = -1;
                string errUrl = null;
                string status = "";
                bool isPostback = false;
                if (settings != null)
                {
                    if (request.RequestType == "POST")
                    {
                        isPostback = true;
                    }
                    if (result != null && ex != null)
                    {
                        result.DebugMessages.Add("Exception: " + ex.Message);
                        result.DebugMessages.Add("Stack Trace: " + ex.StackTrace);
                        if (ex.InnerException != null)
                        {
                            result.DebugMessages.Add("Inner Ex : " + ex.InnerException.Message);
                            result.DebugMessages.Add("Stack Trace: " + ex.InnerException.StackTrace);
                        }
                        else
                        {
                            result.DebugMessages.Add("Inner Ex : null");
                        }
                    }
                    string errRH;
                    string errRV;
                    int statusCode;
                    if (result != null && result.Action != ActionType.Output404)
                    {
                        //output everything but 404 (usually 500)
                        if (settings.TabId500 > -1) //tabid specified for 500 error page, use that
                        {
                            useDNNTab = true;
                            errTabId = settings.TabId500;
                        }
                        errUrl = settings.Url500;
                        errRH = "X-UrlRewriter-500";
                        errRV = "500 Rewritten to {0} : {1}";
                        statusCode = 500;
                        status = "500 Internal Server Error";
                    }
                    else //output 404 error 
                    {
                        if (settings.TabId404 > -1) //if the tabid is specified for a 404 page, then use that
                        {
                            useDNNTab = true;
                            errTabId = settings.TabId404;
                        }
                        if (!String.IsNullOrEmpty(settings.Regex404))
                            //with 404 errors, there's an option to catch certain urls and use an external url for extra processing.
                        {
                            try
                            {
                                //944 : check the original Url in case the requested Url has been rewritten before discovering it's a 404 error
                                string requestedUrl = request.Url.ToString();
                                if (result != null && string.IsNullOrEmpty(result.OriginalPath) == false)
                                {
                                    requestedUrl = result.OriginalPath;
                                }
                                if (Regex.IsMatch(requestedUrl, settings.Regex404, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant))
                                {
                                    useDNNTab = false;
                                        //if we have a match in the 404 regex value, then don't use the tabid
                                }
                            }
                            catch (Exception regexEx)
                            {
                                //.some type of exception : output in response header, and go back to using the tabid 
                                response.AppendHeader("X-UrlRewriter-404Exception", regexEx.Message);
                            }
                        }
                        errUrl = settings.Url404;
                        errRH = "X-UrlRewriter-404";
                        errRV = "404 Rewritten to {0} : {1} : Reason {2}";
                        status = "404 Not Found";
                        statusCode = 404;
                    }

                    // check for 404 logging
                    if ((result == null || result.Action == ActionType.Output404))
                    {
                        //Log 404 errors to Event Log
                        UrlRewriterUtils.Log404(request, settings, result);
                    }
                    //912 : use unhandled 404 switch
                    string reason404 = null;
                    bool unhandled404 = true;
                    if (useDNNTab && errTabId > -1)
                    {
                        unhandled404 = false; //we're handling it here
                        TabInfo errTab = TabController.Instance.GetTab(errTabId, result.PortalId, true);
                        if (errTab != null)
                        {
                            bool redirect = false;
                            //ok, valid tabid.  what we're going to do is to load up this tab via a rewrite of the url, and then change the output status
                            string reason = "Not Found";
                            if (result != null)
                            {
                                reason = result.Reason.ToString();
                            }
                            response.AppendHeader(errRH, string.Format(errRV, "DNN Tab",
                                                                errTab.TabName + "(Tabid:" + errTabId.ToString() + ")",
                                                                reason));
                            //show debug messages even if in debug mode
                            if (context != null && response != null && result != null && showDebug)
                            {
                                ShowDebugData(context, result.OriginalPath, result, null);
                            }
                            if (!isPostback)
                            {
                                response.ClearContent();
                                response.StatusCode = statusCode;
                                response.Status = status;
                            }
                            else
                            {
                                redirect = true;
                                    //redirect postbacks as you can't postback successfully to a server.transfer
                            }
                            errUrl = Globals.glbDefaultPage + TabIndexController.CreateRewritePath(errTab.TabID, "");
                            //have to update the portal settings with the new tabid
                            PortalSettings ps = null;
                            if (context != null && context.Items != null)
                            {
                                if (context.Items.Contains("PortalSettings"))
                                {
                                    ps = (PortalSettings) context.Items["PortalSettings"];
                                    context.Items.Remove("PortalSettings"); //nix it from the context
                                }
                            }
                            if (ps != null && ps.PortalAlias != null)
                            {
                                ps = new PortalSettings(errTabId, ps.PortalAlias);
                            }
                            else
                            {
                                if (result.HttpAlias != null && result.PortalId > -1)
                                {
                                    PortalAliasInfo pa = PortalAliasController.Instance.GetPortalAlias(result.HttpAlias, result.PortalId);
                                    ps = new PortalSettings(errTabId, pa);
                                }
                                else
                                {
                                    //912 : handle 404 when no valid portal can be identified
                                    //results when iis is configured to handle portal alias, but 
                                    //DNN isn't.  This always returns 404 because a multi-portal site
                                    //can't just show the 404 page of the host site.
                                    ArrayList portals = PortalController.Instance.GetPortals();
                                    if (portals != null && portals.Count == 1)
                                    {
                                        //single portal install, load up portal settings for this portal
                                        var singlePortal = (PortalInfo) portals[0];
                                        //list of aliases from database
                                        var aliases = PortalAliasController.Instance.GetPortalAliasesByPortalId(singlePortal.PortalID).ToList();
                                        //list of aliases from Advanced Url settings
                                        List<string> chosen = aliases.GetAliasesForPortalId(singlePortal.PortalID);
                                        PortalAliasInfo useFor404 = null;
                                        //go through all aliases and either get the first valid one, or the first 
                                        //as chosen in the advanced url management settings
                                        foreach (var pa in aliases)
                                        {
                                            if (useFor404 == null)
                                            {
                                                useFor404 = pa; //first one by default
                                            }

                                            //matching?
                                            if (chosen != null && chosen.Count > 0)
                                            {
                                                if (chosen.Contains(pa.HTTPAlias))
                                                {
                                                    useFor404 = pa;
                                                }
                                            }
                                            else
                                            {
                                                break; //no further checking
                                            }
                                        }
                                        //now configure that as the portal settings
                                        if (useFor404 != null)
                                        {
                                            //create portal settings context for identified portal alias in single portal install
                                            ps = new PortalSettings(errTabId, useFor404);
                                        }
                                    }
                                    else
                                    {
                                        reason404 = "Requested domain name is not configured as valid website";
                                        unhandled404 = true;
                                    }
                                }
                            }
                            if (ps != null)
                            {
                                //re-add the context items portal settings back in
                                context.Items.Add("PortalSettings", ps);
                            }
                            if (redirect)
                            {
                                errUrl = TestableGlobals.Instance.NavigateURL();
                                response.Redirect(errUrl, true); //redirect and end response.  
                                //It will mean the user will have to postback again, but it will work the second time
                            }
                            else
                            {
                                if (transfer)
                                {
                                    //execute a server transfer to the default.aspx?tabid=xx url
                                    //767 : object not set error on extensionless 404 errors
                                    if (context.User == null)
                                    {
                                        context.User = Thread.CurrentPrincipal;
                                    }
                                    response.TrySkipIisCustomErrors = true;
                                    //881 : spoof the basePage object so that the client dependency framework
                                    //is satisfied it's working with a page-based handler
                                    IHttpHandler spoofPage = new CDefault();
                                    context.Handler = spoofPage;
                                    server.Transfer("~/" + errUrl, true);
                                }
                                else
                                {
                                    context.RewritePath("~/Default.aspx", false);
                                    response.TrySkipIisCustomErrors = true;
                                    response.Status = "404 Not Found";
                                    response.StatusCode = 404;
                                }
                            }
                        }
                    }
                    //912 : change to new if statement to handle cases where the TabId404 couldn't be handled correctly
                    if (unhandled404)
                    {
                        //proces the error on the external Url by rewriting to the external url
                        if (!String.IsNullOrEmpty(errUrl))
                        {
                            response.ClearContent();
                            response.TrySkipIisCustomErrors = true;
                            string reason = "Not Found";
                            if (result != null)
                            {
                                reason = result.Reason.ToString();
                            }
                            response.AppendHeader(errRH, string.Format(errRV, "Url", errUrl, reason));
                            if (reason404 != null)
                            {
                                response.AppendHeader("X-Url-Master-404-Data", reason404);
                            }
                            response.StatusCode = statusCode;
                            response.Status = status;
                            server.Transfer("~/" + errUrl, true);
                        }
                        else
                        {
                            errorPageHtml.Write(status + "<br>The requested Url does not return any valid content.");
                            if (reason404 != null)
                            {
                                errorPageHtml.Write(status + "<br>" + reason404);
                            }
                            errorPageHtml.Write("<div style='font-weight:bolder'>Administrators</div>");
                            errorPageHtml.Write("<div>Change this message by configuring a specific 404 Error Page or Url for this website.</div>");

                            //output a reason for the 404
                            string reason = "";
                            if (result != null)
                            {
                                reason = result.Reason.ToString();
                            }
                            if (!string.IsNullOrEmpty(errRH) && !string.IsNullOrEmpty(reason))
                            {
                                response.AppendHeader(errRH, reason);
                            }
                            response.StatusCode = statusCode;
                            response.Status = status;
                        }
                    }
                }
                else
                {
                    //fallback output if not valid settings
                    if (result != null && result.Action == ActionType.Output404)
                    {
                        //don't restate the requested Url to prevent cross site scripting
                        errorPageHtml.Write("404 Not Found<br>The requested Url does not return any valid content.");
                        response.StatusCode = 404;
                        response.Status = "404 Not Found";
                    }
                    else
                    {
                        //error, especially if invalid result object

                        errorPageHtml.Write("500 Server Error<br><div style='font-weight:bolder'>An error occured during processing : if possible, check the event log of the server</div>");
                        response.StatusCode = 500;
                        response.Status = "500 Internal Server Error";
                        if (result != null)
                        {
                            result.Action = ActionType.Output500;
                        }
                    }
                }

                if (ex != null)
                {
                    if (context != null)
                    {
                        if (context.Items.Contains("UrlRewrite:Exception") == false)
                        {
                            context.Items.Add("UrlRewrite:Exception", ex.Message);
                            context.Items.Add("UrlRewrite:StackTrace", ex.StackTrace);
                        }
                    }

                    if (ceSection != null && ceSection.Mode == CustomErrorsMode.Off)
                    {
                        errorPageHtml.Write(errorPageHtmlHeader);
                        errorPageHtml.Write("<div style='font-weight:bolder'>Exception:</div><div>" + ex.Message + "</div>");
                        errorPageHtml.Write("<div style='font-weight:bolder'>Stack Trace:</div><div>" + ex.StackTrace + "</div>");
                        errorPageHtml.Write("<div style='font-weight:bolder'>Administrators</div>");
                        errorPageHtml.Write("<div>You can see this exception because the customErrors attribute in the web.config is set to 'off'.  Change this value to 'on' or 'RemoteOnly' to show Error Handling</div>");
                        try
                        {
                            if (errUrl != null && errUrl.StartsWith("~"))
                            {
                                errUrl = VirtualPathUtility.ToAbsolute(errUrl);
                            }
                        }
                        finally
                        {
                            if (errUrl != null)
                            {
                                errorPageHtml.Write("<div>The error handling would have shown this page : <a href='" + errUrl + "'>" + errUrl + "</a></div>");
                            }
                            else
                            {
                                errorPageHtml.Write("<div>The error handling could not determine the correct page to show.</div>");
                            }
                        }
                    }
                }

                string errorPageHtmlBody = errorPageHtml.ToString();
                if (errorPageHtmlBody.Length > 0)
                {
                    response.Write(errorPageHtmlHeader);
                    response.Write(errorPageHtmlBody);
                    response.Write(errorPageHtmlFooter);
                }
                if (ex != null)
                {
                    UrlRewriterUtils.LogExceptionInRequest(ex, status, result);
                }
            }
        }
    //public void BindPageDetail(int id)
    //{

    //    try
    //    {
    //        DotNetNuke.Framework.CDefault p = (DotNetNuke.Framework.CDefault)this.Page;

    //        DataSet ds = new DataSet();
    //        ds = null;
    //        objDAEntities.PageTypeId = id;
    //        ds = (DataSet)objBusinessLogic.GetBannerPageContentDetail(objDAEntities);
    //        /*if (ds.Tables[0].Rows.Count > 0)
    //        {
    //            imgbanner.ImageUrl = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["ImageUrl"].ToString()) ? CommonFn.DefaultInnerpageBanner : ds.Tables[0].Rows[0]["ImageUrl"].ToString();
    //        }
    //        else
    //        {
    //            imgbanner.ImageUrl = CommonFn.DefaultInnerpageBanner;
    //        }*/
    //        if (ds.Tables[1].Rows.Count > 0)
    //        {
    //            if (Convert.ToString(ds.Tables[1].Rows[0]["Content"]).Length>0)
    //            {
    //                innerParagraph.Visible = true;
    //                innerParagraph.InnerHtml = Convert.ToString(ds.Tables[1].Rows[0]["Content"]);
    //            }
    //            else
    //            {
    //                innerParaDiv.Visible = false;
    //            }
    //            p.Title = ds.Tables[1].Rows[0]["PageTitle"].ToString();
    //            p.KeyWords = ds.Tables[1].Rows[0]["PageKeywords"].ToString();
    //            p.Description = ds.Tables[1].Rows[0]["PageDescription"].ToString();
    //        }

    //    }
    //    catch (Exception ex)
    //    {
    //    }
    //}

    public void BindSpecialties(int id)
    {
        try
        {
            DataSet ds = new DataSet();
            ds = null;
            ds = (DataSet)objBusinessLogic.GetDoctoDetailbySID(id);

            if (!string.IsNullOrEmpty(Convert.ToString(ds.Tables[0].Rows[0]["keyword"])))
            {
                CDefault tp = (CDefault)this.Page;
                tp.KeyWords = Convert.ToString(ds.Tables[0].Rows[0]["keyword"]);
            }
            //string _specialtyName = String.Empty;
            if (Convert.ToString(ds.Tables[0].Rows[0]["CategoryName"]) == "Patient Facilities")
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    h3header1.InnerHtml = Convert.ToString(ds.Tables[0].Rows[0]["SpecialtyName"]);
                    h3subheader.Visible = false;
                    //_specialtyName = GetBanner(ds);
                    //if (!string.IsNullOrEmpty(Convert.ToString(ds.Tables[0].Rows[0]["BannerImage"])))
                    //{
                    //    imgAbout.ImageUrl = Convert.ToString(ds.Tables[0].Rows[0]["BannerImage"]);
                    //}
                    //else
                    //{
                    //    imgAbout.Visible = false;
                    //}
                    imgAbout.Visible = false;
                    // aboutheader.Visible = false;
                    PAboutSD.InnerHtml   = Convert.ToString(ds.Tables[0].Rows[0]["About"]);
                    leftPanelTab.Visible = false;
                }
            }
            else
            {
                //leftPanelTab.Visible = true;
                if (ds.Tables[0].Rows.Count > 0)
                {
                    h3header1.InnerHtml = Convert.ToString(ds.Tables[0].Rows[0]["SpecialtyName"]);
                    //_specialtyName = GetBanner(ds);
                    if (!string.IsNullOrEmpty(Convert.ToString(ds.Tables[0].Rows[0]["BannerImage"])))
                    {
                        imgAbout.ImageUrl = Convert.ToString(ds.Tables[0].Rows[0]["BannerImage"]);
                    }
                    else
                    {
                        imgAbout.Visible = false;
                    }
                    objDAEntities.SpecialtyId = Convert.ToInt32(ds.Tables[0].Rows[0]["SpecialtyId"]);
                    PAboutSD.InnerHtml        = Convert.ToString(ds.Tables[0].Rows[0]["About"]);
                    PFacilities.InnerHtml     = Convert.ToString(ds.Tables[0].Rows[0]["Facilities"]);
                }
                if (ds.Tables[1].Rows.Count > 0)
                {
                    datalistOurSpecialtyDs.DataSource = ds.Tables[1];
                    datalistOurSpecialtyDs.DataBind();
                }
            }
            lblAboutmsg.Visible      = (PAboutSD.InnerHtml.Length > 0) ? false : true;
            lblFacilitiesMsg.Visible = (PFacilities.InnerHtml.Length > 0) ? false : true;
            lblNoRec.Visible         = (datalistOurSpecialtyDs.Items.Count > 0) ? false : true;



            DotNetNuke.Framework.CDefault p = (DotNetNuke.Framework.CDefault) this.Page;
            if (!string.IsNullOrEmpty(h3header1.InnerHtml))
            {
                p.Title = h3header1.InnerHtml + " | Jaslok Hospital";
            }
            else
            {
                p.Title = "Specialties | Jaslok Hospital";
            }
            p.KeyWords = Convert.ToString(ds.Tables[0].Rows[0]["keyword"]);
            // p.Description = ds.Tables[1].Rows[0]["PageDescription"].ToString();
        }
        catch (Exception ex)
        {
        }
    }