Exemplo n.º 1
0
    protected void GetNumberOfViewed()
    {
        string userid         = Session["userid"].ToString();
        int    numberOfVisits = Usr.GetNumberOfSentMessages(userid);
        int    pagesNumberMax = (int)Math.Ceiling((decimal)numberOfVisits / mssgPerPage);
        int    page           = int.Parse(CurrPage.Value);

        Usr.BuildPagination(links, pagesNumberMax, page, FillSkrzynka);
    }
Exemplo n.º 2
0
    /// <summary>
    /// gets selected values (age,gender etc.) send it to stored procedure
    /// gets result of SP (how many profiles met selected conditions) which is used to build pagination links
    /// </summary>
    /// <param name="PageNumber"></param>
    protected void BuildPaginationLinks(string PageNumber)
    {
        string     userid         = Session["userid"].ToString();
        int        gender         = int.Parse(DropDownList1.SelectedValue);
        int        dateDown       = int.Parse(DropDownList2.SelectedValue);
        int        dateUp         = int.Parse(DropDownList3.SelectedValue);
        List <int> wojewodztwa_id = new List <int>();

        foreach (ListItem li in cblWojewodztwa.Items)
        {
            if (li.Selected && (int.Parse(li.Value) == 17))
            {
                for (int zz = 1; zz < 17; zz++)
                {
                    wojewodztwa_id.Add(zz);
                }
                break;
            }
            else
            {
                if (li.Selected)
                {
                    wojewodztwa_id.Add(int.Parse(li.Value));
                }
            }
        }
        CheckBoxList checkedListBox1 = (CheckBoxList)pnlCustomers.FindControl("cblCustomerList");
        List <int>   sporty_id       = new List <int>();

        foreach (ListItem li in checkedListBox1.Items)
        {
            if (li.Selected)
            {
                sporty_id.Add(int.Parse(li.Value));
            }
        }
        int wygladId = 0;

        if (DDLWyglad.SelectedValue != "")
        {
            wygladId = int.Parse(DDLWyglad.SelectedValue);
        }

        int numberOfFound = Usr.GetNumberOfSzukane(userid, dateDown, dateUp, gender, wojewodztwa_id, sporty_id, wygladId);

        int pagesNumberMax = (int)Math.Ceiling((decimal)numberOfFound / mssgPerPage);
        int page           = int.Parse(PageNumber);

        Usr.BuildPagination(links, pagesNumberMax, page, FillSzukane);
    }