Beispiel #1
0
    public void listingtblbody()
    {
        NGOs objNGO = new NGOs();
        string page = Request.QueryString["Page"];
        if (page == null) page = "1";
        int HOWMANYPAGES = 0;
        List<NGOs> objNGOlisting = objNGO.getNGOAll(true, page.ToString(), "20", out  HOWMANYPAGES);

        Table tblbrand = new Table();
        tblbrand.Width = Unit.Percentage(100);
        tblbrand.CellPadding = 0;
        tblbrand.CellSpacing = 0;
        TableRow tblrow = new TableRow();
        TableCell tblcell = new TableCell();

        int sum = 0;

        for (int i = 0; i < objNGOlisting.Count; i++)
        {

            tblcell.CssClass = "bodycells";
            tblrow.HorizontalAlign = HorizontalAlign.Center;
            tblrow.Style.Add("background-color", "white");
            tblcell = new TableCell();

            string ngoid = objNGOlisting[i].NGOID;
            string logo = objNGOlisting[i].Logo;

            Image imag = new Image();
            imag.Width = 180;
            imag.Height = 180;
            imag.ImageUrl = "~/NGOs/images/" + objNGOlisting[i].Logo;
            imag.Attributes.Add("onclick", "javascript:window.open('ngosdetail.aspx?id=" + ngoid + "');");
            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/NGOs/NGOlisting.aspx";

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

        bottomPager.Show(int.Parse(page), HOWMANYPAGES, firstPageUrl, pagerFormat, true);
    }
Beispiel #2
0
    public void listingtblbody(Table tblbrand, TableRow tblrow, TableCell tblcell)
    {
        NGOs objbrand = new NGOs();
        string page = Request.QueryString["Page"];
        if (page == null) page = "1";
        int HOWMANYPAGES = 0;
        List<NGOs> objbrandlisting = objbrand.getNGOAll(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("font-size", "14px");
            tblrow.Style.Add("background-color", "white");
            tblcell = new TableCell();
            string NGOID = objbrandlisting[i].NGOID;
            string logo = objbrandlisting[i].Logo;
            ImageButton imag = new ImageButton();
            imag.Width = 40;
            imag.Height = 40;
            imag.ImageUrl = "~/images/" + objbrandlisting[i].Logo;
            imag.PostBackUrl = "EditNGO.aspx?NGOID=" + NGOID + "";
            tblcell.Controls.Add(imag);
            tblrow.Cells.Add(tblcell);

            tblcell = new TableCell();
            LinkButton lnk = new LinkButton();
            lnk.Style.Add("color", "#2C4B5A");
            lnk.PostBackUrl = "EditNGO.aspx?NGOID=" + NGOID + "";
            lnk.Text = "<PRE> " + objbrandlisting[i].NGOName;
            lnk.Style.Add("text-decoration", "none");
            tblcell.Controls.Add(lnk);
            tblrow.Cells.Add(tblcell);

            string link = "http://";
            tblcell = new TableCell();
            LinkButton website = new LinkButton();
            website.Text = objbrandlisting[i].Website;
             link=link+website.Text;
             website.Attributes.Add("onclick", "javascript:window.open(" + link + ");");
             website.Style.Add("color", "green");
             website.PostBackUrl = "" + link + "";
            tblcell.Controls.Add(website);
            tblrow.Cells.Add(tblcell);

            tblcell = new TableCell();
            ImageButton btnedit = new ImageButton();
            btnedit.PostBackUrl = "EditNGO.aspx?NGOID=" + NGOID + "";
            btnedit.ImageUrl = "logos/edit.png";
            tblcell.Controls.Add(btnedit);
            tblrow.Cells.Add(tblcell);

            tblcell = new TableCell();
            ImageButton btnapprove = new ImageButton();
            string str = "";
            if (int.Parse(page) > 1)
            {
                int number = int.Parse(page);
                str = "ngolist.aspx?page=" + number + "&dl=1&id=" + objbrandlisting[i].NGOID + "";
            }
            else
            {
                str = "ngolist.aspx?dl=1&id=" + objbrandlisting[i].NGOID + "";
            }
            btnapprove.PostBackUrl = str;
            btnapprove.ImageUrl = "logos/approve.png";
            tblcell.Controls.Add(btnapprove);
            tblrow.Cells.Add(tblcell);

            tblcell = new TableCell();
            ImageButton reject = new ImageButton();
            if (int.Parse(page) > 1)
            {
                int number = int.Parse(page);
                str = "ngolist.aspx?page=" + number + "&dl=2&id=" + objbrandlisting[i].NGOID + "";
            }
            else
            {
                str = "ngolist.aspx?dl=2&id=" + objbrandlisting[i].NGOID + "";
            }
            reject.PostBackUrl = str;
            reject.ImageUrl = "logos/reject.png";
            tblcell.Controls.Add(reject);
            tblrow.Cells.Add(tblcell);

            tblbrand.Controls.Add(tblrow);
        }

        phbrand.Controls.Add(tblbrand);

        string firstPageUrl = "http://localhost/f**k/Admintools/NGOs/ngolist.aspx?";

        string pagerFormat = "http://localhost/f**k/Admintools/NGOs/ngolist.aspx?Page={0}";

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