예제 #1
0
    private void BindNeeders()
    {
        GrdAdoptionPersonsList.DataSource = null;
        GrdAdoptionPersonsList.DataBind();

        PnlFilter.BindControls(FilterDictionary, _TableName);
        DListStatusType_SelectedIndexChanged(null, null);
        FilterDictionary = new Dictionary <string, object>()
        {
            { "Ap.ID", TxtID.Text },
            { "CONCAT(Soyad,' ',Ad,' ',Ata)(LIKE)", TxtFullname.Text },
            { "IsWebPreview", DListIsWebPreview.SelectedValue },
            { "IsBrotherSister", DListIsBrotherSister.SelectedValue },
            { "AdoptionPersonsStatusID", int.Parse(AdoptionPersonsStatusID) }
        };

        if (DListStatusType.SelectedIndex == 0)
        {
            FilterDictionary.Add("AdoptionPersonsStatusID(NOTIN)", 90);
        }

        int PageNum;
        int RowNumber = 16;

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

        HdnPageNumber.Value = PageNum.ToString();

        DALC.DataTableResult AdoptionPersonsResult = DALC_Adoption.GetAdoptionPersons(FilterDictionary, PageNum, RowNumber);

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

        if (AdoptionPersonsResult.Dt.Rows.Count < 1 && PageNum > 1)
        {
            Config.Redirect(string.Format("/adoptionadminn/tools/?p=adoptionpersons&pn={0}", PageNum - 1));
        }

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

        int Total_Count = AdoptionPersonsResult.Count % RowNumber > 0 ? (AdoptionPersonsResult.Count / RowNumber) + 1 : AdoptionPersonsResult.Count / RowNumber;

        HdnTotalCount.Value = Total_Count.ToString();

        PnlPager.Visible = AdoptionPersonsResult.Count > RowNumber;

        GrdAdoptionPersonsList.DataSource = AdoptionPersonsResult.Dt;
        GrdAdoptionPersonsList.DataBind();
    }
예제 #2
0
    private void BindNews()
    {
        RptNews.DataSource = null;
        RptNews.DataBind();

        PnlFilter.ControlsBind(FilterDictionary, TableName);

        int NewsID;

        int.TryParse(TxtNewsID.Text, out NewsID);
        if (NewsID == 0)
        {
            NewsID = -1;
        }

        FilterDictionary = new Dictionary <string, object>()
        {
            { "Id", NewsID },
            { "LangsId", Langs.Id },
            { "OrganizationsId", DALCL._Login.organizationsId },
            { "OrganizationsLangsId", Langs.Id },
            { "NewsLangsStatusId", int.Parse(DListNewsStatus.SelectedValue) }
        };

        int PageNum;
        int RowNumber = 50;

        if (!int.TryParse(ConfigL._Route("pagenum", "1"), out PageNum))
        {
            PageNum = 1;
        }

        HdnPageNumber.Value = PageNum.ToString();

        DALC.DataTableResult NewsResult = DALC.GetFilterList(Tools.Tables.V_News, FilterDictionary, PageNum, RowNumber);

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

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

        int Total_Count = NewsResult.Count % RowNumber > 0 ? (NewsResult.Count / RowNumber) + 1 : NewsResult.Count / RowNumber;

        HdnTotalCount.Value = Total_Count.ToString();

        PnlPager.Visible = NewsResult.Count > RowNumber;

        RptNews.DataSource = NewsResult.Dt;
        RptNews.DataBind();
    }
예제 #3
0
 protected void BtnFilter_Click(object sender, EventArgs e)
 {
     PnlFilter.BindControls(FilterDictionary, _TableName, true);
     Cache.Remove(_TableName._ToString());
     Config.Redirect("/adoptionadminn/tools/?p=adoptionpersons&pn=1");
 }
예제 #4
0
 protected void BtnFilter_Click(object sender, EventArgs e)
 {
     PnlFilter.ControlsBind(FilterDictionary, TableName, "", true);
     ConfigL.RedirectURL(string.Format("/{0}/modules/news/1", Langs.Name));
 }
예제 #5
0
 protected void BtnClear_Click(object sender, EventArgs e)
 {
     PnlFilter.ControlsClear();
     BtnFilter_Click(null, null);
 }