当前位置: 首页>>代码示例>>C#>>正文


C# DataLayer.GetFiveTopics方法代码示例

本文整理汇总了C#中DataLayer.GetFiveTopics方法的典型用法代码示例。如果您正苦于以下问题:C# DataLayer.GetFiveTopics方法的具体用法?C# DataLayer.GetFiveTopics怎么用?C# DataLayer.GetFiveTopics使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataLayer的用法示例。


在下文中一共展示了DataLayer.GetFiveTopics方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!User.Identity.IsAuthenticated)
        //{
        //    Session["resultColor"] = "#ff0000";
        //    Session["resultTitle"] = "Members Only";
        //    Session["resultMessage"] = "This is a members only area.<br />You must log in first.";
        //    Session["resultReturnURL"] = "Directory.aspx";
        //    Response.Redirect("Result.aspx", true);
        //}

        DataLayer dl = new DataLayer();
        loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
        DataTable dtRandomMember = dl.GetRandomMember();
        loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
        if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
        {
            loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
        }
        loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));

        DataTable dtMemberAd = dl.GetRandomAd();
        loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));

        if (User.Identity.IsAuthenticated)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
            DataTable dtTopics = dl.GetFiveTopics();
            foreach (DataRow dr in dtTopics.Rows)
            {
                loggedinpanels.Controls.Add(new LiteralControl("<li><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));
        }
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:35,代码来源:Directory.aspx.cs

示例2: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!User.Identity.IsAuthenticated)
        //{
        //    Session["resultColor"] = "#ff0000";
        //    Session["resultTitle"] = "Members Only";
        //    Session["resultMessage"] = "This is a members only area.<br />You must log in first.";
        //    Session["resultReturnURL"] = "DailyMotivatorArchive.aspx";
        //    Response.Redirect("Result.aspx", true);
        //}

        int iPageNumber = 0;
        if (Request.QueryString["p"] != null)
        {
            iPageNumber = Convert.ToInt32(Request.QueryString["p"]);
        }

        DataLayer dl = new DataLayer();
        int iMaxPages = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(dl.GetDailyMotivatorCount()) / 10m));
        pageNav1.NumPages = iMaxPages;
        pageNav2.NumPages = iMaxPages;

        loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
        DataTable dtRandomMember = dl.GetRandomMember();
        loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
        if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
        {
            loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
        }
        loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));

        DataTable dtMemberAd = dl.GetRandomAd();
        loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));

        loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
        DataTable dtTopics = dl.GetFiveTopics();
        foreach (DataRow dr in dtTopics.Rows)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<li><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
        }
        loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));

        DataTable dtDailyMotivators = dl.GetTenDailyMotivatorsBy_Page(iPageNumber);
        foreach (DataRow dr in dtDailyMotivators.Rows)
        {
            string sYouTubeLink = dr.ItemArray[5].ToString();
            if (sYouTubeLink != "No Video.")
            {
                sYouTubeLink = sYouTubeLink.Replace(".com/watch?v=", ".com/v/");
                dailymotivators.InnerHtml += "<center><object width=\"425\" height=\"344\"><param name=\"movie\" value=\"" + sYouTubeLink + "&amp;hl=en_US&amp;fs=1&amp;\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"" + sYouTubeLink + "&amp;hl=en_US&amp;fs=1&amp;\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"425\" height=\"344\"></embed></object></center>";
            }
            dailymotivators.InnerHtml += "<center>" + dr.ItemArray[4].ToString() + "</center><br /><hr /><br />";
        }
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:54,代码来源:DailyMotivatorArchive.aspx.cs

示例3: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        DataLayer dl = new DataLayer();
        if (!this.IsPostBack)
        {
            string sAboutUs = dl.GetAboutUsContent();
            rteBody.Value = sAboutUs;
        }

        if (User.Identity.IsAuthenticated)
        {
            if (!dl.IsMemberAdmin(User.Identity.Name))
            {
                Session["resultColor"] = "#ff0000";
                Session["resultTitle"] = "Not Authorized";
                Session["resultMessage"] = "You are not authorized to access this area.";
                Session["resultReturnURL"] = "Default.aspx";
                Response.Redirect("Result.aspx");
            }
        }
        else
        {
            Session["resultColor"] = "#ff0000";
            Session["resultTitle"] = "Not Logged In";
            Session["resultMessage"] = "You must log in first.";
            Session["resultReturnURL"] = "ManageBlogs.aspx";
            Response.Redirect("Result.aspx");
        }

        loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
        DataTable dtRandomMember = dl.GetRandomMember();
        loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
        if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
        {
            loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
        }
        loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));

        DataTable dtMemberAd = dl.GetRandomAd();
        loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));

        loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
        DataTable dtTopics = dl.GetFiveTopics();
        foreach (DataRow dr in dtTopics.Rows)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<li><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
        }
        loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:49,代码来源:EditAboutUs.aspx.cs

示例4: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!User.Identity.IsAuthenticated)
        //{
        //    Session["resultColor"] = "#ff0000";
        //    Session["resultTitle"] = "Members Only";
        //    Session["resultMessage"] = "This is a members only area.<br />You must log in first.";
        //    Session["resultReturnURL"] = "NewsletterArchive.aspx";
        //    Response.Redirect("Result.aspx", true);
        //}

        int iPageNumber = 0;
        if (Request.QueryString["p"] != null)
        {
            iPageNumber = Convert.ToInt32(Request.QueryString["p"]);
        }

        DataLayer dl = new DataLayer();
        int iMaxPages = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(dl.GetNewsletterCount()) / 10m));
        pageNav1.NumPages = iMaxPages;
        pageNav2.NumPages = iMaxPages;

        loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
        DataTable dtRandomMember = dl.GetRandomMember();
        loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
        if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
        {
            loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
        }
        loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));

        DataTable dtMemberAd = dl.GetRandomAd();
        loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));

        loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
        DataTable dtTopics = dl.GetFiveTopics();
        foreach (DataRow dr in dtTopics.Rows)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<li><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
        }
        loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));

        DataTable dtNewsletters = dl.GetTenNewslettersBy_Page(iPageNumber);
        foreach (DataRow dr in dtNewsletters.Rows)
        {
            newsletters.InnerHtml += "<a class=\"navlink\" href=\"ViewNewsletter.aspx?nid=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[2].ToString() + "</a> <span style=\"font-size:17px;\">(" + Convert.ToDateTime(dr.ItemArray[1]).ToString("D") + ")</span><hr />";
        }
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:48,代码来源:NewsletterArchive.aspx.cs

