Beispiel #1
0
    public void listingtblbody()
    {
        Brand objbrand = new Brand();
        string page = Request.QueryString["Page"];
        if (page == null) page = "1";
        int HOWMANYPAGES = 0;
        List<Brand> objbrandlisting = objbrand.getBrandall(true,9 ,page.ToString(), "20", out  HOWMANYPAGES);

        Table tblbrand = new Table();

        tblbrand.Width = Unit.Percentage(100);
        tblbrand.CellPadding = 0;
        tblbrand.CellSpacing = 0;
        tblbrand.BorderWidth = 0;
        TableRow tblrow = new TableRow();
        TableCell tblcell = new TableCell();
        int sum = 0;
        for (int i = 0; i < objbrandlisting.Count; i++)
        {
            tblrow.HorizontalAlign = HorizontalAlign.Center;
            tblcell = new TableCell();
            tblcell.Style.Add("background", "white");
            string Brandid = objbrandlisting[i].BrandID;
            string logo = objbrandlisting[i].Logo;
            Image imag = new Image();
            imag.Width = 190;
            imag.Height = 190;
            imag.ImageUrl = "~/images/" + objbrandlisting[i].Logo;
            imag.Attributes.Add("onclick", "javascript:window.open('Branddetail.aspx?id=" + Brandid + "');");
            tblcell.Controls.Add(imag);
            tblrow.Cells.Add(tblcell);

            sum = sum + 1;
            if (sum == 5)
            {
                tblbrand.Controls.Add(tblrow);
                tblrow = new TableRow();
                sum = 0;
            }

            else
            {
                tblbrand.Controls.Add(tblrow);
            }
        }

        phbrand.Controls.Add(tblbrand);

        string firstPageUrl = "http://localhost/f**k/Brand/Brandlisting.aspx?";

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

        bottomPager.Show(int.Parse(page), HOWMANYPAGES, firstPageUrl, pagerFormat, true);
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Brand testing = new Brand();
        string page = Request.QueryString["Page"];
        if (page == null) page = "1";
        int HOWMANYPAGES = 0;
        List<Brand> www = testing.getBrandall(true, page.ToString(), "6", out  HOWMANYPAGES);

        Table All = new Table();
        All.CellPadding = 1;
        All.CellSpacing = 1;

        //All.Style.Add("background-color", "#EDEFF4");
        All.CssClass = "topalign";
        All.Width = Unit.Percentage(100);
        TableRow allrows = new TableRow();
        TableCell allcells = new TableCell();
        allcells.CssClass = "topalign";

        Table tblmid = new Table();
        tblmid.BorderWidth = 2;
        tblmid.CssClass = "topalign";
        tblmid.Width = Unit.Pixel(100);
        TableRow tblmidrow = new TableRow();
        TableCell tblmidcell = new TableCell();
        tblmidcell.CssClass = "topalign";
        tblmidcell.BorderWidth = 2;

        Table firsttbl = new Table();
        firsttbl.CssClass = "topalign";
        firsttbl.Width = Unit.Percentage(100);
        firsttbl.CellPadding = 0;
        firsttbl.CellSpacing = 0;
        TableRow firsttblrow = new TableRow();
        TableCell firsttblcell = new TableCell();

        int i = 0;
        foreach (Brand output in www)
        {

            firsttblcell = new TableCell();
            firsttblcell.Style.Add("align" , "center");
            ImageButton img = new ImageButton();
            img.Width = 150;
            img.Height = 150;
            img.ImageUrl = "~/images/" + output.Logo;
            img.PostBackUrl = "~/Brand/Branddetail.aspx?brandid=" + output.BrandID + "";

            firsttblcell.Controls.Add(img);
            firsttblrow.Cells.Add(firsttblcell);

            firsttblcell = new TableCell();

            //min table for + and - click
           Table a1 = new Table();
            TableRow a2 = new TableRow();
            TableCell a3 = new TableCell();

            a3.Style.Add("align", "left");
            LinkButton btnadd = new LinkButton();
            btnadd.Text = "+";
            btnadd.Style.Add("text-decoration","none");
            a3.Controls.Add(btnadd);
            a2.Cells.Add(a3);
            a1.Controls.Add(a2);

            a3 = new TableCell();
            a2 = new TableRow();
            LinkButton btmin = new LinkButton();
            btmin.Text = "-";
            btmin.Style.Add("text-decoration", "none");
            a3.Controls.Add(btmin);
            a2.Cells.Add(a3);
            a1.Controls.Add(a2);

            firsttblcell.Controls.Add(a1);
            firsttblrow.Cells.Add(firsttblcell);
            firsttbl.Controls.Add(firsttblrow);

            //  firsttblrow.Cells.Add(firsttblcell);
        //    firsttbl.Rows.Add(firsttblrow);
            //min table for +  and -

            firsttblrow = new TableRow();
            firsttblcell = new TableCell();
            firsttblcell.CssClass = "topalign";
            firsttblcell.ColumnSpan = 2;
            Label lbl2 = new Label();
          // firsttblcell.Style.Add("background-color", "#b0c4de");
            lbl2.Text ="Brand Name : " + output.BrandName;
            lbl2.CssClass = "lblcomments";
            firsttblcell.Controls.Add(lbl2);
            firsttblrow.Cells.Add(firsttblcell);
            firsttbl.Rows.Add(firsttblrow);

            //   description row
           firsttblrow = new TableRow();
            firsttblcell = new TableCell();
            firsttblcell.CssClass = "topalign";
            firsttblcell.ColumnSpan = 2;
            Label lbl = new Label();
            lbl.Text = "Description :";
            lbl.CssClass = "lblcomments";
            //firsttblcell.Style.Add("background-color", "#b0c4de");
            firsttblcell.Controls.Add(lbl);
            firsttblrow.Cells.Add(firsttblcell);
            firsttbl.Controls.Add(firsttblrow);

            firsttblrow = new TableRow();
            firsttblcell = new TableCell();
            firsttblcell.ColumnSpan = 2;
            Label lbl6 = new Label();
            firsttblcell.CssClass = "topalign";
            //firsttblcell.Style.Add("background-color", "#b0c4de");
            lbl6.Text = output.BrandDescription;
            firsttblcell.Controls.Add(lbl6);
            firsttblrow.Cells.Add(firsttblcell);
            firsttbl.Rows.Add(firsttblrow);
            //Description ended

            //row for comments call other function

            firsttblrow = new TableRow();
            firsttblcell = new TableCell();
            firsttblcell.ColumnSpan = 2;
            Label lblcomment = new Label();
            lblcomment.Text = "Comments";
            firsttblcell.CssClass = "topalign";
            lblcomment.CssClass = "lblcomments";
            firsttblcell.Style.Add("background-color", "#EDEFF4");
            lblcomment.Style.Add("font-weight", "bold");
            firsttblcell.Controls.Add(lblcomment);
            firsttblrow.Cells.Add(firsttblcell);
            firsttbl.Controls.Add(firsttblrow);

            firsttblrow = new TableRow();
            firsttblcell = new TableCell();
            firsttblcell.ColumnSpan = 2;
            firsttblcell.CssClass = "topalign";
            //firsttblcell.Width = 200;  firsttblcell.Width = 200;
            insertcomment(firsttblcell);
            firsttblrow.Cells.Add(firsttblcell);
            firsttbl.Controls.Add(firsttblrow);

            tblmidcell.Controls.Add(firsttbl);
            tblmidrow.Cells.Add(tblmidcell);

            firsttblrow = new TableRow();
            firsttblcell = new TableCell();
            firsttblcell.ColumnSpan = 2;

            Addcomments(firsttblcell,int.Parse(output.BrandID));
            firsttblrow.Cells.Add(firsttblcell);
            firsttbl.Controls.Add(firsttblrow);
            //end of the comment

            if (i == 2 || i == 5)
            {
                // allcells.Controls.Add(firsttbl);
              //   allrows.Cells.Add(allcells);

                tblmid.Controls.Add(tblmidrow);

                tblmidrow = new TableRow();

                allcells.Controls.Add(tblmid);
                 allrows.Cells.Add(allcells);
                 All.Controls.Add(allrows);
            }

            i++;
            firsttbl = new Table();
            firsttblrow = new TableRow();
            firsttblcell = new TableCell();
            tblmidcell.BorderWidth = 2;

            tblmidcell.CssClass = "topalign";

            tblmidcell = new TableCell();

            if(i%2==0)
            {
               // tblmidcell.CssClass = "bdetails";
            }

            else
            {
             //   tblmidcell.CssClass = "bdetailss";
            }
        }

        All.Controls.Add(allrows);
        add.Controls.Add(All);

        string firstPageUrl = "http://localhost/f**k/Archimedes.aspx";

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

        bottomPager.Show(int.Parse(page), HOWMANYPAGES, firstPageUrl, pagerFormat, true);
    }
