Esempio n. 1
0
    private void BindGrdServices()
    {
        GrdServices.DataSource = null;
        GrdServices.DataBind();

        PnlSearch.BindControls(FilterDictionary, TableName);

        var Dictionary = new Dictionary <string, object>()
        {
            { "OrganizationsID", int.Parse(DListFilterOrganizations.SelectedValue) },
        };

        int PageNum;
        int RowNumber = 20;

        if (!int.TryParse(Config._GetQueryString("p"), out PageNum))
        {
            PageNum = 1;
        }

        HdnPageNumber.Value = PageNum.ToString();

        DALC.DataTableResult FilterList = DALC.GetFilterList(TableName, Dictionary, PageNum, RowNumber, "Order By ID asc, Name asc");

        if (FilterList.Count == -1)
        {
            return;
        }

        if (FilterList.Dt.Rows.Count < 1 && PageNum > 1)
        {
            Config.RedirectURL(string.Format("/tools/electronicregistry/servicesplans?p={0}", PageNum - 1));
        }

        LblCount.Text = string.Format("Axtarış üzrə nəticə: {0}", FilterList.Count);
        int Total_Count = 0;

        if (FilterList.Count % RowNumber > 0)
        {
            Total_Count = (FilterList.Count / RowNumber) + 1;
        }
        else
        {
            Total_Count = FilterList.Count / RowNumber;
        }

        HdnTotalCount.Value    = Total_Count.ToString();
        PnlPager.Visible       = FilterList.Count > RowNumber;
        GrdServices.DataSource = FilterList.Dt;
        GrdServices.DataBind();
    }
Esempio n. 2
0
 private void BindGrdServices()
 {
     GrdServices.DataSource = DALC.GetServicesByPersonsID(_ApplicationsPersonsID);
     GrdServices.DataBind();
 }