예제 #1
0
        private void ReloadDataSource()
        {
            DtSource = new DataTable();
            this.gridWebGrid.ClearDataSource();
            this.gridWebGrid.Columns.Clear();
            this.gridHelper = new GridHelperNew(this.gridWebGrid, this.DtSource);

            this._initialWebGrid();
            if (this._checkRequireFields())
            {
                int           startRow      = (this.gridHelper._pagerToolBar.PageCount - 1) * this.gridHelper._pagerToolBar.PageSize + 1;
                int           endRow        = this.gridHelper._pagerToolBar.RowCount;
                FacadeFactory facadeFactory = new FacadeFactory(base.DataProvider);
                object[]      dataSource    =
                    facadeFactory.CreateQueryTSInfoFacade().QueryTSInfo(
                        FormatHelper.CleanString(this.txtErrorCodeGroup.Text).ToUpper(),
                        FormatHelper.CleanString(this.txtErrorCode.Text).ToUpper(),
                        FormatHelper.CleanString(this.txtErrorCause.Text).ToUpper(),
                        FormatHelper.CleanString(this.txtErrorCauseGroup.Text).ToUpper(),
                        FormatHelper.CleanString(this.txtErrorLocation.Text).ToUpper(),
                        FormatHelper.CleanString(this.txtErrorDuty.Text).ToUpper(),
                        FormatHelper.CleanString(this.drpFinishSemimanuProductQuery.SelectedValue),
                        FormatHelper.CleanString(this.txtConditionItem.Text).ToUpper(),
                        FormatHelper.CleanString(this.txtConditionMo.Text).ToUpper(),
                        FormatHelper.CleanString(this.txtFromResource.Text).ToUpper(),
                        FormatHelper.CleanString(this.drpFirstClassQuery.SelectedValue),
                        FormatHelper.CleanString(this.drpSecondClassQuery.SelectedValue),
                        FormatHelper.CleanString(this.drpThirdClassQuery.SelectedValue),
                        FormatHelper.TODateInt(this.dateStartDateQuery.Text),
                        FormatHelper.TODateInt(this.dateEndDateQuery.Text),
                        this.rblSummaryTargetQuery.SelectedValue,
                        FormatHelper.CleanString(this.txtLotNo.Text).ToUpper(),
                        int.Parse(this.upDown.Control.Text),
                        FormatHelper.CleanString(this.txtErrorcomponentQuery.Text).ToUpper(),
                        startRow,
                        endRow);

                this.gridHelper.RefreshData();
                this._processOWC(dataSource);
            }
        }
예제 #2
0
 //导出事件
 private void ExportQueryEvent(object sender, EventArgs e)
 {
     if (chbRepairDetail.Checked)
     {
         //TODO ForSimone
         if (this._checkRequireFields())
         {
             FacadeFactory facadeFactory = new FacadeFactory(base.DataProvider);
             (e as WebQueryEventArgsNew).GridDataSource =
                 facadeFactory.CreateQueryTSInfoFacade().ExportQueryTSInfoList(
                     FormatHelper.CleanString(this.ECG).ToUpper(),
                     FormatHelper.CleanString(this.EC).ToUpper(),
                     FormatHelper.CleanString(this.ECS).ToUpper(),
                     FormatHelper.CleanString(this.ECSG).ToUpper(),
                     FormatHelper.CleanString(this.LOC).ToUpper(),
                     FormatHelper.CleanString(this.DUTY).ToUpper(),
                     FormatHelper.CleanString(this.MoCode).ToUpper(),
                     FormatHelper.CleanString(this.Errorcomponent).ToUpper(),
                     FormatHelper.CleanString(this.FirstClassGroup).ToUpper(),
                     FormatHelper.CleanString(this.SecondClassGroup).ToUpper(),
                     FormatHelper.CleanString(this.ThirdClassGroup).ToUpper(),
                     this.StartDate, this.EndDate,
                     this.SummaryTarget,
                     this.SummaryObject,
                     this.SummaryObject1,
                     FormatHelper.CleanString(this.ModelCode),
                     FormatHelper.CleanString(this.ItemCode).ToUpper(),
                     FormatHelper.CleanString(this.FrmResCodes).ToUpper(),
                     FormatHelper.CleanString(this.LotNo).ToUpper(),
                     (e as WebQueryEventArgsNew).StartRow,
                     (e as WebQueryEventArgsNew).EndRow);
         }
     }
     else
     {
         this.QueryEvent(sender, e);
     }
 }