示例5: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        string sColor = Session["resultColor"].ToString();
        string sTitle = Session["resultTitle"].ToString();
        string sMessage = Session["resultMessage"].ToString();
        string sReturnURL = Session["resultReturnURL"].ToString();
        this.Title = sTitle;
        resulttitle.InnerText = sTitle;
        divResult.InnerHtml = "<div style=\"color:" + sColor + "; font-size:35px; text-align:center;\">" + sMessage + "</div>";
        divResult.InnerHtml += "<div style=\"font-size:20px; text-align:center;\"><a href=\"" + sReturnURL + "\">(click to continue)</a></div>";

        DataLayer dl = new DataLayer();
        if (User.Identity.IsAuthenticated)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
            DataTable dtRandomMember = dl.GetRandomMember();
            loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
            if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
            {
                loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));
        }

        DataTable dtMemberAd = dl.GetRandomAd();
        loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));

        if (User.Identity.IsAuthenticated)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
            DataTable dtTopics = dl.GetFiveTopics();
            foreach (DataRow dr in dtTopics.Rows)
            {
                loggedinpanels.Controls.Add(new LiteralControl("<li><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));
        }
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:38,代码来源:Result.aspx.cs

示例6: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!User.Identity.IsAuthenticated)
        //{
        //    Session["resultColor"] = "#ff0000";
        //    Session["resultTitle"] = "Members Only";
        //    Session["resultMessage"] = "This is a members only area.<br />You must log in first.";
        //    Session["resultReturnURL"] = "Articles.aspx";
        //    Response.Redirect("Result.aspx", true);
        //}

        int iAID = 0;
        if (Request.QueryString["aid"] == null)
        {
            Session["resultColor"] = "#ff0000";
            Session["resultTitle"] = "No Article";
            Session["resultMessage"] = "No Article Specified";
            Session["resultReturnURL"] = "Articles.aspx";
            Response.Redirect("Result.aspx", true);
        }
        else
        {
            iAID = Convert.ToInt32(Request.QueryString["aid"]);
        }

        DataLayer dl = new DataLayer();
        if (User.Identity.IsAuthenticated)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
            DataTable dtRandomMember = dl.GetRandomMember();
            loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
            if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
            {
                loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));
        }

        DataTable dtMemberAd = dl.GetRandomAd();
        loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));

        if (User.Identity.IsAuthenticated)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
            DataTable dtTopics = dl.GetFiveTopics();
            foreach (DataRow dr in dtTopics.Rows)
            {
                loggedinpanels.Controls.Add(new LiteralControl("<li><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));
        }

        DataTable dtArticle = dl.GetArticleBy_ArticleID(iAID);
        if (dtArticle.Rows.Count == 0)
        {
            this.Title = "No Article Found";
            articletitle.InnerText = "No Article Found";
        }
        else
        {
            this.Title = dtArticle.Rows[0].ItemArray[2].ToString();
            articletitle.InnerText = dtArticle.Rows[0].ItemArray[2].ToString();
            postedby.InnerHtml = "Posted by <a href=\"Profile.aspx?member=" + dtArticle.Rows[0].ItemArray[4].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dtArticle.Rows[0].ItemArray[4].ToString()) + "</a>";
            articlebody.InnerHtml = "<!-- AddThis Button BEGIN --><script type=\"text/javascript\">var addthis_pub=\"chevex\"; var addthis_hide_embed = true;</script><a href=\"http://www.addthis.com/bookmark.php?v=20\" onmouseover=\"return addthis_open(this, '', '[URL]', '[TITLE]')\" onmouseout=\"addthis_close()\" onclick=\"return addthis_sendto()\"><img src=\"http://s7.addthis.com/static/btn/sm-share-en.gif\" width=\"83\" height=\"16\" alt=\"Bookmark and Share\" style=\"border:0;\"/></a><script type=\"text/javascript\" src=\"http://s7.addthis.com/js/200/addthis_widget.js\"></script><!-- AddThis Button END --><br /><br />" + dtArticle.Rows[0].ItemArray[3].ToString();
            DataTable dtMember = dl.GetMemberBy_Email(dtArticle.Rows[0].ItemArray[4].ToString());
            articlebody.InnerHtml += "<br /><br />------------------------------------------------------<br />" + dtMember.Rows[0].ItemArray[18].ToString();
        }
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:68,代码来源:Article.aspx.cs

示例7: Page_Load


//.........这里部分代码省略.........
                        posts.Controls.Add(lbButton);
                    }

                    posts.Controls.Add(new LiteralControl("&nbsp;&nbsp;&nbsp;<b>|</b>&nbsp;&nbsp;&nbsp;"));
                }
                if ((User.Identity.Name.ToLower() == dtTopic.Rows[0].ItemArray[2].ToString().ToLower()) || (dl.IsMemberAdmin(User.Identity.Name)) || (dl.IsMemberModerator(User.Identity.Name)))
                {
                    posts.Controls.Add(new LiteralControl("<a href=\"AddEditTopic.aspx?topic=" + iTopicID.ToString() + "\">Edit</a>&nbsp;&nbsp;&nbsp;"));

                    lbDelete = new LinkButton();
                    lbDelete.Text = "Delete";
                    lbDelete.Click += new EventHandler(lbDeleteTopic_Click);
                    posts.Controls.Add(lbDelete);
                    posts.Controls.Add(new LiteralControl("&nbsp;&nbsp;&nbsp;"));
                }
                if (!Convert.ToBoolean(dtTopic.Rows[0].ItemArray[7]))
                {
                    posts.Controls.Add(new LiteralControl("<a href=\"AddEditPost.aspx?topic=" + iTopicID.ToString() + "\">Reply</a>"));
                }
                else
                {
                    posts.Controls.Add(new LiteralControl("<span style=\"font-style:italic;color:#ff0000;\">Topic Locked</span>"));
                }
                posts.Controls.Add(new LiteralControl("</td></tr></table></td></tr></table></div>"));
            }

            bool bColored = false;
            if (iPageNumber > 0)
                bColored = true;
            bool bFirst = true;
            foreach (DataRow dr in dtPosts.Rows)
            {
                dtMember = dl.GetMemberBy_Email(dr.ItemArray[2].ToString());
                posts.Controls.Add(new LiteralControl("<div style=\""));
                if (bColored)
                {
                    posts.Controls.Add(new LiteralControl("background-color:#CCDDCC"));
                    bColored = false;
                }
                else
                {
                    posts.Controls.Add(new LiteralControl("background-color:#FFFFFF"));
                    bColored = true;
                }
                posts.Controls.Add(new LiteralControl(";padding:10px;\"><table style=\"width:100%;\"><tr><td rowspan=\"2\" style=\"vertical-align:top;text-align:center;font-size:17px;font-weight:bold;padding-right:15px;border-right:solid 2px #333333;width:150px;\"><a style=\"text-decoration:none;\" href=\"Profile.aspx?member=" + dtMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=150&image=images/MemberAvatars/" + dtMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><br /><a href=\"Profile.aspx?member=" + dtMember.Rows[0].ItemArray[0].ToString() + "\">" + dtMember.Rows[0].ItemArray[2].ToString() + "</a></td><td style=\"text-align:left;vertical-align:top;padding-left:15px;\">" + dr.ItemArray[4].ToString() + "<br /><br />----------------------------------<br />" + dtMember.Rows[0].ItemArray[18].ToString() + "</td></tr><tr><td style=\"vertical-align:bottom;padding-left:15px;padding-top:15px;\"><table cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;\"><tr><td style=\"text-align:left;vertical-align:bottom;font-size:12px;font-weight:bold;\">" + dr.ItemArray[3].ToString() + "</td><td style=\"text-align:right;vertical-align:bottom;\">"));
                if ((User.Identity.Name.ToLower() == dr.ItemArray[2].ToString().ToLower()) || (dl.IsMemberAdmin(User.Identity.Name)) || (dl.IsMemberModerator(User.Identity.Name)))
                {
                    posts.Controls.Add(new LiteralControl("<a href=\"AddEditPost.aspx?topic=" + iTopicID.ToString() + "&post=" + dr.ItemArray[0].ToString()));
                    if (!bFirst)
                    {
                        posts.Controls.Add(new LiteralControl("&rt=" + (Convert.ToInt32(dr.ItemArray[0]) - 1).ToString()));
                        bFirst = false;
                    }
                    posts.Controls.Add(new LiteralControl("\">Edit</a>&nbsp;&nbsp;&nbsp;"));
                }
                if ((dl.IsMemberAdmin(User.Identity.Name)) || (dl.IsMemberModerator(User.Identity.Name)))
                {
                    lbDelete = new LinkButton();
                    lbDelete.Text = "Delete";
                    lbDelete.ID = dr.ItemArray[0].ToString();
                    lbDelete.Click += new EventHandler(lbDelete_Click);
                    posts.Controls.Add(lbDelete);
                    posts.Controls.Add(new LiteralControl("&nbsp;&nbsp;&nbsp;"));
                }
                if (!Convert.ToBoolean(dtTopic.Rows[0].ItemArray[7]))
                {
                    posts.Controls.Add(new LiteralControl("<a href=\"AddEditPost.aspx?topic=" + iTopicID.ToString() + "&rt=" + dr.ItemArray[0].ToString() + "\">Reply</a>"));
                }
                posts.Controls.Add(new LiteralControl("</td></tr></table></td></tr></table></div>"));
            }

            loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
            DataTable dtTopics = dl.GetFiveTopics();
            foreach (DataRow dr in dtTopics.Rows)
            {
                loggedinpanels.Controls.Add(new LiteralControl("<li><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));

            loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
            DataTable dtRandomMember = dl.GetRandomMember();
            loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
            if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
            {
                loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));

            DataTable dtMemberAd = dl.GetRandomAd();
            loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));
        }
        else
        {
            Session["resultColor"] = "#ff0000";
            Session["resultTitle"] = "Members Only";
            Session["resultMessage"] = "This is a members only area.<br />You must log in first.";
            Session["resultReturnURL"] = "Topic.aspx?topic=" + Request.QueryString["topic"];
            Response.Redirect("Result.aspx", true);
        }
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:101,代码来源:Topic.aspx.cs

