private void QueryEvent(object sender, EventArgs e) { int OQCBeginDate = FormatHelper.TODateInt(this.txtOQCBeginDate.Text); int OQCEndDate = FormatHelper.TODateInt(this.txtOQCEndDate.Text); int OQCBeginTime = FormatHelper.TOTimeInt(this.txtOQCBeginTime.Text); int OQCEndTime = FormatHelper.TOTimeInt(this.txtOQCEndTime.Text); BenQGuru.eMES.WebQuery.QueryFacade2 qfacade = new BenQGuru.eMES.WebQuery.QueryFacade2(base.DataProvider); object[] dataSource = qfacade.QueryOQCSDR( FormatHelper.CleanString(this.txtConditionModel.Text).ToUpper(), FormatHelper.CleanString(this.txtConditionItem.Text).ToUpper(), FormatHelper.CleanString(this.txtConditionMo.Text).ToUpper(), FormatHelper.CleanString(this.drpDateGroup.SelectedValue), FormatHelper.CleanString(this.txtSSCode.Text).ToUpper(), OQCBeginDate, OQCBeginTime, OQCEndDate, OQCEndTime); (e as WebQueryEventArgs).GridDataSource = dataSource; (e as WebQueryEventArgs).RowCount = 0; if ((e as WebQueryEventArgs).GridDataSource != null) { (e as WebQueryEventArgs).RowCount = (e as WebQueryEventArgs).GridDataSource.Length; } this._processOWC(dataSource); }
private void QueryEvent(object sender, EventArgs e) { int OQCBeginDate = FormatHelper.TODateInt(this.txtOQCBeginDate.Text); int OQCEndDate = FormatHelper.TODateInt(this.txtOQCEndDate.Text); int OQCBeginTime = FormatHelper.TOTimeInt(this.txtOQCBeginTime.Text); int OQCEndTime = FormatHelper.TOTimeInt(this.txtOQCEndTime.Text); BenQGuru.eMES.WebQuery.QueryFacade2 qfacade = new BenQGuru.eMES.WebQuery.QueryFacade2(base.DataProvider); object[] dataSource = qfacade.QueryOQCLRR( FormatHelper.CleanString(this.txtConditionModel.Text).ToUpper(), FormatHelper.CleanString(this.txtConditionItem.Text).ToUpper(), FormatHelper.CleanString(this.drpDateGroup.SelectedValue), OQCBeginDate, OQCBeginTime, OQCEndDate, OQCEndTime, this.drpType.SelectedValue.Trim().ToUpper()); (e as WebQueryEventArgs).GridDataSource = dataSource; (e as WebQueryEventArgs).RowCount = 0; if ((e as WebQueryEventArgs).GridDataSource != null) { (e as WebQueryEventArgs).RowCount = (e as WebQueryEventArgs).GridDataSource.Length; } this._processOWC(dataSource); // 汇总 decimal iLotTotalCount = 0, iLotRejectCount = 0, iLotSampleCount = 0, iLotSampleNGCount = 0; if (dataSource != null) { for (int i = 0; i < dataSource.Length; i++) { OQCLRR item = (OQCLRR)dataSource[i]; iLotTotalCount += item.LotTotalCount; iLotRejectCount += item.LotNGCount; iLotSampleCount += item.LotSampleCount; iLotSampleNGCount += item.LotSampleNGCount; } } this.lblLotTotalCountValue.Text = iLotTotalCount.ToString(); this.lblLotRejectCountValue.Text = iLotRejectCount.ToString(); this.lblLotSampleCountValue.Text = iLotSampleCount.ToString(); this.lblLotSampleNGCountValue.Text = iLotSampleNGCount.ToString(); if (iLotTotalCount != 0) { this.lblLRRValue.Text = Math.Round(iLotRejectCount / iLotTotalCount * 100, 2).ToString() + "%"; } else { this.lblLRRValue.Text = "0%"; } if (iLotSampleCount != 0) { this.lblDPPMValue.Text = Convert.ToInt32(iLotSampleNGCount / iLotSampleCount * 1000000).ToString(); } else { this.lblDPPMValue.Text = "0"; } }