Exemplo n.º 1
0
    private void GetInquiryData()
    {
        string  jk = "select * from inquiry ORDER BY InquiryDate DESC";
        DataSet ds = new DataSet();

        ds = dc.getdata(jk);

        DataTable dt = ds.Tables[0];

        PagedDataSource pgitems = new PagedDataSource();

        pgitems.DataSource  = dt.DefaultView;
        pgitems.AllowPaging = true;

        //Control page size from here
        pgitems.PageSize         = 8;
        pgitems.CurrentPageIndex = PageNumber;
        if (pgitems.PageCount > 1)
        {
            rptPaging.Visible = true;
            ArrayList pages = new ArrayList();
            for (int i = 0; i <= pgitems.PageCount - 1; i++)
            {
                pages.Add((i + 1).ToString());
            }
            rptPaging.DataSource = pages;
            rptPaging.DataBind();
        }
        else
        {
            rptPaging.Visible = false;
        }

        //Finally, set the datasource of the repeater
        InquiryRptr.DataSource = pgitems;
        InquiryRptr.DataBind();

        //GalleryRptr.DataSource = ds;
        //GalleryRptr.DataBind();
    }
    private void GetInquiryData()
    {
        string  jk = "select  admissionform.id,admissionform.RegistarionDate,admissionform.FName,admissionform.MName,admissionform.LName,admissionform.Gender,admissionform.State,admissionform.StudenMobile,admissionform.EmailId,admissionform.IsAnswered,admissioncategory.Category from admissionform join admissioncategory on admissionform.AdmissionInId = admissioncategory.id";
        DataSet ds = new DataSet();

        ds = dc.getdata(jk);

        DataTable dt = ds.Tables[0];

        PagedDataSource pgitems = new PagedDataSource();

        pgitems.DataSource  = dt.DefaultView;
        pgitems.AllowPaging = true;

        //Control page size from here
        pgitems.PageSize         = 8;
        pgitems.CurrentPageIndex = PageNumber;
        if (pgitems.PageCount > 1)
        {
            rptPaging.Visible = true;
            ArrayList pages = new ArrayList();
            for (int i = 0; i <= pgitems.PageCount - 1; i++)
            {
                pages.Add((i + 1).ToString());
            }
            rptPaging.DataSource = pages;
            rptPaging.DataBind();
        }
        else
        {
            rptPaging.Visible = false;
        }

        //Finally, set the datasource of the repeater
        InquiryRptr.DataSource = pgitems;
        InquiryRptr.DataBind();

        //GalleryRptr.DataSource = ds;
        //GalleryRptr.DataBind();
    }
Exemplo n.º 3
0
    protected void SearchBtn_Click(object sender, EventArgs e)
    {
        if (DateTb.Text != "")
        {
            DateTime sDt = Convert.ToDateTime(DateTb.Text);

            string  zk  = "select * from inquiry where InquiryDate='" + sDt.ToShortDateString() + "'";
            DataSet ds2 = new DataSet();
            ds2 = dc.getdata(zk);
            DataTable dt = ds2.Tables[0];

            PagedDataSource pgitems = new PagedDataSource();
            pgitems.DataSource  = dt.DefaultView;
            pgitems.AllowPaging = true;

            //Control page size from here
            pgitems.PageSize         = 8;
            pgitems.CurrentPageIndex = PageNumber;
            if (pgitems.PageCount > 1)
            {
                rptPaging.Visible = true;
                ArrayList pages = new ArrayList();
                for (int i = 0; i <= pgitems.PageCount - 1; i++)
                {
                    pages.Add((i + 1).ToString());
                }
                rptPaging.DataSource = pages;
                rptPaging.DataBind();
            }
            else
            {
                rptPaging.Visible = false;
            }

            //Finally, set the datasource of the repeater
            InquiryRptr.DataSource = pgitems;
            InquiryRptr.DataBind();
        }
    }
    protected void SearchBtn_Click(object sender, EventArgs e)
    {
        if (AdmissionDD.SelectedIndex != 0)
        {
            //DateTime sDt = Convert.ToDateTime(DateTb.Text);

            string  zk  = "select  admissionform.id,admissionform.FName,admissionform.MName,admissionform.LName,admissionform.RegistarionDate,admissionform.Gender,admissionform.State,admissionform.StudenMobile,admissionform.EmailId,admissionform.IsAnswered,admissioncategory.Category from admissionform join admissioncategory on admissionform.AdmissionInId = admissioncategory.id where admissionform.AdmissionInId='" + AdmissionDD.SelectedValue + "'";
            DataSet ds2 = new DataSet();
            ds2 = dc.getdata(zk);
            DataTable dt = ds2.Tables[0];

            PagedDataSource pgitems = new PagedDataSource();
            pgitems.DataSource  = dt.DefaultView;
            pgitems.AllowPaging = true;

            //Control page size from here
            pgitems.PageSize         = 8;
            pgitems.CurrentPageIndex = PageNumber;
            if (pgitems.PageCount > 1)
            {
                rptPaging.Visible = true;
                ArrayList pages = new ArrayList();
                for (int i = 0; i <= pgitems.PageCount - 1; i++)
                {
                    pages.Add((i + 1).ToString());
                }
                rptPaging.DataSource = pages;
                rptPaging.DataBind();
            }
            else
            {
                rptPaging.Visible = false;
            }

            //Finally, set the datasource of the repeater
            InquiryRptr.DataSource = pgitems;
            InquiryRptr.DataBind();
        }
    }