Esempio n. 1
0
        public bool IsInExport = false;         // Added by Icyer 2006/12/26 @ YHI	标识是否导出操作,如果是导出则不用计算总数

        public WebQueryHelperNew(
            HtmlInputButton queryButton,
            HtmlInputButton exportButton,
            WebDataGrid grid,
            PagerSizeSelector selector,
            PagerToolBar toolBar,
            ControlLibrary.Web.Language.LanguageComponent languageComponent,
            DataTable source)
        {
            dtSource = source;
            //variable
            this.cmdQuery           = queryButton;
            this.cmdGridExport      = exportButton;
            this.gridWebGrid        = grid;
            this.pagerSizeSelector  = selector;
            this.pagerToolBar       = toolBar;
            this.languageComponent1 = languageComponent;
            //export
            this.excelExporter      = new BenQGuru.eMES.Web.Helper.ExcelExporter();
            this.excelExporter.Page = this.gridWebGrid.Page;
            this.excelExporter.FormatExportRecordHandle  = new FormatExportRecordDelegate(this.FormatExportRecord);
            this.excelExporter.LoadExportDataHandle      = new LoadExportDataDelegate(this.LoadDataSource);
            this.excelExporter.LanguageComponent         = this.languageComponent1;
            this.excelExporter.GetColumnHeaderTextHandle = new GetColumnHeaderTextDelegate(GetColumnHeaderText);
            //register event
            if (this.cmdQuery != null)
            {
                this.cmdQuery.ServerClick += new EventHandler(cmdQuery_ServerClick);
            }
            if (this.cmdGridExport != null)
            {
                this.cmdGridExport.ServerClick += new EventHandler(cmdGridExport_ServerClick);
            }
            //if (this.gridWebGrid != null)
            //{
            //    this.gridWebGrid.ClickCellButton += new ClickCellButtonEventHandler(gridWebGrid_ClickCellButton);
            //}
            if (this.pagerToolBar != null)
            {
                this.pagerToolBar.OnPagerToolBarClick += new EventHandler(this.PagerToolBar_OnPagerToolBarClick);
            }
            if (this.pagerSizeSelector != null)
            {
                this.pagerSizeSelector.OnPagerSizeChanged += new BenQGuru.eMES.Web.Helper.PagerSizeSelector.PagerSizeChangedHandle(pagerSizeSelector_OnPagerSizeChanged);
            }
        }
Esempio n. 2
0
        //根据分页控件ID找到分页控件
        /// <summary>
        ///根据分页控件ID找到分页控件
        /// </summary>
        /// <param name="pagerToolBarID">分页控件ID</param>
        /// <param name="pagerSizeSelectorID">页数控件ID</param>
        public void FindPagerControls(string pagerToolBarID, string pagerSizeSelectorID)
        {
            System.Web.UI.Control ctrl;
            ctrl = this.Grid.Page.FindControl(pagerToolBarID);

            if (ctrl is PagerToolBar)
            {
                this._pagerToolBar = (PagerToolBar)ctrl;
            }

            ctrl = this.Grid.Page.FindControl(pagerSizeSelectorID);

            if (ctrl is PagerSizeSelector)
            {
                this._pagerSizeSelector = (PagerSizeSelector)ctrl;
            }
        }
Esempio n. 3
0
        public void FindControls()
        {
            System.Web.UI.Control ctrl = this.Grid.Page.FindControl("chbSelectAll");

            if (ctrl is System.Web.UI.WebControls.CheckBox)
            {
                this._chbSelectAll = (System.Web.UI.WebControls.CheckBox)ctrl;
            }

            ctrl = this.Grid.Page.FindControl("pagerToolBar");

            if (ctrl is PagerToolBar)
            {
                this._pagerToolBar = (PagerToolBar)ctrl;
            }

            ctrl = this.Grid.Page.FindControl("pagerSizeSelector");

            if (ctrl is PagerSizeSelector)
            {
                this._pagerSizeSelector = (PagerSizeSelector)ctrl;
            }
        }