Esempio n. 1
0
        protected void LoadPages()
        {
            int nPageNumber = int.Parse(txtPageNumber.Text);
            int nPageSize   = int.Parse(txtPageSize.Text);

            int nTotalRecord = CheckEquipment_Data.Count(Session["EmployeeKey"].ToInt(), DDLSeeds.SelectedValue);

            if (nTotalRecord > nPageSize)
            {
                PageNumbers.Visible = true;
                DataTable nTable = TNLibrary.WEB.LoadDataToToolboxWeb.LoadPageSize(nPageSize, nTotalRecord, nPageNumber);

                PageNumbers.SelectedIndex = (nPageNumber - 1) - (int.Parse(nTable.Rows[0][0].ToString()) - 1);
                PageNumbers.DataSource    = nTable;
                PageNumbers.DataBind();
            }
            else
            {
                PageNumbers.Visible = false;
            }
        }
        protected void LoadPages()
        {
            int nPageNumber = int.Parse(txtPageNumber.Text);
            int nPageSize   = int.Parse(txtPageSize.Text);

            int nTotalRecord = Fertilizers_Cooperative_Data.Count(txtSearch.Text, int.Parse(Session["CooperativeKey"].ToString()));

            if (nTotalRecord > nPageSize)
            {
                PageNumbers.Visible = true;
                DataTable nTable = TNLibrary.WEB.LoadDataToToolboxWeb.LoadPageSize(nPageSize, nTotalRecord, nPageNumber);

                PageNumbers.SelectedIndex = (nPageNumber - 1) - (int.Parse(nTable.Rows[0][0].ToString()) - 1);
                PageNumbers.DataSource    = nTable;
                PageNumbers.DataBind();
            }
            else
            {
                PageNumbers.Visible = false;
            }
        }
Esempio n. 3
0
        protected void LoadPages()
        {
            int nPageNumber = int.Parse(txtPageNumber.Text);
            int nPageSize = int.Parse(txtPageSize.Text);

            int nTotalRecord = ForSale_Data.Count(Session["EmployeeKey"].ToInt());
            if (nTotalRecord > nPageSize * 5)
                nTotalRecord = nPageSize * 5;
            if (nTotalRecord > nPageSize)
            {
                PageNumbers.Visible = true;
                DataTable nTable = TNLibrary.WEB.LoadDataToToolboxWeb.LoadPageSize(nPageSize, nTotalRecord);

                PageNumbers.SelectedIndex = nPageNumber - 1;
                PageNumbers.DataSource = nTable;
                PageNumbers.DataBind();
            }
            else
                PageNumbers.Visible = false;

        }
Esempio n. 4
0
        protected void LoadPages()
        {
            int nPageNumber = int.Parse(txtPageNumber.Text);
            int nPageSize   = int.Parse(txtPageSize.Text);

            int nTotalRecord = District_Data.Count(txtSearch.Text, DDLProvincesCities.SelectedValue.ToInt());

            if (nTotalRecord > nPageSize)
            {
                PageNumbers.Visible = true;
                DataTable nTable = TNLibrary.WEB.LoadDataToToolboxWeb.LoadPageSize(nPageSize, nTotalRecord, nPageNumber);

                PageNumbers.SelectedIndex = (nPageNumber - 1) - (int.Parse(nTable.Rows[0][0].ToString()) - 1);
                PageNumbers.DataSource    = nTable;
                PageNumbers.DataBind();
            }
            else
            {
                PageNumbers.Visible = false;
            }
        }
        protected void LoadPages()
        {
            int nPageNumber = int.Parse(txtPageNumber.Text);
            int nPageSize   = int.Parse(txtPageSize.Text);

            int nTotalRecord = History_Data.Count2(key);

            if (nTotalRecord > nPageSize)
            {
                PageNumbers.Visible = true;
                DataTable nTable = TNLibrary.WEB.LoadDataToToolboxWeb.LoadPageSize(nPageSize, nTotalRecord, nPageNumber);

                PageNumbers.SelectedIndex = (nPageNumber - 1) - (int.Parse(nTable.Rows[0][0].ToString()) - 1);
                PageNumbers.DataSource    = nTable;
                PageNumbers.DataBind();
            }
            else
            {
                PageNumbers.Visible = false;
            }
        }
Esempio n. 6
0
        protected void LoadPages()
        {
            int nPageNumber             = int.Parse(txtPageNumber.Text);
            int nPageSize               = int.Parse(txtPageSize.Text);
            SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"];
            int nTotalRecord            = Users_Roles_Data.Count(nUserLogin.CooperativeVenturesKey, nUserLogin.GroupKey, txtSearch.Text);

            if (nTotalRecord > nPageSize)
            {
                PageNumbers.Visible = true;
                DataTable nTable = TNLibrary.WEB.LoadDataToToolboxWeb.LoadPageSize(nPageSize, nTotalRecord, nPageNumber);

                PageNumbers.SelectedIndex = (nPageNumber - 1) - (int.Parse(nTable.Rows[0][0].ToString()) - 1);
                PageNumbers.DataSource    = nTable;
                PageNumbers.DataBind();
            }
            else
            {
                PageNumbers.Visible = false;
            }
        }
Esempio n. 7
0
        public void Init(int total)
        {
            this.Total = total;
            int pages = (int)Math.Ceiling((double)total / _getPageSize());
            int count = PageNumbers.Count;

            if (pages < count)
            {
                for (int n = pages + 1; n <= count; n++)
                {
                    PageNumbers.Remove(n);
                }
            }
            else
            {
                for (int n = count + 1; n <= pages; n++)
                {
                    PageNumbers.Add(n);
                }
            }
            OnPropertyChanged(nameof(CanPageSub));
            OnPropertyChanged(nameof(CanPageAdd));
        }
Esempio n. 8
0
        /// <summary>
        /// Calculates the total pages.
        /// </summary>
        private void CalculateTotalPages(int currentPage)
        {
            if (itemcount == 0)
            {
                totalPages = 1;
            }
            else if (itemcount % itemPerPage == 0)
            {
                totalPages = (itemcount / itemPerPage);
            }
            else
            {
                totalPages = (itemcount / itemPerPage) + 1;
            }

            PageNumbers.Clear();

            int startPage = currentPage - 5;

            if (startPage <= 0)
            {
                startPage = 1;
            }
            int page = startPage;

addPages:
            PageNumbers.Add(new IntegerComboBoxModel {
                Name = page.ToString(Constants.DefaultCulture), Value = page
            });
            if (totalPages > page & page < (startPage + 9))
            {
                page++;
                goto addPages;
            }
            OnPropertyChanged("CurrentPage");
        }
Esempio n. 9
0
        public string GetDataLikeString()
        {
            string result = MangaId.ToString() + "|" + Name + "|" + PublishDate.GetDateTime() + "|" + PageNumbers.ToString() + "|" + Colorization.ToString();

            return(result);
        }