Ejemplo n.º 1
0
        private void _processDataSource(object sender, int inclusive, int exclusive, int pageSize)
        {
            WebQueryEventArgs args = new WebQueryEventArgs(inclusive, exclusive);

            this.LoadGridDataSource(sender, args);

            if (args.GridDataSource != null)
            {
                DomainObjectToGridRowEventArgs args1 = new DomainObjectToGridRowEventArgs();
                Infragistics.WebUI.UltraWebGrid.UltraGridRow lastRow = null;

                foreach (DomainObject obj in args.GridDataSource)
                {
                    args1.DomainObject = obj;
                    this.DomainObjectToGridRow(sender, args1);

                    if (args1.GridRow != null)
                    {
                        this.gridWebGrid.Rows.Add(this.buildMergedGridRow(args1.GridRow, lastRow));

                        lastRow = args1.GridRow;
                    }
                }
            }

            if (this.pagerSizeSelector != null)
            {
                this.pagerToolBar.PageSize = pageSize;
            }

            if (this.pagerToolBar != null)
            {
                this.pagerToolBar.RowCount = args.RowCount;
            }
        }
Ejemplo n.º 2
0
        protected object[] LoadDataSource(int start, int end)
        {
            WebQueryEventArgs args = new WebQueryEventArgs();

            args.StartRow = start;
            args.EndRow   = end;

            //this.LoadGridDataSource( this.excelExporter.Page,args );

            this.LoadGridDataSource(this.cmdGridExport, args);



            return(args.GridDataSource);
        }
Ejemplo n.º 3
0
        private void WebQueryHelper_LoadGridDataSource(object sender, EventArgs e)
        {
            QueryFacade1 queryFacade1 = new QueryFacade1(this.DataProvider);

            WebQueryEventArgs args = (WebQueryEventArgs)e;

            FacadeFactory facadeFactory = new FacadeFactory(base.DataProvider);

            args.RowCount = queryFacade1.QueryAchievingRateCount(
                FormatHelper.TODateInt(this.datStartDateQuery.Date_DateTime),
                FormatHelper.TODateInt(this.datEndDateQuery.Date_DateTime),
                this.txtBigSSCodeQuery.Text,
                this.txtMOCodeQuery.Text,
                this.txtItemCodeQuery.Text,
                this.txtMaterialModelCodeQuery.Text,
                this.ddlGoodSemiGoodQuery.SelectedValue);

            args.GridDataSource = queryFacade1.QueryAchievingRate(
                FormatHelper.TODateInt(this.datStartDateQuery.Date_DateTime),
                FormatHelper.TODateInt(this.datEndDateQuery.Date_DateTime),
                this.txtBigSSCodeQuery.Text,
                this.txtMOCodeQuery.Text,
                this.txtItemCodeQuery.Text,
                this.txtMaterialModelCodeQuery.Text,
                this.ddlGoodSemiGoodQuery.SelectedValue,
                args.StartRow,
                args.EndRow);

            ProcessOWC(queryFacade1.QueryAchievingRate(
                           FormatHelper.TODateInt(this.datStartDateQuery.Date_DateTime),
                           FormatHelper.TODateInt(this.datEndDateQuery.Date_DateTime),
                           this.txtBigSSCodeQuery.Text,
                           this.txtMOCodeQuery.Text,
                           this.txtItemCodeQuery.Text,
                           this.txtMaterialModelCodeQuery.Text,
                           this.ddlGoodSemiGoodQuery.SelectedValue,
                           int.MinValue,
                           int.MaxValue));
        }
Ejemplo n.º 4
0
        private void _helper_LoadGridDataSource(object sender, EventArgs e)
        {
            PageCheckManager manager = new PageCheckManager();

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1);
                return;
            }

            BenQGuru.eMES.Common.Domain.IDomainDataProvider provider = null;
            try
            {
                provider = base.DataProvider;

                WebQueryEventArgs we = e as WebQueryEventArgs;

                string shift;
                if (drpShift.SelectedValue == null)
                {
                    shift = string.Empty;
                }
                else
                {
                    shift = drpShift.SelectedValue.ToString();
                }

                if (shift == string.Empty)
                {
                    string[] shiftArray = new string[drpShift.Items.Count];
                    for (int i = 0; i < shiftArray.Length; i++)
                    {
                        shiftArray[i] = drpShift.Items[i].Value;
                    }
                    shift = FormatHelper.ProcessQueryValues(shiftArray);
                }
                else
                {
                    shift = FormatHelper.ProcessQueryValues(drpShift.SelectedValue);
                }
                object[] dataSource = QueryFirstOnlineWeb(provider,
                                                          this.txtDate.Text,
                                                          this.txtDateTo.Text,
                                                          shift,
                                                          this.txtSS.Text.Trim(),
                                                          this.txtItemCode.Text.Trim(),
                                                          txtModel.Text.Trim(),
                                                          this.drpSegment.SelectedValue,
                                                          we.StartRow,
                                                          we.EndRow);

                we.GridDataSource = dataSource;

                we.RowCount = QueryFirstOnlineWebCount(provider,
                                                       this.txtDate.Text,
                                                       this.txtDateTo.Text,
                                                       shift,
                                                       this.txtSS.Text.Trim(),
                                                       this.txtItemCode.Text.Trim(),
                                                       txtModel.Text.Trim(),
                                                       this.drpSegment.SelectedValue);
            }
            finally
            {
                if (provider != null)
                {
                    ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)provider).PersistBroker.CloseConnection();
                }
            }
        }