Beispiel #3
0
    public void listingtblbody()
    {
        Brand objbrand = new Brand();
        string page = Request.QueryString["Page"];
        if (page == null) page = "1";
        int HOWMANYPAGES = 0;
        List<Brand> objbrandlisting = objbrand.getBrandall(true, 9, page.ToString(), "20", out  HOWMANYPAGES);

        Table tblbrand = new Table();

        tblbrand.Width = Unit.Percentage(100);
        tblbrand.CellPadding = 0;
        tblbrand.CellSpacing = 0;
        tblbrand.BorderWidth = 0;
        TableRow tblrow = new TableRow();
        TableCell tblcell = new TableCell();
        int sum = 0;
        int sums = 0;
        int value = 0;
        for (int i = 0; i < objbrandlisting.Count; i++)
        {
            tblrow.HorizontalAlign = HorizontalAlign.Center;
            tblcell = new TableCell();
            tblcell.Style.Add("background", "white");
            string Brandid = objbrandlisting[i].BrandID;
            string logo = objbrandlisting[i].Logo;
            Image imag = new Image();
            imag.Width = 190;
            imag.Height = 190;
            imag.ImageUrl = "~/images/" + objbrandlisting[i].Logo;
            tblcell.Style.Add("-webkit-filter", "grayscale(1)");
            tblcell.Style.Add("filter", "gray");
            imag.Attributes.Add("onclick", "javascript:window.open('Archimedes.aspx?id=" + Brandid + "');");
            tblcell.Controls.Add(imag);
            tblrow.Cells.Add(tblcell);

            sum = sum + 1;
            sums = sums + 1;
            string id= Request.QueryString["id"];

            if (id == Brandid)
            {
                if (sums <= 5  && sums > 0)
                {
                    value = 5;
                }
                if (sums <= 10 && sums > 5)
                {
                    value = 10;
                }
                if (sums <= 15 && sums > 10)
                {
                    value = 15;
                }
                if (sums <= 20 && sums > 15)
                {
                    value = 20;
                }

            }

            if (sums == value)
            {
                if (id != null)
                {

                    tblbrand.Controls.Add(tblrow);
                    tblrow = new TableRow();
                    tblcell = new TableCell();
                    tblcell.ColumnSpan = 5;
                    tblcell.Controls.Add(main);
                    tblrow.Cells.Add(tblcell);
                }
                else
                {
                  //  main.Style.Add("display", "none");
                }
            }

            if (id == null)
            {
                main.Style.Add("display", "none");
            }

            if (sum == 5)
            {
                tblbrand.Controls.Add(tblrow);
                tblrow = new TableRow();
                sum = 0;
            }

            else
            {
                tblbrand.Controls.Add(tblrow);
            }
        }

        phbrand.Controls.Add(tblbrand);

        string firstPageUrl = "http://localhost/f**k/Brand/Brandlisting.aspx?";

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

        bottomPager.Show(int.Parse(page), HOWMANYPAGES, firstPageUrl, pagerFormat, true);
    }
