Exemplo n.º 1
0
    private void UpdateActivePage()
    {
        int num = 0;

        for (int i = 0; i < this.m_PlantsElements.Count; i++)
        {
            PageNum     component  = this.m_PlantsElements[i].GetComponent <PageNum>();
            NotepadData component2 = this.m_PlantsElements[i].gameObject.GetComponent <NotepadData>();
            if (component.m_PageNum == this.m_CurrentPage && (component2 == null || component2.ShouldShow()))
            {
                this.m_PlantsElements[i].SetActive(true);
                if (component2 != null)
                {
                    component2.m_WasActive = true;
                }
                this.UpdateSubElements(this.m_PlantsElements[i].transform);
                num++;
            }
            else
            {
                this.m_PlantsElements[i].SetActive(false);
            }
        }
        this.m_NumActiveElementsOnPage = num;
    }
Exemplo n.º 2
0
    private void Awake()
    {
        for (int i = 0; i < base.gameObject.transform.childCount; i++)
        {
            GameObject gameObject = base.gameObject.transform.GetChild(i).gameObject;
            this.m_ItemsElelements.Add(gameObject);
            NotepadData component = gameObject.GetComponent <NotepadData>();
            if (component)
            {
                component.Init();
            }
        }
        int num = 0;

        for (int j = 0; j < this.m_ItemsElelements.Count; j++)
        {
            List <Text> componentsDeepChild = General.GetComponentsDeepChild <Text>(this.m_ItemsElelements[j]);
            for (int k = 0; k < componentsDeepChild.Count; k++)
            {
                componentsDeepChild[k].text = GreenHellGame.Instance.GetLocalization().Get(componentsDeepChild[k].name);
            }
            PageNum component2 = this.m_ItemsElelements[j].GetComponent <PageNum>();
            if (component2.m_PageNum + 1 > num)
            {
                num = component2.m_PageNum + 1;
            }
        }
        this.m_NumActivePages = num * 2;
    }
Exemplo n.º 3
0
    public override void Init()
    {
        base.Init();
        for (int i = 0; i < base.gameObject.transform.childCount; i++)
        {
            GameObject gameObject = base.gameObject.transform.GetChild(i).gameObject;
            this.m_PlantsElements.Add(gameObject);
        }
        int num = 0;

        for (int j = 0; j < this.m_PlantsElements.Count; j++)
        {
            Text[] componentsDeepChild = General.GetComponentsDeepChild <Text>(this.m_PlantsElements[j]);
            for (int k = 0; k < componentsDeepChild.Length; k++)
            {
                componentsDeepChild[k].text = GreenHellGame.Instance.GetLocalization().Get(componentsDeepChild[k].name, true);
            }
            PageNum component = this.m_PlantsElements[j].GetComponent <PageNum>();
            if (component.m_PageNum + 1 > num)
            {
                num = component.m_PageNum + 1;
            }
        }
        this.m_NumActivePages = num * 2;
    }