示例8: Page_Load


//.........这里部分代码省略.........
        }
        else
        {
            twitterfeed.Visible = false;
        }

        if (bShowEmail)
        {
            divAge.Visible = true;
        }
        else
        {
            divAge.Visible = false;
        }

        if (User.Identity.IsAuthenticated)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
            DataTable dtRandomMember = dl.GetRandomMember();
            loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
            if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
            {
                loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));
        }

        DataTable dtMemberAd = dl.GetRandomAd();
        loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));

        if (User.Identity.IsAuthenticated)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
            DataTable dtTopics = dl.GetFiveTopics();
            foreach (DataRow dr in dtTopics.Rows)
            {
                loggedinpanels.Controls.Add(new LiteralControl("<li><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));

            commentbox.Visible = true;

            int iPageNumber = 0;
            if (Request.QueryString["p"] != null)
            {
                iPageNumber = Convert.ToInt32(Request.QueryString["p"]);
            }

            int iCommentCount = dl.GetMemberCommentCount(sMember);
            numthumbsup.InnerText = dl.GetMemberThumbsUpCount(sMember).ToString();
            numcomments.InnerText = iCommentCount.ToString();
            int iMaxPages = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(iCommentCount / 15m)));
            pageNav1.NumPages = iMaxPages;
            pageNav2.NumPages = iMaxPages;
            DataTable dtComments = dl.GetFifteenMemberCommentsBy_Page(iPageNumber, sMember);
            if (dl.GaveMemberThumbsUpAlready(sMember, User.Identity.Name) || (User.Identity.Name.ToLower() == sMember.ToLower()))
            {
                cbxThumbsUp.Visible = false;
            }
            else
            {
                cbxThumbsUp.Visible = true;
            }

            bool bColored = true;
            foreach (DataRow dr in dtComments.Rows)
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:67,代码来源:Profile.aspx.cs

示例9: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        //if (Request.UserHostAddress == "98.202.119.104")
        //{
        //    plmplayer.Visible = false;
        //}

        DataLayer dl = new DataLayer();

        //loggedinpanels.Controls.Add(new LiteralControl("<div class=\"formtitle\">KRNX&nbsp;Podcast!</div><div class=\"formpanel\"><center><object class=\"playerpreview\" type=\"application/x-shockwave-flash\" data=\"player_mp3_multi.swf\" width=\"200\" height=\"100\"><param name=\"movie\" value=\"player_mp3_multi.swf\" /><param name=\"FlashVars\" value=\"mp3=/KRNX/Ep01.mp3|/KRNX/Ep02.mp3|/KRNX/Ep03.mp3&amp;title=KRNX 01 - What is Referral NetworX?|KRNX 02 - Why Relationships Are Important|KRNX 03 - Relationship Marketing&amp;bgcolor1=598959&amp;bgcolor2=73B472\" /></object><br /></center></div>"));

        if (User.Identity.IsAuthenticated)
        {
            loggedoutpanels.Visible = false;
            loggedoutcontent.Visible = false;

            DataTable dtMotivator = dl.GetLastSentDailyMotivator();
            if (dtMotivator.Rows.Count > 0)
            {
                loggedincontent.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Daily Motivator</div><div class=\"contentpanel\">"));
                string sYouTubeLink = dtMotivator.Rows[0].ItemArray[5].ToString();
                if (sYouTubeLink != "No Video.")
                {
                    sYouTubeLink = sYouTubeLink.Replace(".com/watch?v=", ".com/v/");
                    loggedincontent.Controls.Add(new LiteralControl("<center><object width=\"425\" height=\"344\"><param name=\"movie\" value=\"" + sYouTubeLink + "&amp;hl=en_US&amp;fs=1&amp;\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"" + sYouTubeLink + "&amp;hl=en_US&amp;fs=1&amp;\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"425\" height=\"344\"></embed></object></center>"));
                }
                loggedincontent.Controls.Add(new LiteralControl("<center>" + dtMotivator.Rows[0].ItemArray[4].ToString() + "</center></div>"));
            }

            DataTable dtBlog = dl.GetLatestBlog();
            if (dtBlog.Rows.Count > 0)
            {
                string sBody = "<i>No Summary</i>";
                if (dtBlog.Rows[0].ItemArray[4].ToString().Contains('~'))
                {
                    sBody = dtBlog.Rows[0].ItemArray[4].ToString();
                    sBody = sBody.Remove(sBody.IndexOf('~'));
                }
                loggedincontent.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Latest Blog</div><div class=\"contentpanel\"><table style=\"width:100%;\"><tr><td><div style=\"font-size:35px;font-family:arial;\"><a class=\"navlink\" href=\"Blog.aspx?bid=" + dtBlog.Rows[0].ItemArray[0].ToString() + "\">" + dtBlog.Rows[0].ItemArray[3].ToString() + "</a></div><div>Posted by <a href=\"Profile.aspx?member=" + dtBlog.Rows[0].ItemArray[1].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dtBlog.Rows[0].ItemArray[1].ToString()) + "</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;" + Convert.ToDateTime(dtBlog.Rows[0].ItemArray[2]).ToString("D") + "</div><br /><div>" + sBody + "<br /><br /><b><a class=\"navlink\" href=\"Blog.aspx?bid=" + dtBlog.Rows[0].ItemArray[0].ToString() + "\">(Read More)</a></b></div></td></tr></table></div>"));
            }

            loggedincontent.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Check Out Our Latest Articles!</div><div style=\"font-size:25px;text-align:center;\" class=\"contentpanel\">"));
            DataTable dtArticles = dl.GetFiveLatestArticles();
            foreach (DataRow dr in dtArticles.Rows)
            {
                loggedincontent.Controls.Add(new LiteralControl("<a class=\"navlink\" style=\"text-decoration:underline;\" href=\"Article.aspx?aid=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[2].ToString() + "</a> <span style=\"font-size:14px;\">by <a href=\"Profile.aspx?member=" + dr.ItemArray[4].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dr.ItemArray[4].ToString()) + "</a></span><hr />"));
            }
            loggedincontent.Controls.Add(new LiteralControl("</div>"));

            //logged in panels

            loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
            DataTable dtRandomMember = dl.GetRandomMember();
            loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
            if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
            {
                loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));

            DataTable dtMemberAd = dl.GetRandomAd();
            loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));

            loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
            DataTable dtTopics = dl.GetFiveTopics();
            foreach (DataRow dr in dtTopics.Rows)
            {
                loggedinpanels.Controls.Add(new LiteralControl("<li style=\"display:list-item;margin:0px;background-color:transparent;border-width:0px;\"><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));
        }
        else
        {
            DataTable dtMotivator = dl.GetLastSentDailyMotivator();
            if (dtMotivator.Rows.Count > 0)
            {
                dailymotivator.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Daily Motivator</div><div class=\"contentpanel\">"));
                string sYouTubeLink = dtMotivator.Rows[0].ItemArray[5].ToString();
                if (sYouTubeLink != "No Video.")
                {
                    sYouTubeLink = sYouTubeLink.Replace(".com/watch?v=", ".com/v/");
                    dailymotivator.Controls.Add(new LiteralControl("<center><object width=\"425\" height=\"344\"><param name=\"movie\" value=\"" + sYouTubeLink + "&amp;hl=en_US&amp;fs=1&amp;\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"" + sYouTubeLink + "&amp;hl=en_US&amp;fs=1&amp;\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"425\" height=\"344\"></embed></object></center>"));
                }
                dailymotivator.Controls.Add(new LiteralControl("<center>" + dtMotivator.Rows[0].ItemArray[4].ToString() + "</center></div>"));
            }

            DataTable dtBlog = dl.GetLatestBlog();
            if (dtBlog.Rows.Count > 0)
            {
                string sBody = "<i>No Summary</i>";
                if (dtBlog.Rows[0].ItemArray[4].ToString().Contains('~'))
                {
                    sBody = dtBlog.Rows[0].ItemArray[4].ToString();
                    sBody = sBody.Remove(sBody.IndexOf('~'));
                }
                latestblog.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Latest Blog</div><div class=\"contentpanel\"><table style=\"width:100%;\"><tr><td><div style=\"font-size:35px;font-family:arial;\"><a class=\"navlink\" href=\"Blog.aspx?bid=" + dtBlog.Rows[0].ItemArray[0].ToString() + "\">" + dtBlog.Rows[0].ItemArray[3].ToString() + "</a></div><div>Posted by <a href=\"Profile.aspx?member=" + dtBlog.Rows[0].ItemArray[1].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dtBlog.Rows[0].ItemArray[1].ToString()) + "</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;" + Convert.ToDateTime(dtBlog.Rows[0].ItemArray[2]).ToString("D") + "</div><br /><div>" + sBody + "<br /><br /><b><a class=\"navlink\" href=\"Blog.aspx?bid=" + dtBlog.Rows[0].ItemArray[0].ToString() + "\">(Read More)</a></b></div></td></tr></table></div>"));
            }
            loggedoutcontent.Visible = true;
            lbWelcome_Click(null, null);
        }