예제 #3
0
        private void _helper_LoadGridDataSource(object sender, EventArgs e)
        {
            if (!_checkRequireFields())
            {
                return;
            }

            this.ViewState["ItemCode"] = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtItemCodeQuery.Text));
            this.ViewState["MoCode"]   = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMoCodeQuery.Text));

            FacadeFactory facadeFactory = new FacadeFactory(base.DataProvider);

            object[] dataSource = facadeFactory.CreateQueryTSInfoFacade().QueryTSLocECode(
                this.ViewState["ItemCode"].ToString(),
                this.ViewState["MoCode"].ToString(),
                FormatHelper.TODateInt(this.dateStartDateQuery.Text),
                FormatHelper.TODateInt(this.dateEndDateQuery.Text),
                1,
                int.MaxValue);

            //chart
            List <string> fixedColumnList = new List <string>();

            fixedColumnList.Add("ErrorLocation");

            if (dataSource == null || dataSource.Length <= 0)
            {
                this.gridWebGrid.Visible = false;
                this.columnChart.Visible = false;
                return;
            }
            NewReportDomainObject[] newReportDomainObject = new NewReportDomainObject[dataSource.Length];
            for (int i = 0; i < dataSource.Length; i++)
            {
                NewReportDomainObject domainObject = new NewReportDomainObject();
                domainObject.ErrorCause    = ((QDOTSInfo)dataSource[i]).ErrorCauseDesc;
                domainObject.ErrorLocation = ((QDOTSInfo)dataSource[i]).ErrorLocation;
                domainObject.Quantity      = ((QDOTSInfo)dataSource[i]).Quantity;
                newReportDomainObject[i]   = domainObject;
            }

            if (this.rblVisibleStyle.SelectedValue.ToUpper() == VisibleStyle.Pivot.ToUpper())
            {
                this.columnChart.Visible = false;

                List <ReportGridDim3Property> dim3PropertyList = new List <ReportGridDim3Property>();

                dim3PropertyList.Add(new ReportGridDim3Property("Quantity", "0", "SUM", "SUM", false));

                ReportGridHelper reportGridHelper = new ReportGridHelper(this.DataProvider, this.languageComponent1, this.gridWebGrid);
                reportGridHelper.DataSource                   = newReportDomainObject;
                reportGridHelper.Dim1PropertyList             = fixedColumnList;
                reportGridHelper.Dim3PropertyList             = dim3PropertyList;
                reportGridHelper.HasDim3PropertyNameRowColumn = true;
                reportGridHelper.ShowGrid();

                this.gridWebGrid.Columns[2].Header.Caption = languageComponent1.GetString("ErrorCauseDesc");
                this.gridWebGrid.Visible = true;
            }
            if (this.rblVisibleStyle.SelectedValue.ToUpper() == VisibleStyle.Chart.ToUpper())
            {
                this.gridWebGrid.Visible = false;

                //设置首页报表的大小
                if (ViewState["Width"] != null)
                {
                    columnChart.Width = int.Parse(ViewState["Width"].ToString());
                }

                if (ViewState["Height"] != null)
                {
                    columnChart.Height = int.Parse(ViewState["Height"].ToString());
                }
                //end

                DataTable dataTableColumn = new DataTable();
                dataTableColumn.Columns.Add("Names", typeof(System.String));
                dataTableColumn.Columns.Add(" ", typeof(System.Int32));
                for (int i = 0; i < newReportDomainObject.Length; i++)
                {
                    dataTableColumn.Rows.Add(new object[] { newReportDomainObject[i].ErrorLocation, newReportDomainObject[i].Quantity });
                }
                this.columnChart.DataType              = true;
                this.columnChart.YLabelFormatString    = "<DATA_VALUE:0.##>";
                this.columnChart.ChartTextFormatString = "<DATA_VALUE:0.##>";
                this.columnChart.ColumnDataSource      = dataTableColumn;
                this.columnChart.DataBindTable();
                this.columnChart.Visible = true;
            }
        }