Beispiel #4
0
    public void listingtblbody(Table tblbrand, TableRow tblrow, TableCell tblcell)
    {
        Brand objbrand = new Brand();
        string page = Request.QueryString["Page"];
        if (page == null) page = "1";
        int HOWMANYPAGES = 0;
        List<Brand> objbrandlisting = objbrand.getBrandall(true, page.ToString(), "5", out  HOWMANYPAGES);

        for (int i = 0; i < objbrandlisting.Count; i++)
        {
            tblrow = new TableRow();
            tblcell.CssClass = "bodycells";
            tblrow.HorizontalAlign = HorizontalAlign.Center;

            tblrow.Style.Add("background-color", "#EDE9D3");
            tblcell = new TableCell();
            //  tblcell.Width = 600;
            string Brandid = objbrandlisting[i].BrandID;
            string logo = objbrandlisting[i].Logo;
            Image imag = new Image();
            imag.Width = 40;
            imag.Height = 40;
            imag.ImageUrl = "~/images/" + objbrandlisting[i].Logo;
            //  imag.PostBackUrl="Branddetail.aspx?brandid=" + a + "";
            tblcell.Controls.Add(imag);
            tblrow.Cells.Add(tblcell);

            tblcell = new TableCell();
            HyperLink lnk = new HyperLink();
            lnk.CssClass = "lblNav";
            lnk.NavigateUrl = "Branddetail.aspx?brandid=" + Brandid + "";
            lnk.Text = "<PRE> " + objbrandlisting[i].BrandName;
            lnk.Style.Add("text-decoration", "none");
            tblcell.Controls.Add(lnk);
            tblrow.Cells.Add(tblcell);

            tblcell = new TableCell();
            HyperLink website = new HyperLink();
            website.Text = objbrandlisting[i].Website;
            lnk.NavigateUrl = "Branddetail.aspx?brandid=" + Brandid + "";
            tblcell.Controls.Add(website);
            tblrow.Cells.Add(tblcell);

            tblcell = new TableCell();
            Button btnedit = new Button();
            btnedit.PostBackUrl = "http://localhost/F**k/Brand/EditBrand.aspx?id=" + Brandid + "";
            btnedit.Text = "Edit";
            tblcell.Controls.Add(btnedit);
            tblrow.Cells.Add(tblcell);

            tblcell = new TableCell();
            Button btnapprove = new Button();
            string str = "";
            if (int.Parse(page) > 1)
            {
                int number = int.Parse(page);
                str = "Brandlisting.aspx?page=" + number + "&dl=1&id=" + objbrandlisting[i].BrandID + "";
            }
            else
            {
                str = "Brandlisting.aspx?dl=1&id=" + objbrandlisting[i].BrandID + "";
            }
            btnapprove.PostBackUrl = str;
            btnapprove.Text = "Approve";
            tblcell.Controls.Add(btnapprove);
            tblrow.Cells.Add(tblcell);

            tblcell = new TableCell();
            Button reject = new Button();
            if (int.Parse(page) > 1)
            {
                int number = int.Parse(page);
                str = "Brandlisting.aspx?page=" + number + "&dl=2&id=" + objbrandlisting[i].BrandID + "";
            }
            else
            {
                str = "Brandlisting.aspx?dl=2&id=" + objbrandlisting[i].BrandID + "";
            }
            reject.PostBackUrl = str;
            reject.Text = "Reject";
            tblcell.Controls.Add(reject);
            tblrow.Cells.Add(tblcell);

            tblbrand.Controls.Add(tblrow);
        }

        phbrand.Controls.Add(tblbrand);

        string firstPageUrl = "http://localhost/f**k/Brand/Brandlisting.aspx?";

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

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