Пример #1
0
    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);
    }
Пример #2
0
    public void load()
    {
        string del = Request.QueryString["id"];
        Brand b = new Brand();
        b = b.getBrandDetails(del.ToString());

        txtbrandname.Text = b.BrandName.ToString();
        this.txtwebsite.Text = b.Website;
        this.facebook.Text = b.FacebookPage;
        this.Twitter.Text = b.TwitterPage;
        this.Youtube.Text = b.YoutubeChannel;
        this.GooglePlus.Text = b.GooglePlus;
        this.Blog.Text = b.Blog;
        this.Flickr.Text = b.Flicker;
        this.FoursquareAccount.Text = b.FourSquareAccount;
          //  this.ddlcategory.SelectedValue = b.BrandCategoryID;
        txtdiscption.InnerText = b.BrandDescription;
        b.AllowsCommentsOnWebsite = "0";
        b.USERID = del;
        this.LinkedIn.Text = b.LINKIND;
    }
Пример #3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string del = Request.QueryString["id"];
        Brand b = new Brand();
        b = b.getBrandDetails(del.ToString());

        b.BrandName = txtbrandname.Text;
        b.Website = txtwebsite.Text;
        b.FacebookPage = facebook.Text;
        b.TwitterPage = Twitter.Text;
        b.YoutubeChannel = Youtube.Text;
        b.GooglePlus = GooglePlus.Text;
        b.Blog = Blog.Text;
        b.Flicker = Flickr.Text;
        b.FourSquareAccount = FoursquareAccount.Text;
        b.BrandCategoryID = ddlcategory.SelectedValue;
        b.BrandDescription = txtdiscption.InnerText;
        b.AllowsCommentsOnWebsite = "0";
        b.USERID = "19";
        b.LINKIND = LinkedIn.Text;
        string c = b.UpdateBrand(b);
    }
Пример #4
0
    public void info()
    {
        string t = Request.QueryString["brandid"];
        Brand brand = new Brand();
        int brandid = int.Parse(t);
        brand = brand.getBrandDetails(brandid.ToString());

        desc.Text = brand.BrandDescription;
        name.Text = brand.BrandName;
        A1.HRef = "http://" + brand.Website;
        A1.InnerText = brand.Website;
        Table All = new Table();
        All.CssClass = "bdetails";
        All.Width = Unit.Percentage(100);
        All.CellPadding = 1;
        All.CellSpacing = 1;

        TableRow Allrow = new TableRow();
        TableCell Allcell = new TableCell();

        Comments testing = new Comments();
        string page = Request.QueryString["Page"];
        if (page == null) page = "1";
        int HOWMANYPAGES = 0;
        List<Comments> www = testing.getCommentall(brandid, page.ToString(), "3", out  HOWMANYPAGES);

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

            Allrow = new TableRow();
            Allcell = new TableCell();
            Image imag = new Image();
            imag.Width = 40;
            imag.Height = 40;
            Allcell.Width = 40;
            imag.ImageUrl = "~/images/" + usr.PhotoUrl;
            Allcell.Controls.Add(imag);
            Allrow.Cells.Add(Allcell);

            //    Allrow.Style.Add("background-color", "#EDE9D3");
            Allcell = new TableCell();
            Allcell.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;
            tblcell.Style.Add("color", "blue");
            tblrow.Cells.Add(tblcell);
            tbl.Controls.Add(tblrow);

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

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

            tblrow = new TableRow();
            tblcell = new TableCell();
            LinkButton lbdelete = new LinkButton();
            tblcell.Controls.Add(lbdelete);
            lbdelete.Text = " Delete";
            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);

            Allcell.Controls.Add(tbl);
            Allrow.Cells.Add(Allcell);
            All.Controls.Add(Allrow);
        }

        php.Controls.Add(All);
        string firstPageUrl = "http://localhost/f**k/Brand/Branddetail.aspx";

        //SHARIF Page={0} shoule be like this
        string pagerFormat = "http://localhost/f**k/Brand/Branddetail.aspx?Page={0}";

        bottomPager.Show(int.Parse(page), HOWMANYPAGES, firstPageUrl, pagerFormat, true);
    }