//.........这里部分代码省略.........
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:101,代码来源:Default.aspx.cs

示例10: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!User.Identity.IsAuthenticated)
        //{
        //    Session["resultColor"] = "#ff0000";
        //    Session["resultTitle"] = "Members Only";
        //    Session["resultMessage"] = "This is a members only area.<br />You must log in first.";
        //    Session["resultReturnURL"] = "Articles.aspx";
        //    Response.Redirect("Result.aspx", true);
        //}

        DataLayer dl = new DataLayer();

        int iPageNumber = 0;
        if (Request.QueryString["p"] != null)
        {
            iPageNumber = Convert.ToInt32(Request.QueryString["p"]);
        }

        DataTable dtParentCategories = dl.GetParentCategories();

        foreach (DataRow drParent in dtParentCategories.Rows)
        {
            categorypanel.InnerHtml += "<div class=\"contenttitle\">" + drParent.ItemArray[0].ToString() + "</div>";
            categorypanel.InnerHtml += "<div class=\"contentpanel\">";
            DataTable dtSubCategories = dl.GetCategoriesBy_ParentCategory(drParent.ItemArray[0].ToString());

            categorypanel.InnerHtml += "<table style=\"width:100%;font-size:17px;\"><tr>";
            int iCol = 0;
            foreach (DataRow dr in dtSubCategories.Rows)
            {
                int iNumArticles = dl.GetArticleCountBy_Category(dr.ItemArray[0].ToString());
                categorypanel.InnerHtml += "<td style=\"text-align:center;\"><a href=\"Articles.aspx?category=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[0].ToString() + "</a> (" + iNumArticles.ToString() + ")</td>";
                iCol++;
                if (iCol == 3)
                {
                    categorypanel.InnerHtml += "</tr><tr>";
                    iCol = 0;
                }
            }
            categorypanel.InnerHtml += "</tr></table>";

            categorypanel.InnerHtml += "</div>";
        }

        if (Request.QueryString["category"] == null)
        {
            categorypanel.Visible = true;
            articlepanel.Visible = false;
        }
        else
        {
            string sCategory = Request.QueryString["category"];
            categorypanel.Visible = true; //false;
            articlepanel.Visible = true;

            category.InnerText = sCategory;

            int iMaxPages = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(dl.GetArticleCountBy_Category(sCategory)) / 15m));
            pageNav1.NumPages = iMaxPages;
            pageNav2.NumPages = iMaxPages;

            DataTable dtArticles = dl.GetFifteenArticlesBy_Category(sCategory, iPageNumber);
            if (dtArticles.Rows.Count == 0)
            {
                articles.InnerHtml += "<center>There are no articles in this category.</center>";
            }
            else
            {
                foreach (DataRow dr in dtArticles.Rows)
                {
                    articles.InnerHtml += "<a class=\"navlink\" href=\"Article.aspx?aid=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[2].ToString() + "</a><br /><span style=\"font-size:14px;\">Posted by <a href=\"Profile.aspx?member=" + dr.ItemArray[4].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dr.ItemArray[4].ToString()) + "</a></span><hr />";
                }
            }
        }

        loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
        DataTable dtRandomMember = dl.GetRandomMember();
        loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
        if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
        {
            loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
        }
        loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));

        DataTable dtMemberAd = dl.GetRandomAd();
        loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));

        loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
        DataTable dtTopics = dl.GetFiveTopics();
        foreach (DataRow dr in dtTopics.Rows)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<li><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
        }
        loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:96,代码来源:Articles.aspx.cs

