Esempio n. 1
0
    public void fillorders()
    {
        MembershipUser mem    = Membership.GetUser();
        string         userid = mem.ProviderUserKey.ToString();
        revieworder    ro     = new revieworder();
        DataTable      dt     = ro.myorders(userid);

        if (dt.Rows.Count == 0)
        {
            Label1.Visible      = true;
            Repeater1.Visible   = false;
            LinkButton1.Visible = false;
            LinkButton2.Visible = false;
        }
        else
        {
            Label1.Visible    = false;
            Repeater1.Visible = true;
            int cnt = dt.Rows.Count;
            Literal1.Text = Convert.ToString(cnt);
            PagedDataSource pageddata = new PagedDataSource();
            pageddata.DataSource       = dt.DefaultView;
            pageddata.AllowPaging      = true;
            pageddata.PageSize         = 3;
            pageddata.CurrentPageIndex = pgnum;
            Literal2.Text = Convert.ToString(pageddata.PageSize);
            Literal3.Text = Convert.ToString(pgnum + 1);
            int vcnt = cnt / pageddata.PageSize;
            Literal4.Text = Convert.ToString(vcnt + 1);
            if (pgnum < 1)
            {
                LinkButton1.Visible = false;
            }
            else if (pgnum > 0)
            {
                LinkButton1.Visible = true;
            }
            if (pgnum == vcnt)
            {
                LinkButton2.Visible = false;
            }
            else
            if (pgnum <= vcnt)
            {
                LinkButton2.Visible = true;
            }
            Repeater1.DataSource = pageddata;
            Repeater1.DataBind();
        }
    }
Esempio n. 2
0
    public void fillgrid()
    {
        revieworder or = new revieworder();

        DataTable dt = or.fillorder();

        if (dt.Rows.Count == 0)
        {
            Label1.Visible      = true;
            Repeater1.Visible   = false; LinkButton1.Visible = false;
            LinkButton2.Visible = false;
        }
        else
        {
            Label1.Visible    = false;
            Repeater1.Visible = true;
            int cnt = dt.Rows.Count;
            Literal1.Text = Convert.ToString(cnt);
            PagedDataSource pageddata = new PagedDataSource();
            pageddata.DataSource       = dt.DefaultView;
            pageddata.AllowPaging      = true;
            pageddata.PageSize         = 3;
            pageddata.CurrentPageIndex = pgnum;
            Literal2.Text = Convert.ToString(pageddata.PageSize);
            Literal3.Text = Convert.ToString(pgnum + 1);
            int vcnt = cnt / pageddata.PageSize;
            Literal4.Text = Convert.ToString(vcnt + 1);
            if (pgnum < 1)
            {
                LinkButton1.Visible = false;
            }
            else if (pgnum > 0)
            {
                LinkButton1.Visible = true;
            }
            if (pgnum == vcnt)
            {
                LinkButton2.Visible = false;
            }
            else
            if (pgnum <= vcnt)
            {
                LinkButton2.Visible = true;
            }
            Repeater1.DataSource = pageddata;
            Repeater1.DataBind();
        }
    }
Esempio n. 3
0
    public void fillorderstatusgrid()
    {
        revieworder ro = new revieworder();

        int     id = Convert.ToInt32(Request.QueryString["id"]);
        DataSet ds = ro.fillorderstatus(id);

        if (ds.Tables[0].Rows.Count == 0)
        {
            Literal1.Visible = true;

            Repeater3.Visible = false;
        }
        else
        {
            Literal1.Visible     = false;
            Repeater3.Visible    = true;
            Repeater3.DataSource = ds;
            Repeater3.DataBind();
        }
    }