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


C# Comments.TopThreeComments方法代码示例

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


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

示例1: info

    public void info()
    {
        string t = Request.QueryString["id"];
           Brand brand = new Brand();
           int brandid = int.Parse(t);
           brand = brand.getBrandDetails(brandid.ToString());

           brandlogo.Src = "Images/" + brand.Logo;
           brandlogo.Width = 100;
           brandlogo.Height = 80;
           description.InnerText = brand.BrandDescription;
           name.Text = brand.BrandName;
           website.HRef = "http://" + brand.Website;
           website.InnerText = brand.Website;

           Comments comments = new Comments();
           List<Comments> topcomments = comments.TopThreeComments(5);

           Table tblComments = new Table();

           tblComments.Width = Unit.Percentage(100);
           tblComments.Height = Unit.Percentage(100);
           TableRow tblrowcom = new TableRow();
           TableCell tblcellcom = new TableCell();

           for (int j = 0; j < topcomments.Count; j++)
           {
               tblcellcom.Text = topcomments[j].Comment;
               tblrowcom.Cells.Add(tblcellcom);
               tblComments.Controls.Add(tblrowcom);
               tblcellcom = new TableCell();
               tblrowcom = new TableRow();

               tblcellcom.Text = topcomments[j].Date.ToString();
               tblrowcom.Cells.Add(tblcellcom);
               tblComments.Controls.Add(tblrowcom);
               tblcellcom = new TableCell();
               tblrowcom = new TableRow();

           }
           phbrand.Controls.Add(tblComments);
    }
开发者ID:ziad007,项目名称:URI3,代码行数:42,代码来源:Branddetail.aspx.cs

示例2: Addcomments

    public void Addcomments(TableCell allcells,int num)
    {
        Table tblComments = new Table();
         tblComments.Style.Add("background-color", "#EDEFF4");
        tblComments.Width = Unit.Percentage(100);
        tblComments.Height = Unit.Percentage(100);
        TableRow tblrowcom = new TableRow();
        TableCell tblcellcom = new TableCell();

        Comments comments = new Comments();
        List<Comments> topcomments = comments.TopThreeComments(num);

        for (int j = 0; j < topcomments.Count; j++)
        {
            Security.UserInfo usr = new Security.UserInfo();
            usr = usr.getUserProfile(topcomments[j].UserID.ToString());

            Image imag = new Image();
            imag.Width = 40;
            imag.Height = 40;
            tblcellcom.Width = 40;
            imag.ImageUrl = "~/images/" + usr.PhotoUrl;
            tblcellcom.Controls.Add(imag);
            tblrowcom.Cells.Add(tblcellcom);

            //    Allrow.Style.Add("background-color", "#EDE9D3");
            tblcellcom = new TableCell();
            tblcellcom.Style.Add("align", "left");

            Table tbl = new Table();
            tbl.Width = Unit.Percentage(100);
            TableRow tblrow = new TableRow();
            TableCell tblcell = new TableCell();

            tblcell.Text =  usr.Fname + " " + usr.Lname + "  commented on ";
            tblcell.Style.Add("color", "blue");
            tblrow.Cells.Add(tblcell);
            tbl.Controls.Add(tblrow);

            tblrow = new TableRow();
            tblcell = new TableCell();

            tblcell.Text = topcomments[j].Comment;
           // tblcell.Style.Add("color", "blue");
            tblrow.Cells.Add(tblcell);
            tbl.Controls.Add(tblrow);

            tblrow = new TableRow();
            tblcell = new TableCell();
            Button lbdelete = new Button();
            tblcell.Controls.Add(lbdelete);
            lbdelete.Text = " Delete  " + topcomments[j].Date;

            string v= HttpContext.Current.Request.Url.AbsoluteUri+"&dl="+ topcomments[j].BrandCommentID+"";
            lbdelete.Attributes["onclick"]="javascript:window.location.replace('"+v+"');";
            lbdelete.Style.Add("text-decoration", "none");
            tblcell.Style.Add("color", "blue");
            tblrow.Cells.Add(tblcell);
            tbl.Controls.Add(tblrow);

            tblrow = new TableRow();
            tblcell = new TableCell();
            tblcell.Controls.Add(new LiteralControl("<hr>"));
            tblrow.Cells.Add(tblcell);
            tbl.Controls.Add(tblrow);

            tblcellcom.Controls.Add(tbl);
            tblrowcom.Cells.Add(tblcellcom);
            tblComments.Controls.Add(tblrowcom);

            tblrowcom = new TableRow();
            tblcellcom = new TableCell();

        }

        allcells.Controls.Add(tblComments);
    }
开发者ID:ziad007,项目名称:URI2,代码行数:77,代码来源:Archimedes.aspx.cs


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