示例11: Page_Load


//.........这里部分代码省略.........

                if (dr.ItemArray[1].ToString().StartsWith("ANON"))
                {
                    string[] sSplit = dr.ItemArray[1].ToString().Split('|');
                    sLink = sSplit[2];
                    sAvatar = "images/MemberAvatars/no_avatar.gif";
                    sName = sSplit[1];
                }
                else
                {
                    DataTable dtMember = dl.GetMemberBy_Email(dr.ItemArray[1].ToString());

                    sEmail = dtMember.Rows[0].ItemArray[0].ToString();
                    sLink = "Profile.aspx?member=" + sEmail;
                    sAvatar = "images/MemberAvatars/" + dtMember.Rows[0].ItemArray[3].ToString();
                    sName = dtMember.Rows[0].ItemArray[2].ToString();
                    sSignature = dtMember.Rows[0].ItemArray[18].ToString();
                }

                comments.Controls.Add(new LiteralControl("<div style=\""));
                if (bColored)
                {
                    comments.Controls.Add(new LiteralControl("background-color:#CCDDCC"));
                    bColored = false;
                }
                else
                {
                    comments.Controls.Add(new LiteralControl("background-color:#FFFFFF"));
                    bColored = true;
                }
                comments.Controls.Add(new LiteralControl(";padding:10px;\"><table style=\"width:100%;\"><tr><td rowspan=\"2\" style=\"vertical-align:top;text-align:center;font-size:17px;font-weight:bold;padding-right:15px;border-right:solid 2px #333333;width:150px;\">"));
                if (sLink != "")
                {
                    comments.Controls.Add(new LiteralControl("<a style=\"text-decoration:none;\" href=\"" + sLink + "\">"));
                }
                comments.Controls.Add(new LiteralControl("<img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=150&image=" + sAvatar + "\" />"));
                if (sLink != "")
                {
                    comments.Controls.Add(new LiteralControl("</a>"));
                }
                comments.Controls.Add(new LiteralControl("<br /><br />"));
                if (sLink != "")
                {
                    comments.Controls.Add(new LiteralControl("<a href=\"" + sLink + "\">"));
                }
                comments.Controls.Add(new LiteralControl(sName));
                if (sLink != "")
                {
                    comments.Controls.Add(new LiteralControl("</a>"));
                }
                if (dr.ItemArray[1].ToString().StartsWith("ANON"))
                {
                    comments.Controls.Add(new LiteralControl("<br />(guest)"));
                }
                comments.Controls.Add(new LiteralControl("</td><td style=\"text-align:left;vertical-align:top;padding-left:15px;\">" + dr.ItemArray[3].ToString().Replace("\r", "<br />").Replace("\n", "") + "<br /><br />----------------------------------<br />" + sSignature + "</td></tr><tr><td style=\"vertical-align:bottom;padding-left:15px;padding-top:15px;\"><table cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;\"><tr><td style=\"text-align:left;vertical-align:bottom;font-size:12px;font-weight:bold;\">" + dr.ItemArray[2].ToString()));
                if (Convert.ToBoolean(dr.ItemArray[5]))
                    comments.Controls.Add(new LiteralControl("&nbsp&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<img style=\"width:25px;\" src=\"images/ThumbsUp.png\" />"));
                comments.Controls.Add(new LiteralControl("</td><td style=\"text-align:right;vertical-align:bottom;\">"));
                if (User.Identity.IsAuthenticated)
                {
                    if ((User.Identity.Name.ToLower() == dr.ItemArray[1].ToString().ToLower()) || (dl.IsMemberAdmin(User.Identity.Name)) || (dl.IsMemberModerator(User.Identity.Name)))
                    {
                        lbDelete = new LinkButton();
                        lbDelete.Text = "Delete Comment";
                        lbDelete.ID = dr.ItemArray[0].ToString();
                        lbDelete.Click += new EventHandler(lbDelete_Click);
                        lbDelete.CausesValidation = false;
                        comments.Controls.Add(lbDelete);
                    }
                }
                comments.Controls.Add(new LiteralControl("</td></tr></table></td></tr></table></div>"));
            }
        }

        if (User.Identity.IsAuthenticated)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
            DataTable dtRandomMember = dl.GetRandomMember();
            loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
            if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
            {
                loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));
        }

        DataTable dtMemberAd = dl.GetRandomAd();
        loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));

        if (User.Identity.IsAuthenticated)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
            DataTable dtTopics = dl.GetFiveTopics();
            foreach (DataRow dr in dtTopics.Rows)
            {
                loggedinpanels.Controls.Add(new LiteralControl("<li><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));
        }
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:101,代码来源:Blog.aspx.cs

示例12: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["e"] != null)
        {
            unsubscribepanel.Visible = true;
            subscribepanel.Visible = false;
        }
        else
        {
            unsubscribepanel.Visible = false;
            subscribepanel.Visible = true;
        }

        DataLayer dl = new DataLayer();

        if (User.Identity.IsAuthenticated)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
            DataTable dtRandomMember = dl.GetRandomMember();
            loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
            if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
            {
                loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));
        }

        DataTable dtMemberAd = dl.GetRandomAd();
        loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));

        if (User.Identity.IsAuthenticated)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
            DataTable dtTopics = dl.GetFiveTopics();
            foreach (DataRow dr in dtTopics.Rows)
            {
                loggedinpanels.Controls.Add(new LiteralControl("<li><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));
        }
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:41,代码来源:Subscribe.aspx.cs

示例13: Page_Load


//.........这里部分代码省略.........
            DataTable dtStickyTopics = dl.GetStickyTopics(iBoardID);

            if (dtStickyTopics.Rows.Count > 0)
            {
                stickypanel.Visible = true;
            }
            else
            {
                stickypanel.Visible = false;
            }

            bool bColored = true;
            foreach (DataRow dr in dtStickyTopics.Rows)
            {
                stickytopics.Controls.Add(new LiteralControl("<div style=\"background-color:"));
                if (bColored)
                {
                    stickytopics.Controls.Add(new LiteralControl("#CCDDCC"));
                    bColored = false;
                }
                else
                {
                    stickytopics.Controls.Add(new LiteralControl("#ffffff"));
                    bColored = true;
                }
                int iNumReplies = dl.GetReplyCountBy_TopicID(Convert.ToInt32(dr.ItemArray[0]));
                stickytopics.Controls.Add(new LiteralControl(";padding:10px;\"><a style=\"font-size:20px;\" href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a><b>&nbsp;&nbsp;&nbsp;<b>|</b>&nbsp;&nbsp;&nbsp;" + iNumReplies.ToString() + " replies</b><br /><div style=\"font-size:13px;\">Posted by <a href=\"Profile.aspx?member=" + dr.ItemArray[2].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dr.ItemArray[2].ToString()) + "</a> on " + dr.ItemArray[3].ToString()));
                if (iNumReplies > 0)
                {
                    DataTable dtLastReply = dl.GetLastTopicReplyBy_TopicID(Convert.ToInt32(dr.ItemArray[0]));
                    stickytopics.Controls.Add(new LiteralControl("&nbsp;&nbsp;&nbsp;<b>|</b>&nbsp;&nbsp;&nbsp;last reply by <a href=\"Profile.aspx?member=" + dtLastReply.Rows[0].ItemArray[0].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dtLastReply.Rows[0].ItemArray[0].ToString()) + "</a> on " + dtLastReply.Rows[0].ItemArray[1].ToString()));
                }
                stickytopics.Controls.Add(new LiteralControl("</div></div>"));
            }

            if (dtTopics.Rows.Count == 0)
            {
                if (Convert.ToBoolean(dtBoard.Rows[0].ItemArray[3]))
                {
                    topics.Controls.Add(new LiteralControl("<div style=\"padding:10px;background-color:#CCDDCC;font-size:20px;\">No Topics.</div>"));
                }
                else
                {
                    topics.Controls.Add(new LiteralControl("<div style=\"padding:10px;background-color:#CCDDCC;font-size:20px;\">No Topics. <a href=\"AddEditTopic.aspx?board=" + iBoardID.ToString() + "\">Click here</a> to create a topic of your own.</div>"));
                }
            }

            bColored = true;
            foreach (DataRow dr in dtTopics.Rows)
            {
                topics.Controls.Add(new LiteralControl("<div style=\"background-color:"));
                if (bColored)
                {
                    topics.Controls.Add(new LiteralControl("#CCDDCC"));
                    bColored = false;
                }
                else
                {
                    topics.Controls.Add(new LiteralControl("#ffffff"));
                    bColored = true;
                }
                int iNumReplies = dl.GetReplyCountBy_TopicID(Convert.ToInt32(dr.ItemArray[0]));
                topics.Controls.Add(new LiteralControl(";padding:10px;\"><a style=\"font-size:20px;\" href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a><b>&nbsp;&nbsp;&nbsp;<b>|</b>&nbsp;&nbsp;&nbsp;" + iNumReplies.ToString() + " replies</b><br /><div style=\"font-size:13px;\">Posted by <a href=\"Profile.aspx?member=" + dr.ItemArray[2].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dr.ItemArray[2].ToString()) + "</a> on " + dr.ItemArray[3].ToString()));
                if (iNumReplies > 0)
                {
                    DataTable dtLastReply = dl.GetLastTopicReplyBy_TopicID(Convert.ToInt32(dr.ItemArray[0]));
                    topics.Controls.Add(new LiteralControl("&nbsp;&nbsp;&nbsp;<b>|</b>&nbsp;&nbsp;&nbsp;last reply by <a href=\"Profile.aspx?member=" + dtLastReply.Rows[0].ItemArray[0].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dtLastReply.Rows[0].ItemArray[0].ToString()) + "</a> on " + dtLastReply.Rows[0].ItemArray[1].ToString()));
                }
                topics.Controls.Add(new LiteralControl("</div></div>"));
            }

            loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
            DataTable dtTopics2 = dl.GetFiveTopics();
            foreach (DataRow dr in dtTopics2.Rows)
            {
                loggedinpanels.Controls.Add(new LiteralControl("<li><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));

            loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
            DataTable dtRandomMember = dl.GetRandomMember();
            loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
            if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
            {
                loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
            }
            loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));

            DataTable dtMemberAd = dl.GetRandomAd();
            loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));
        }
        else
        {
            Session["resultColor"] = "#ff0000";
            Session["resultTitle"] = "Members Only";
            Session["resultMessage"] = "This is a members only area.<br />You must log in first.";
            Session["resultReturnURL"] = "Boards.aspx";
            Response.Redirect("Result.aspx", true);
        }
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:101,代码来源:Topics.aspx.cs