Exemplo n.º 4
0
    private void BindGrid()
    {
        GrdDownloads.DataSource = null;
        GrdDownloads.DataBind();

        PnlSearch.BindControls(FilterDictionary, TableName);

        FilterDictionary = new Dictionary <string, object>()
        {
            { "DownloadsTypesID", DListFilterDownloadsTypes.SelectedValue },
            { "DisplayName(LIKE)", TxtFilterFileName.Text },
            { "IsActive", int.Parse(DListFilterStatus.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, FilterDictionary, PageNum, RowNumber);

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

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

        LblCount.Text = string.Format(LblCount.Text, 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;

        GrdDownloads.DataSource = FilterList.Dt;
        GrdDownloads.DataBind();

        GrdDownloads.Columns[GrdDownloads.Columns.Count - 1].Visible = DALC._GetUsersLogin.OrganizationsParentID == 0;
    }
Exemplo n.º 5
0
    void BindGrid()
    {
        GrdOrganizations.DataSource = null;
        GrdOrganizations.DataBind();

        if (Session[_FilterSessionName] != null)
        {
            var DictionarySession = (Dictionary <string, object>)Session[_FilterSessionName];
            if (DictionarySession.Count != 0)
            {
                DListTopOrganizationFilter.SelectedValue = DictionarySession["ParentID"]._ToString();
                TxtNameFilter.Text = DictionarySession["Name(LIKE)"]._ToString();
            }
        }

        var Dictionary = new Dictionary <string, object>()
        {
            { "ParentID", DListTopOrganizationFilter.SelectedValue },
            { "Name(LIKE)", TxtNameFilter.Text },
        };


        int PageNum;
        int RowNumber = 20;

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

        // Axirinci sehifeni secmedikce Cache temizlemirik herdefe count almasin deye
        if (PageNum >= (Cache[_CountCacheName]._ToInt32() / RowNumber))
        {
            Cache.Remove(_CountCacheName);
        }

        HdnPageNumber.Value = PageNum.ToString();

        DALC.DataTableResult PersonsList = DALC.GetOrganizationsList(Dictionary, PageNum, RowNumber);

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

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

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

        HdnTotalCount.Value = Total_Count.ToString();

        PnlPager.Visible            = PersonsList.Count > RowNumber;
        GrdOrganizations.DataSource = PersonsList.Dt;
        GrdOrganizations.DataBind();
    }
Exemplo n.º 6
0
    private void BindGridApplications()
    {
        GrdApplicationsFamily.DataSource = null;
        GrdApplicationsFamily.DataBind();

        PnlSearch.BindControls(FilterDictionary, TableName);

        FilterDictionary = new Dictionary <string, object>()
        {
            { "OrganizationsID", int.Parse(DListFltOrganizations.SelectedValue) },
            { "ID", TxtApplicationsFamilyID.Text },
            { "ApplicationsFamilyTypesID", int.Parse(DListFltApplicationsFamilyTypes.SelectedValue) },
            { "ApplicationsFamilyStatusID", int.Parse(DListFltApplicationsFamilyStatus.SelectedValue) },
            { "Tour_Dt(BETWEEN)", Config.DateTimeFilter(TxtFilterTourDt1.Text, TxtFilterTourDt2.Text) },
            { "Add_Dt(Between)", Config.DateTimeFilter(TxtFilterDate1.Text, TxtFilterDate2.Text) },
        };

        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, FilterDictionary, PageNum, RowNumber);

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

        if (FilterList.Dt.Rows.Count < 1 && PageNum > 1)
        {
            Config.RedirectURL(string.Format("/tools/applicationsfamily/?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;
        GrdApplicationsFamily.DataSource = FilterList.Dt;
        GrdApplicationsFamily.DataBind();
    }
Exemplo n.º 7
0
 public override void AddAdditionalParams(Dictionary <string, string> parameters)
 {
     this.NameValues["action"]   = this.MethodName;
     this.NameValues["word"]     = this.Word;
     this.NameValues["apilevel"] = "4";
     this.NameValues["rn"]       = "50";
     this.NameValues["pn"]       = PageNum.ToString();
     base.AddAdditionalParams(parameters);
 }
Exemplo n.º 8
0
    private void Navigation(long totalRecords)
    {
        //------------
        txtPageTotalRowsNum.Text = totalRecords.ToString();

        if (totalRecords != 0)
        {
            Double totalPages = Math.Ceiling(((double)totalRecords / PageSize));

            if ((totalRecords == 1) || (totalPages == 0))
            {
                totalPages = 1;
            }

            //if (PageSizeMAE > totalRecords)
            //{
            //    PageSizeMAE = (int)totalPages;
            //}
            //else
            //    PageSizeMAE = long.Parse(ConfigurationSettings.AppSettings["RowsPorPagina"].ToString());

            txtGoToPage.Text    = PageNum.ToString();
            lblCurrentPage.Text = PageNum.ToString();
            lblTotalPages.Text  = totalPages.ToString();
        }
        else
        {
            txtPageTotalRowsNum.Text = "0";
            txtGoToPage.Text         = "0";
            lblCurrentPage.Text      = "0";
            lblTotalPages.Text       = "0";
        }

        //control de teclas
        if (lblCurrentPage.Text.Trim().Equals(lblTotalPages.Text.Trim()))
        {
            NextPage.Enabled = false;
            LastPage.Enabled = false;
        }
        else
        {
            NextPage.Enabled = true;
            LastPage.Enabled = true;
        }

        if (lblCurrentPage.Text.Trim().Equals("1"))
        {
            FirstPage.Enabled    = false;
            PreviousPage.Enabled = false;
        }
        else
        {
            FirstPage.Enabled    = true;
            PreviousPage.Enabled = true;
        }
    }
Exemplo n.º 9
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();
    }
Exemplo n.º 10
0
 private void ShowPageForLastUnlockedItem()
 {
     for (int i = 0; i < this.m_ItemsElelements.Count; i++)
     {
         PageNum         component  = this.m_ItemsElelements[i].GetComponent <PageNum>();
         NotepadItemData component2 = this.m_ItemsElelements[i].gameObject.GetComponent <NotepadItemData>();
         if (!(component == null) && !(component2 == null) && component2.m_ItemID == this.m_LastUnlockedItem.ToString())
         {
             this.m_CurrentPage = component.m_PageNum;
         }
     }
 }
Exemplo n.º 11
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();
    }
Exemplo n.º 12
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();
    }
Exemplo n.º 13
0
        /// <summary>
        /// Returns the hash code for this instance
        /// </summary>
        /// <returns>The hash code for this instance</returns>
        public override int GetHashCode()
        {
            var hashCode = -2110119757;

            hashCode = hashCode * -1521134295 + ISBN.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Author);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(PublishingHouse);

            hashCode = hashCode * -1521134295 + Year.GetHashCode();
            hashCode = hashCode * -1521134295 + PageNum.GetHashCode();
            return(hashCode);
        }
Exemplo n.º 14
0
        public virtual string Render(IPagingConfig config)
        {
            StringBuilder sb      = new StringBuilder();
            var           qString = PageNum != 0 ? "?" + _State.BuildPaginationQueryString(config.PageKey, PageNum) : "#";

            sb.Append(PageNum == 0 ? config.DisabledLinkWrapperStart : config.LinkWrapperStart);
            sb.Append($"<a id='page_link_{PageNum}'");
            sb.Append($" name='page_link_{PageNum}' ");
            sb.Append($" class='{config.LinkClass}' ");
            sb.Append($" href='{ qString}' ");
            sb.Append(">");
            sb.Append(Text ?? PageNum.ToString());
            sb.Append("</a>");
            sb.Append(config.LinkWrapperEnd);
            return(sb.ToString());
        }
Exemplo n.º 15
0
    private void BindData()
    {
        GrdUserLogs.DataSource = null;
        GrdUserLogs.DataBind();

        FilterDictionary = new Dictionary <string, object>()
        {
            { "PIN", TxtPin.Text },
            { "AdoptionOrganizationsID", DListOrganizations.SelectedValue },
            { "RegisterNo", TxtRegisterNo.Text },
            { "SearchParams(LIKE)", TxtContent.Text }
        };

        int PageNum;
        int RowNumber = 20;

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

        HdnPageNumber.Value = PageNum.ToString();

        DALC.DataTableResult AdoptionSearchResult = DALC_Adoption.GetAdoptionSearchHistory(FilterDictionary, PageNum, RowNumber);

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

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

        LblCount.Text = string.Format("Tapılıb: {0}", AdoptionSearchResult.Count.ToString());

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

        HdnTotalCount.Value = Total_Count.ToString();

        PnlPager.Visible = AdoptionSearchResult.Count > RowNumber;

        GrdUserLogs.DataSource = AdoptionSearchResult.Dt;
        GrdUserLogs.DataBind();
    }
Exemplo n.º 16
0
    private void Awake()
    {
        for (int i = 0; i < base.gameObject.transform.childCount; i++)
        {
            GameObject gameObject = base.gameObject.transform.GetChild(i).gameObject;
            this.m_SkillsElement.Add(gameObject);
        }
        int num = 0;

        for (int j = 0; j < this.m_SkillsElement.Count; j++)
        {
            PageNum component = this.m_SkillsElement[j].GetComponent <PageNum>();
            if (component.m_PageNum + 1 > num)
            {
                num = component.m_PageNum + 1;
            }
        }
        this.m_NumActivePages = num * 2;
    }
Exemplo n.º 17
0
    private void UpdateActivePage()
    {
        int num = 0;

        for (int i = 0; i < this.m_SkillsElement.Count; i++)
        {
            PageNum component = this.m_SkillsElement[i].GetComponent <PageNum>();
            if (component.m_PageNum == this.m_CurrentPage)
            {
                this.m_SkillsElement[i].SetActive(true);
                num++;
            }
            else
            {
                this.m_SkillsElement[i].SetActive(false);
            }
        }
        this.m_NumActiveElementsOnPage = num;
        this.UpdateTexts();
    }
Exemplo n.º 18
0
    protected void btnToExcell_Click(object sender, ImageClickEventArgs e)
    {
        DataTable dt = ToDatatable.toDataTable(sesNotificacionesVencidas);

        dt.TableName = "ListadoDevolucionesFueraDePlazo-Pagina-" + PageNum.ToString() + "-" + System.DateTime.Now.ToShortDateString();


        try
        {
            string strBody = "";
            strBody = Exportar.DataTable2ExcelString(dt);

            Response.AppendHeader("Content-Type", "application/vnd.ms-excel");
            Response.AppendHeader("Content-disposition", "attachment; filename=DevolucionesFueraDePlazo_Consulta_Pagina_" + PageNum.ToString() + "_" + System.DateTime.Now.ToShortDateString() + "_Pag_" + lblCurrentPage.Text + ".xls");
            Response.Write(strBody);
        }
        catch (Exception er)
        {
            log.Error("Ocurrio un error al generar el listado de exportacion." + er.Message);
            MError.MensajeError = "Ocurrio un error al generar el listado de exportacion.";
        }
    }
Exemplo n.º 19
0
    private void BindGridApplications()
    {
        GrdApplications.DataSource = null;
        GrdApplications.DataBind();

        PnlSearch.BindControls(FilterDictionary, TableName);

        FilterDictionary = new Dictionary <string, object>()
        {
            { "OrganizationsID", int.Parse(DListFilterOrganizations.SelectedValue) },
            { "ID", TxtFilterAppID.Text },
            { "ApplicationsTypesID", int.Parse(DListFilterApplicationsTypes.SelectedValue) },
            { "ApplicationsCaseStatusID", int.Parse(DListFilterApplicationsCaseStatus.SelectedValue) },
            { "RegisteredAddress(LIKE)", TxtFilterRegisteredAddress.Text },
            { "CurrentAddress(LIKE)", TxtFilterCurrentAddress.Text },
            { "SocialStatusID", int.Parse(DListFilterSocialStatusID.SelectedValue) },
            { "ApplicationsPersonsTypesID", int.Parse(DListFilterApplicationsPersonsTypes.SelectedValue) },
            { "DocumentTypesID", int.Parse(DListFilterDocumentTypes.SelectedValue) },
            { "DocumentNumber", TxtFilterDocumentNumber.Text },
            { "Name(LIKE)", TxtFilterName.Text },
            { "Surname(LIKE)", TxtFilterSurname.Text },
            { "Patronymic(LIKE)", TxtFilterPatronymic.Text },
            { "Create_Dt(Between)", Config.DateTimeFilter(TxtFilterDate1.Text, TxtFilterDate2.Text) },
            { "IsRepeat", CheckFilterIsRepeat.Checked ? 1 : -1 },
        };

        //Əməliyyatlar multi secim oldugu ucun onun axtarish algoritmasini elave olaraq burda yazdim
        for (int i = 0; i < DListFilterListOperationTypes.Items.Count; i++)
        {
            ListItem Item = DListFilterListOperationTypes.Items[i];
            if (Item.Selected == true)
            {
                FilterDictionary.Add(((Tools.ListOperationTypes) int.Parse(Item.Value)).ToDescriptionString() + "(OR)", "IS NOT NULL");
            }
        }

        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, FilterDictionary, PageNum, RowNumber);

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

        if (FilterList.Dt.Rows.Count < 1 && PageNum > 1)
        {
            Config.RedirectURL(string.Format("/tools/applications/?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;

        GrdApplications.DataSource = FilterList.Dt;
        GrdApplications.DataBind();
    }
Exemplo n.º 20
0
 public static PageNum <THelper> SetDisabled <THelper>(this PageNum <THelper> pageNum, bool disabled = true)
     where THelper : BootstrapHelper <THelper>
 {
     pageNum.Disabled = disabled;
     return(pageNum);
 }
Exemplo n.º 21
0
 public static PageNum <THelper> SetActive <THelper>(this PageNum <THelper> pageNum, bool active = true)
     where THelper : BootstrapHelper <THelper>
 {
     pageNum.Active = active;
     return(pageNum);
 }
    void BindGrid()
    {
        if (Session[_FilterSessionName] != null)
        {
            var DictionarySession = (Dictionary <string, object>)Session[_FilterSessionName];
            if (DictionarySession.Count != 0)
            {
                TxtRowIndexFilter.Text = DictionarySession["RowIndex"]._ToString();
                DlistRegionalCenterFilter.SelectedValue     = DictionarySession["RegionalCentersID"]._ToString();
                DListParentOrganizationFilter.SelectedValue = DictionarySession["ParentOrganizationsID"]._ToString();
                DListTopOrganizationFilter_SelectedIndexChanged(null, null);
                DListSubOrganizationFilter.SelectedValue = DictionarySession["OrganizationsID"]._ToString();
                DlistVisitTypeFilter.SelectedValue       = DictionarySession["VisitTypeID"]._ToString();
                TxtVisitDtStartFilter.Text      = DictionarySession["StartVisit_Dt"]._ToString();
                TxtVisitDtEndFilter.Text        = DictionarySession["EndVisit_Dt"]._ToString();
                TxtDescriptionFilter.Text       = DictionarySession["Descriptions"]._ToString();
                DListDatePriority.SelectedValue = DictionarySession["DatePriority"]._ToString();
                DListPageSize.SelectedValue     = DictionarySession["PageSize"]._ToString();
            }
        }

        #region BetweenDateFromat

        string Date = "";

        string Dt1 = "19000101";
        string Dt2 = DateTime.Now.ToString("yyyyMMdd");

        object DateFilter1 = Config.DateTimeFormat(TxtVisitDtStartFilter.Text.Trim());
        object DateFilter2 = Config.DateTimeFormat(TxtVisitDtEndFilter.Text.Trim());

        if (DateFilter1 == null && DateFilter2 == null)
        {
            Date = "";
        }
        else
        {
            if (DateFilter1 != null)
            {
                Dt1 = ((DateTime)DateFilter1).ToString("yyyyMMdd");
            }

            if (DateFilter2 != null)
            {
                Dt2 = ((DateTime)DateFilter2).ToString("yyyyMMdd");
            }

            Date = Dt1 + "&" + Dt2;
        }
        #endregion


        var Dictionary = new Dictionary <string, object>()
        {
            { "RegionalCentersID", DlistRegionalCenterFilter.SelectedValue },
            { "ParentOrganizationsID", DListParentOrganizationFilter.SelectedValue },
            { "OrganizationsID", DListSubOrganizationFilter.SelectedValue },
            { "VisitTypeID", DlistVisitTypeFilter.SelectedValue },
            { "Visit_Dt(BETWEEN)", Date },
            { "Descriptions(LIKE)", TxtDescriptionFilter.Text }
        };

        string OrderByType = "desc";

        if (DListDatePriority.SelectedValue == "20")
        {
            OrderByType = "asc";
        }

        //Sira sayina gore filteri elave olaraq gonderirik
        int RowIndex = -1;
        if (!int.TryParse(TxtRowIndexFilter.Text, out RowIndex))
        {
            RowIndex = -1;
        }

        int PageNum;
        int RowNumber = 30;

        if (DListPageSize.SelectedValue == "20")
        {
            RowNumber = 10000;
        }

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

        // Axirinci sehifeni secmedikce Cache temizlemirik herdefe count almasin deye
        if (PageNum >= (Cache[_CountCacheName]._ToInt32() / RowNumber))
        {
            Cache.Remove(_CountCacheName);
        }

        HdnPageNumber.Value = PageNum.ToString();

        DALC.DataTableResult ApplicationsList = DALC.GetAuditsOrganizations(Dictionary, PageNum, RowNumber, new object[] { RowIndex }, OrderByType);

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

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

        int Total_Count = ApplicationsList.Count % RowNumber > 0 ? (ApplicationsList.Count / RowNumber) + 1 : ApplicationsList.Count / RowNumber;
        HdnTotalCount.Value = Total_Count.ToString();

        PnlPager.Visible = ApplicationsList.Count > RowNumber;

        GrdAuditsOrganizations.DataSource = ApplicationsList.Dt;
        GrdAuditsOrganizations.DataBind();

        LblCountInfo.Text = string.Format("Axtarış üzrə nəticə: {0}", ApplicationsList.Count);
    }
Exemplo n.º 23
0
    private void BindGrdServicesCourses()
    {
        GrdServicesCourses.DataSource = null;
        GrdServicesCourses.DataBind();

        PnlSearch.BindControls(FilterDictionary, TableName);
        #region BetweenDateFromat

        string Start_Dt = "";
        string End_Dt   = "";

        object DateFilterStart_Dt = Config.DateTimeFormat(TxtFilterStart_Dt.Text.Trim());
        object DateFilterEnd_Dt   = Config.DateTimeFormat(TxtFilterEnd_Dt.Text.Trim());


        if (DateFilterStart_Dt != null)
        {
            Start_Dt = ((DateTime)DateFilterStart_Dt).ToString("yyyyMMdd");
        }

        if (DateFilterEnd_Dt != null)
        {
            End_Dt = ((DateTime)DateFilterEnd_Dt).ToString("yyyyMMdd");
        }

        #endregion

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

        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);

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

        if (FilterList.Dt.Rows.Count < 1 && PageNum > 1)
        {
            Config.RedirectURL(string.Format("/tools/electronicregistry/?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;
        GrdServicesCourses.DataSource = FilterList.Dt;
        GrdServicesCourses.DataBind();
    }
Exemplo n.º 24
0
    private void BindGallery()
    {
        RptFotoGallery.DataSource = null;
        RptFotoGallery.DataBind();

        PnlSearch.BindControls(FilterDictionary, TableName);

        FilterDictionary = new Dictionary <string, object>()
        {
            { "OrganizationsID", int.Parse(DListFilterOrganizations.SelectedValue) },
            { "DataID(!=)", 0 },
            { "DownloadsQualityTypesID", int.Parse(DListFilterDownloadsQualityTypes.SelectedValue) },
            { "DisplayName(LIKE)", TxtFilterFileName.Text },
            { "IsActive", int.Parse(DListFilterStatus.SelectedValue) },
        };

        if (PnlFilterDate.Visible == true)
        {
            FilterDictionary.Add("DownloadsTypesID", int.Parse(DListFilterDownloadsTypes.SelectedValue));
            FilterDictionary.Add("Years", int.Parse(DListFilterYears.SelectedValue));
            FilterDictionary.Add("Months", int.Parse(DListFilterMonths.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, FilterDictionary, PageNum, RowNumber);

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

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

        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;

        RptFotoGallery.DataSource = FilterList.Dt;
        RptFotoGallery.DataBind();
    }
Exemplo n.º 25
0
    private void BindGridUsers()
    {
        GrdUsers.DataSource = null;
        GrdUsers.DataBind();

        if (Session[_FilterSessionName] != null)
        {
            var DictionarySession = (Dictionary <string, object>)Session[_FilterSessionName];
            if (DictionarySession.Count != 0)
            {
                DListFilterOrganizations.SelectedValue = DictionarySession["OrganizationsID"]._ToString();
                TxtFilterFullname.Text           = DictionarySession["Fullname"]._ToString();
                TxtFilterDocNumber.Text          = DictionarySession["DocumentNumber"]._ToString();
                TxtFilterPin.Text                = DictionarySession["PIN"]._ToString();
                DListFilterDocType.SelectedValue = DictionarySession["DocumentsTypesID"]._ToString();
            }
        }

        TxtFilterFullname.Text = TxtFilterFullname.Text.ToUpper();
        TxtFilterPin.Text      = TxtFilterPin.Text.ToUpper();

        var Dictionary = new Dictionary <string, object>()
        {
            { "OrganizationsID", int.Parse(DListFilterOrganizations.SelectedValue) },
            { "Fullname(LIKE)", TxtFilterFullname.Text },
            { "DocumentNumber", TxtFilterDocNumber.Text },
            { "PIN", TxtFilterPin.Text },
            { "DocumentsTypesID", int.Parse(DListFilterDocType.SelectedValue) }
        };

        int PageNum;
        int RowNumber = 20;

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

        HdnPageNumber.Value = PageNum.ToString();

        DALC.DataTableResult UsersList = DALC.GetUsers(Dictionary, PageNum, RowNumber);

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

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

        LblCount.Text = string.Format("Axtarış üzrə nəticə: {0}", UsersList.Count);
        int Total_Count = UsersList.Count % RowNumber > 0 ? (UsersList.Count / RowNumber) + 1 : UsersList.Count / RowNumber;

        HdnTotalCount.Value = Total_Count.ToString();

        PnlPager.Visible = UsersList.Count > RowNumber;

        GrdUsers.DataSource = UsersList.Dt;
        GrdUsers.DataBind();
    }
Exemplo n.º 26
0
    private void BindGrdApplicationsPersons()
    {
        GrdApplicationsPersons.DataSource = null;
        GrdApplicationsPersons.DataBind();

        PnlSearch.BindControls(FilterDictionary, _TableName);

        FilterDictionary = new Dictionary <string, object>()
        {
            { "OrganizationsID", int.Parse(DListFltOrganizations.SelectedValue) },
            { "ID", TxtFltPersonID.Text },
            { "ApplicationsID", TxtFltApplicationsID.Text },
            { "ApplicationsTypesID", int.Parse(DListFltApplicationsTypes.SelectedValue) },
            { "ApplicationsPersonsTypesID", int.Parse(DListFltApplicationsPersonsType.SelectedValue) },
            { "DocumentTypesID", int.Parse(DListFltDocumentTypes.SelectedValue) },
            { "DocumentNumber", TxtFltDocumentNumber.Text },
            { "Surname(LIKE)", TxtFltSurname.Text },
            { "Name(LIKE)", TxtFltName.Text },
            { "Patronymic(LIKE)", TxtFltPatronymic.Text },
            { "SocialStatusID", int.Parse(DListFltSocialStatusID.SelectedValue) },
            { "RegisteredAddress(LIKE)", TxtFilterRegisteredAddress.Text },
            { "CurrentAddress(LIKE)", TxtFilterCurrentAddress.Text },
            { "Add_Dt(Between)", Config.DateTimeFilter(TxtFilterDate1.Text, TxtFilterDate2.Text) },
        };

        if (PnlOperations.Visible == true)
        {
            //Əməliyyatlar multi secim oldugu ucun onun axtarish algoritmasini elave olaraq burda yazdim
            for (int i = 0; i < DListFltListOperationTypes.Items.Count; i++)
            {
                ListItem Item = DListFltListOperationTypes.Items[i];
                if (Item.Selected == true)
                {
                    FilterDictionary.Add(((Tools.ListOperationTypes) int.Parse(Item.Value)).ToDescriptionString() + "(OR)", "IS NOT NULL");
                }
            }
        }
        else
        {
            switch (Config._GetQueryString("type"))
            {
            case "sibr-evaluations":
                FilterDictionary.Add("SIBRID", "IS NOT NULL");
                ((Literal)Master.FindControl("LtrTitle")).Text = "SIB-R Qiymətləndirilənlər";
                break;

            case "evaluations":
                FilterDictionary.Add("EvaluationsID", "IS NOT NULL");
                ((Literal)Master.FindControl("LtrTitle")).Text = "Qiymətləndirilənlər";
                break;

            case "evaluationsskill":
                FilterDictionary.Add("EvaluationsSkillID", "IS NOT NULL");
                ((Literal)Master.FindControl("LtrTitle")).Text = "Qiymətləndirilənlər";
                break;

            case "services":
                FilterDictionary.Add("ApplicationsPersonsServicesID", "IS NOT NULL");
                ((Literal)Master.FindControl("LtrTitle")).Text = "Xidmətlərdən istifadə edənlər";
                break;

            case "case":
                FilterDictionary.Add("ApplicationsCaseID", "IS NOT NULL");
                ((Literal)Master.FindControl("LtrTitle")).Text = "CASE açılanlar";
                break;

            default:
                break;
            }
        }

        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, FilterDictionary, PageNum, RowNumber);

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

        if (FilterList.Dt.Rows.Count < 1 && PageNum > 1)
        {
            Config.RedirectURL(string.Format("/tools/applicationspersons/?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;
        GrdApplicationsPersons.DataSource = FilterList.Dt;
        GrdApplicationsPersons.DataBind();
    }
    void BindGrid()
    {

        if (Session[_FilterSessionName] != null)
        {
            var DictionarySession = (Dictionary<string, object>)Session[_FilterSessionName];
            if (DictionarySession.Count != 0)
            {
                TxtRowIndexFilter.Text = DictionarySession["RowIndex"]._ToString();
                TxtNumbersFilter.Text = DictionarySession["Numbers"]._ToString();
                DListComplaintTypeFilter.SelectedValue = DictionarySession["ComplaintTypeID"]._ToString();
                DlistExecutiveUsersFilter.SelectedValue = DictionarySession["ExecutiveUsersID"]._ToString();
                TxtApplicantsFullnameFilter.Text = DictionarySession["ApplicantsFullname"]._ToString();
                DListApplicantsGenderTypeFilter.SelectedValue = DictionarySession["GenderTypeID"]._ToString();
                DListApplicantsSocialStatusFilter.SelectedValue = DictionarySession["SocialStatusID"]._ToString();
                TxtVictimsFullnameFilter.Text = DictionarySession["VictimsFullname"]._ToString();
                TxtComplaintInstitutionFilter.Text = DictionarySession["ComplaintInstitution"]._ToString();
                DListComplaintResultTypeFilter.SelectedValue = DictionarySession["ComplaintResultTypeID"]._ToString();
                TxtResultsFilter.Text = DictionarySession["Results"]._ToString();
                TxtEnterOrganizationsStartDtFilter.Text = DictionarySession["StartEnterOrganizations_Dt"]._ToString();
                TxtEnterOrganizationsEndDtFilter.Text = DictionarySession["EndEnterOrganizations_Dt"]._ToString();
                TxtEnterSectorStartDtFilter.Text = DictionarySession["StartEnterSector_Dt"]._ToString();
                TxtEnterSectorEndDtFilter.Text = DictionarySession["EndEnterSector_Dt"]._ToString();
                DListDatePriority.SelectedValue = DictionarySession["DatePriority"]._ToString();
                DListPageSize.SelectedValue = DictionarySession["PageSize"]._ToString();
            }
        }

        #region BetweenDateFromat

        string OrganizationsDate = "";

        string Dt1 = "19000101";
        string Dt2 = DateTime.Now.ToString("yyyyMMdd");

        object DateFilter1 = Config.DateTimeFormat(TxtEnterOrganizationsStartDtFilter.Text.Trim());
        object DateFilter2 = Config.DateTimeFormat(TxtEnterOrganizationsEndDtFilter.Text.Trim());

        if (DateFilter1 == null && DateFilter2 == null)
        {
            OrganizationsDate = "";
        }
        else
        {
            if (DateFilter1 != null)
            {
                Dt1 = ((DateTime)DateFilter1).ToString("yyyyMMdd");
            }

            if (DateFilter2 != null)
            {
                Dt2 = ((DateTime)DateFilter2).ToString("yyyyMMdd");
            }

            OrganizationsDate = Dt1 + "&" + Dt2;
        }


        string SectorDate = "";

        Dt1 = "19000101";
        Dt2 = DateTime.Now.ToString("yyyyMMdd");

        DateFilter1 = Config.DateTimeFormat(TxtEnterSectorStartDtFilter.Text.Trim());
        DateFilter2 = Config.DateTimeFormat(TxtEnterSectorEndDtFilter.Text.Trim());

        if (DateFilter1 == null && DateFilter2 == null)
        {
            SectorDate = "";
        }
        else
        {
            if (DateFilter1 != null)
            {
                Dt1 = ((DateTime)DateFilter1).ToString("yyyyMMdd");
            }

            if (DateFilter2 != null)
            {
                Dt2 = ((DateTime)DateFilter2).ToString("yyyyMMdd");
            }

            SectorDate = Dt1 + "&" + Dt2;

        }
        #endregion

        var Dictionary = new Dictionary<string, object>()
        {
            {"Numbers",TxtNumbersFilter.Text},
            {"ComplaintTypeID",int.Parse(DListComplaintTypeFilter.SelectedValue)},
            {"ExecutiveUsersID",int.Parse(DlistExecutiveUsersFilter.SelectedValue) },
            {"GenderTypeID",int.Parse(DListApplicantsGenderTypeFilter.SelectedValue) },
            {"SocialStatusID",int.Parse(DListApplicantsSocialStatusFilter.SelectedValue) },
            {"(LIKE)ApplicantsFullname",TxtApplicantsFullnameFilter.Text},
            {"(LIKE)VictimsFullname",TxtVictimsFullnameFilter.Text},
            {"ComplaintInstitution", TxtComplaintInstitutionFilter.Text},
            {"ComplaintResultTypeID", DListComplaintResultTypeFilter.SelectedValue},
            {"(LIKE)Results", TxtResultsFilter.Text},
            {"EnterOrganizations_Dt(BETWEEN)", OrganizationsDate},
            {"EnterSector_Dt(BETWEEN)", SectorDate}
        };

        //Sira sayina gore filteri elave olaraq gonderirik
        int RowIndex = -1;
        if (!int.TryParse(TxtRowIndexFilter.Text, out RowIndex))
        {
            RowIndex = -1;
        }


        int PageNum;
        int RowNumber = 30;

        if (DListPageSize.SelectedValue == "20")
        {
            RowNumber = 10000;
        }

        string OrderByType = "desc";

        if (DListDatePriority.SelectedValue == "20")
        {
            OrderByType = "asc";
        }

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

        // Axirinci sehifeni secmedikce Cache temizlemirik herdefe count almasin deye
        if (PageNum >= (Cache[_CountCacheName]._ToInt32() / RowNumber))
        {
            Cache.Remove(_CountCacheName);
        }

        HdnPageNumber.Value = PageNum.ToString();

        DALC.DataTableResult ApplicationsList = DALC.GetIndividualComplaints(Dictionary, PageNum, RowNumber, new object[] { RowIndex }, OrderByType);

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

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

        int Total_Count = ApplicationsList.Count % RowNumber > 0 ? (ApplicationsList.Count / RowNumber) + 1 : ApplicationsList.Count / RowNumber;
        HdnTotalCount.Value = Total_Count.ToString();

        PnlPager.Visible = ApplicationsList.Count > RowNumber;

        GrdIndividualComplaints.DataSource = ApplicationsList.Dt;
        GrdIndividualComplaints.DataBind();

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

    }
Exemplo n.º 28
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        string Url = ViewState["Url"].ToString();

        if (String.IsNullOrEmpty(Request.QueryString["page"]))
        {
            curpage = 1;
        }
        else
        {
            curpage = Convert.ToInt32(Request.QueryString["page"]);
        }

        //每页显示条数
        if (String.IsNullOrEmpty(Request.QueryString["pageSize"]))
        {
            curpageSize = pagesize;
        }
        else
        {
            curpageSize = Convert.ToInt32(Request.QueryString["pageSize"]);
        }

        if (!IsPostBack)
        {
            if (String.IsNullOrEmpty(Request.QueryString["pageSize"]))
            {
                txtPage.Text = pagesize.ToString();
            }
            else
            {
                txtPage.Text = Request.QueryString["pageSize"];
            }
        }

        if (ViewState["query"] == null || ViewState["query"].ToString() == string.Empty)
        {
            this.Visible = false;
            return;
        }

        GetData(curpage, curpageSize);

        if (total == 0)
        {
            this.Visible = false;
            return;
        }
        else
        {
            this.Visible = true;
        }

        if (text.Visible == true)
        {
            if (curpage == 1 && totalpage > 1)
            {
                ChangeState(false, true);
            }
            else if (curpage == totalpage && totalpage > 1)
            {
                ChangeState(true, false);
            }
            else if (totalpage == 1)
            {
                ChangeState(false, false);
            }
            else
            {
                ChangeState(true, true);
            }
        }
        else
        {
            int startpage;
            int endpage;
            startpage = Convert.ToInt16(curpage);
            endpage   = startpage + 9;

            if (endpage > totalpage)
            {
                endpage = totalpage;
            }

            for (int i = 0; i <= 9; i++)//初使化分页链接
            {
                HyperLink lnkbtn = (this.FindControl("lnkbtn" + i) as HyperLink);
                if (i + startpage <= endpage)
                {
                    lnkbtn.NavigateUrl = Url + "&page=" + (i + startpage).ToString() + "&pageSize=" + txtPage.Text;
                    lnkbtn.Text        = (i + startpage).ToString();
                    if (curpage == i + startpage)
                    {
                        lnkbtn.Enabled = false;
                    }
                    else
                    {
                        lnkbtn.Enabled = true;
                    }

                    lnkbtn.Visible = true;
                }
                else
                {
                    lnkbtn.Visible = false;
                }
            }

            if (lnkbtn0.Text == "1")
            {
                pre.Visible = false;
            }
            else
            {
                pre.Visible = true;
            }

            if (lnkbtn9.Visible == false || Convert.ToInt16(lnkbtn9.Text) == totalpage)
            {
                next.Visible = false;
            }
            else
            {
                next.Visible = true;
            }
        }
        lblCurpage.Text = curpage.ToString();   //页次
        lblTotal.Text   = total.ToString();     //记录总数
        lblPages.Text   = totalpage.ToString(); //总页数

        //Num 分页 下十页,最后一页,上十页,最前一页
        int PageNum;

        if (Convert.ToInt16(lblCurpage.Text) - 10 < 1)
        {
            PageNum = 1;
        }
        else
        {
            PageNum = Convert.ToInt16(lblCurpage.Text) - 10;
        }
        lnkbtnFTen.NavigateUrl = Url + "&page=" + PageNum.ToString() + "&pageSize=" + txtPage.Text;
        if (Convert.ToInt16(lblCurpage.Text) - 1 < 1)
        {
            PageNum = 1;
        }
        else
        {
            PageNum = Convert.ToInt16(lblCurpage.Text) - 1;
        }
        lnkbtnPTen.NavigateUrl = Url + "&page=" + PageNum.ToString() + "&pageSize=" + txtPage.Text;
        if (Convert.ToInt16(lblCurpage.Text) + 1 > total)
        {
            PageNum = total;
        }
        else
        {
            PageNum = Convert.ToInt16(lblCurpage.Text) + 1;
        }
        lnkbtnNTen.NavigateUrl = Url + "&page=" + PageNum.ToString() + "&pageSize=" + txtPage.Text;
        if (Convert.ToInt16(lblCurpage.Text) + 10 > total)
        {
            PageNum = total;
        }
        else
        {
            PageNum = Convert.ToInt16(lblCurpage.Text) + 10;
        }
        lnkbtnLTen.NavigateUrl = Url + "&page=" + PageNum.ToString() + "&pageSize=" + txtPage.Text;

        //Text 分页  首页 上一页 下一页 末页
        lnkbtnFirst.NavigateUrl    = Url + "&page=1" + "&pageSize=" + txtPage.Text;
        lnkbtnPrevious.NavigateUrl = Url + "&page=" + (curpage - 1).ToString() + "&pageSize=" + txtPage.Text;
        lnkbtnNext.NavigateUrl     = Url + "&page=" + (curpage + 1).ToString() + "&pageSize=" + txtPage.Text;
        lnkbtnLast.NavigateUrl     = Url + "&page=" + totalpage.ToString() + "&pageSize=" + txtPage.Text;
    }
Exemplo n.º 29
0
    private void BindGrdCourses()
    {
        GrdServicesCourses.DataSource = null;
        GrdServicesCourses.DataBind();

        PnlSearch.BindControls(FilterDictionary, TableName);

        #region BetweenDateFromat

        string Date = "";

        string Dt1 = "20170101";
        string Dt2 = DateTime.Now.ToString("yyyyMMdd");

        object DateFilter1 = Config.DateTimeFormat(TxtFilterStart_Dt.Text.Trim());
        object DateFilter2 = Config.DateTimeFormat(TxtFilterEnd_Dt.Text.Trim());

        if (DateFilter1 == null && DateFilter2 == null)
        {
            Date = "";
        }
        else
        {
            if (DateFilter1 != null)
            {
                Dt1 = ((DateTime)DateFilter1).ToString("yyyyMMdd");
            }

            if (DateFilter2 != null)
            {
                Dt2 = ((DateTime)DateFilter2).ToString("yyyyMMdd");
            }

            Date = Dt1 + "&" + Dt2;
        }
        #endregion

        var Dictionary = new Dictionary <string, object>()
        {
            { "OrganizationsID", int.Parse(DListFilterOrganizations.SelectedValue) },
            { "ServicesID", int.Parse(DListFilterServices.SelectedValue) },
            { "TeacherUsersID", int.Parse(DListFilterTeacherUsers.SelectedValue) },
            { "Name(LIKE)", TxtCourseName.Text },
            { "Start_Dt(BETWEEN)", Config.DateTimeFilter(TxtFilterStart_Dt.Text, TxtFilterEnd_Dt.Text) },
            { "IsActive", int.Parse(DListFilterStatus.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);

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

        if (FilterList.Dt.Rows.Count < 1 && PageNum > 1)
        {
            Config.RedirectURL(string.Format("/tools/electronicregistry/courses/?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;
        GrdServicesCourses.DataSource = FilterList.Dt;
        GrdServicesCourses.DataBind();
    }
Exemplo n.º 30
0
    private void BindData()
    {
        RptChilds.DataSource = null;
        RptChilds.DataBind();

        PnlSearch.BindControls(FilterDictionary, TableName);

        FilterDictionary = new Dictionary <string, object>()
        {
            { "Gender", DListGender.SelectedValue },
            { "GozColorsID", int.Parse(DListEyeColor.SelectedValue) },
            { "SachColorsID", int.Parse(DListHairColor.SelectedValue) },
            { "FLOOR(DATEDIFF(DAY , DogumTarixi ,GETDATE()) / 365.25)(BETWEEN)", DListAgeRange.SelectedValue }
        };

        if (DListBrotherSister.SelectedIndex != 0)
        {
            FilterDictionary.Add("IsBrotherSister", Convert.ToByte(DListBrotherSister.SelectedValue));
        }

        if (TxtFullname.Text.Length > 0)
        {
            FilterDictionary.Add("CONCAT(Soyad,' ',Ad,' ',Ata)(LIKE)", TxtFullname.Text);
        }

        int PageNum;
        int RowNumber = 3;

        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 || AdoptionPersonsResult.Dt == null)
        {
            Config.RedirectError();
            return;
        }

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

        LblCount.Text = string.Format("Tapılıb: {0} anket", 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;

        RptChilds.DataSource = AdoptionPersonsResult.Dt;
        RptChilds.DataBind();

        CheckControls();
    }