コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: H3317/Stock
        private void MenuItem_Click_2(object sender, System.Windows.Input.ExecutedRoutedEventArgs e)
        {
            var windowFlg = false;

            GetDataView getdataview = new GetDataView();

            foreach (Window m in Application.Current.Windows)
            {
                if (m is GetDataView)
                {
                    windowFlg              = true;
                    getdataview            = m as GetDataView;
                    getdataview.Visibility = System.Windows.Visibility.Visible;
                    getdataview.Show();
                    getdataview.Activate();
                    break;
                }
            }
            if (!windowFlg)
            {
                getdataview = new GetDataView();
                getdataview.Show();
            }
            //getdataview.Owner = this;
            getdataview.Show();
        }
コード例 #2
0
        //Repeater分页控制显示方法
        public void contrlRepeater()
        {
            //int wid = Convert.ToInt32(Request.QueryString["wid"].ToString().Trim());
            int groupId = 0;

            if (GetGroup.Text != "")
            {
                groupId = Convert.ToInt32(GetGroup.Text);
            }
            int cateId = 0;

            if (CategoryIdList.Text != "")
            {
                cateId = Convert.ToInt32(CategoryIdList.Text);
            }
            string          userid   = "1";
            DataTable       getTable = GetAllByValue(groupId, cateId, userid);
            DataTable       pageDt   = RepeirTable(getTable);
            PagedDataSource pds      = new PagedDataSource();

            pds.DataSource             = pageDt.DefaultView;
            pds.AllowPaging            = true;
            pds.PageSize               = 8;
            pds.CurrentPageIndex       = Convert.ToInt32(this.labPage.Text) - 1;
            GetDataView.DataSource     = pds;
            LabCountPage.Text          = pds.PageCount.ToString();
            labPage.Text               = (pds.CurrentPageIndex + 1).ToString();
            this.lbtnpritPage.Enabled  = true;
            this.lbtnFirstPage.Enabled = true;
            this.lbtnNextPage.Enabled  = true;
            this.lbtnDownPage.Enabled  = true;
            if (pds.CurrentPageIndex < 1)
            {
                this.lbtnpritPage.Enabled  = false;
                this.lbtnFirstPage.Enabled = false;
            }
            if (pds.CurrentPageIndex == pds.PageCount - 1)
            {
                this.lbtnNextPage.Enabled = false;
                this.lbtnDownPage.Enabled = false;
            }
            GetDataView.DataBind();
        }