示例14: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        DataLayer dl = new DataLayer();

        if (Request.QueryString["topic"] != null)
        {
            int iTopicID = Convert.ToInt32(Request.QueryString["topic"]);
            Object[] oTopic = dl.GetForumTopicBy_TopicID(iTopicID).Rows[0].ItemArray;

            if (!User.Identity.IsAuthenticated)
            {
                Session["resultColor"] = "#ff0000";
                Session["resultTitle"] = "Members Only";
                Session["resultMessage"] = "This is a members only area.<br />You must log in first.";
                Session["resultReturnURL"] = "AddEditTopic.aspx?topic=" + Request.QueryString["topic"];
                Response.Redirect("Result.aspx", true);
            }
            else if ((User.Identity.IsAuthenticated) && (User.Identity.Name.ToLower() != oTopic[2].ToString().ToLower()) && (!dl.IsMemberAdmin(User.Identity.Name)))
            {
                Session["resultColor"] = "#ff0000";
                Session["resultTitle"] = "Not Authorized";
                Session["resultMessage"] = "You are not authorized to edit this post.";
                Session["resultReturnURL"] = "Topic.aspx?topic=" + Request.QueryString["topic"];
                Response.Redirect("Result.aspx", true);
            }
            else
            {
                if (!this.IsPostBack)
                {
                    addedit.InnerText = "Edit Topic";
                    tbxTitle.Text = oTopic[4].ToString();
                    rteBody.Value = oTopic[5].ToString();
                }
                cbxLocked.Visible = false;
                cbxSticky.Visible = false;
            }

        }
        else if ((Request.QueryString["board"] == null) && (Request.QueryString["topic"] == null))
        {
            Session["resultColor"] = "#ff0000";
            Session["resultTitle"] = "Error";
            Session["resultMessage"] = "No BoardID was specified for the new topic.";
            Session["resultReturnURL"] = "Topics.aspx";
            Response.Redirect("Result.aspx", true);
        }
        else
        {
            DataTable dtBoard = dl.GetForumBoardBy_BoardID(Convert.ToInt32(Request.QueryString["board"]));
            if (Convert.ToBoolean(dtBoard.Rows[0].ItemArray[3]))
            {
                Session["resultColor"] = "#ff0000";
                Session["resultTitle"] = "Locked";
                Session["resultMessage"] = "You cannot creat a new topic because this board is locked.";
                Session["resultReturnURL"] = "Topics.aspx?board=" + dtBoard.Rows[0].ItemArray[0].ToString();
                Response.Redirect("Result.aspx", true);
            }

            addedit.InnerText = "Add New Topic";
            if (!User.Identity.IsAuthenticated)
            {
                Session["resultColor"] = "#ff0000";
                Session["resultTitle"] = "Members Only";
                Session["resultMessage"] = "This is a members only area.<br />You must log in first.";
                Session["resultReturnURL"] = "AddEditTopic.aspx?board=" + Request.QueryString["board"];
                Response.Redirect("Result.aspx", true);
            }

            if (!dl.IsMemberAdmin(User.Identity.Name))
            {
                cbxSticky.Visible = false;
                cbxLocked.Visible = false;
            }
            else
            {
                cbxSticky.Visible = true;
                cbxLocked.Visible = true;
            }
        }

        loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
        DataTable dtTopics = dl.GetFiveTopics();
        foreach (DataRow dr in dtTopics.Rows)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<li><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
        }
        loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));

        loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
        DataTable dtRandomMember = dl.GetRandomMember();
        loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
        if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
        {
            loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
        }
        loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));

        DataTable dtMemberAd = dl.GetRandomAd();
        loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:100,代码来源:AddEditTopic.aspx.cs

示例15: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        DataLayer dl = new DataLayer();

        if (Request.QueryString["post"] != null)
        {
            int iPostID = Convert.ToInt32(Request.QueryString["post"]);
            Object[] oPost = dl.GetForumPostBy_PostID(iPostID).Rows[0].ItemArray;

            if (!User.Identity.IsAuthenticated)
            {
                Session["resultColor"] = "#ff0000";
                Session["resultTitle"] = "Members Only";
                Session["resultMessage"] = "This is a members only area.<br />You must log in first.";
                Session["resultReturnURL"] = "AddEditPost.aspx?post=" + Request.QueryString["post"];
                Response.Redirect("Result.aspx", true);
            }
            else if ((User.Identity.IsAuthenticated) && (User.Identity.Name.ToLower() != oPost[2].ToString().ToLower()) && (!dl.IsMemberAdmin(User.Identity.Name)))
            {
                Session["resultColor"] = "#ff0000";
                Session["resultTitle"] = "Not Authorized";
                Session["resultMessage"] = "You are not authorized to edit this post.";
                Session["resultReturnURL"] = "Boards.aspx";
                Response.Redirect("Result.aspx", true);
            }
            else
            {
                if (!this.IsPostBack)
                {
                    addedit.InnerText = "Edit Post";
                    rteBody.Value = oPost[4].ToString();
                }
            }
        }
        else
        {
            if (!User.Identity.IsAuthenticated)
            {
                Session["resultColor"] = "#ff0000";
                Session["resultTitle"] = "Members Only";
                Session["resultMessage"] = "This is a members only area.<br />You must log in first.";
                Session["resultReturnURL"] = "AddEditPost.aspx?topic=" + Request.QueryString["topic"];
                Response.Redirect("Result.aspx", true);
            }
            addedit.InnerText = "Reply To Topic";
        }

        if (Request.QueryString["rt"] != null)
        {
            int iRTPostID = Convert.ToInt32(Request.QueryString["rt"]);
            DataTable dtRTPost = dl.GetForumPostBy_PostID(iRTPostID);
            replyto.InnerHtml = dtRTPost.Rows[0].ItemArray[4].ToString();
            postedby.InnerHtml = "Posted by <a href=\"Profile.aspx?member=" + dtRTPost.Rows[0].ItemArray[2].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dtRTPost.Rows[0].ItemArray[2].ToString()) + "</a> on " + dtRTPost.Rows[0].ItemArray[3].ToString();
        }
        else
        {
            int iRTTopicID = Convert.ToInt32(Request.QueryString["topic"]);
            DataTable dtRTTopic = dl.GetForumTopicBy_TopicID(iRTTopicID);
            replyto.InnerHtml = dtRTTopic.Rows[0].ItemArray[5].ToString();
            postedby.InnerHtml = "Posted by <a href=\"Profile.aspx?member=" + dtRTTopic.Rows[0].ItemArray[2].ToString() + "\">" + dl.GetFullMemberNameBy_Email(dtRTTopic.Rows[0].ItemArray[2].ToString()) + "</a> on " + dtRTTopic.Rows[0].ItemArray[3].ToString();
        }

        loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Popular Topics</div><div style=\"font-size:15px;\" class=\"contentpanel\"><ul>"));
        DataTable dtTopics = dl.GetFiveTopics();
        foreach (DataRow dr in dtTopics.Rows)
        {
            loggedinpanels.Controls.Add(new LiteralControl("<li><a href=\"Topic.aspx?topic=" + dr.ItemArray[0].ToString() + "\">" + dr.ItemArray[4].ToString() + "</a></li>"));
        }
        loggedinpanels.Controls.Add(new LiteralControl("</ul></div>"));

        loggedinpanels.Controls.Add(new LiteralControl("<div style=\"width:250px;\" class=\"contenttitle\">Featured Member</div><div class=\"contentpanel\">"));
        DataTable dtRandomMember = dl.GetRandomMember();
        loggedinpanels.Controls.Add(new LiteralControl("<table style=\"width:100%;\"><tr><td style=\"font-size:13px;text-align:center;\"><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\"><img style=\"border-width:0px;\" src=\"MakeThumbnail.aspx?size=100&image=images/MemberAvatars/" + dtRandomMember.Rows[0].ItemArray[3].ToString() + "\" /></a><br /><a href=\"Profile.aspx?member=" + dtRandomMember.Rows[0].ItemArray[0].ToString() + "\">View Profile</a></td><td style=\"padding-left:5px;font-size:13px;width:100%;\"><b>Name:</b> " + dtRandomMember.Rows[0].ItemArray[2].ToString() + "<br /><br /><b>Location:</b> " + dtRandomMember.Rows[0].ItemArray[17].ToString() + "<br /><br /><b>Business:</b> " + dtRandomMember.Rows[0].ItemArray[8].ToString() + "<br /><br />"));
        if (dtRandomMember.Rows[0].ItemArray[6].ToString() != "")
        {
            loggedinpanels.Controls.Add(new LiteralControl("<center><a href=\"" + dtRandomMember.Rows[0].ItemArray[6].ToString() + "\">Visit Website</a></center>"));
        }
        loggedinpanels.Controls.Add(new LiteralControl("</td></tr></table></div>"));

        DataTable dtMemberAd = dl.GetRandomAd();
        loggedinpanels.Controls.Add(new LiteralControl("<div class=\"contenttitle\">Member Ad</div><div style=\"text-align:center;\" class=\"contentpanel\"><a href=\"" + dtMemberAd.Rows[0].ItemArray[2].ToString() + "\"><img style=\"width:230px; border-width:0px;\" src=\"" + dtMemberAd.Rows[0].ItemArray[1].ToString() + "\" /></a></div>"));
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:82,代码来源:AddEditPost.aspx.cs


注:本文中的DataLayer.GetFiveTopics方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。