Exemplo n.º 1
0
        private void _helper_DomainObjectToGridRow(object sender, EventArgs e)
        {
            if ((e as DomainObjectToGridRowEventArgs).DomainObject != null)
            {
                OQCLRR obj = (e as DomainObjectToGridRowEventArgs).DomainObject as OQCLRR;

                string LRR = "";
                if (obj.LRR == 0)
                {
                    LRR = "0%";
                }
                else
                {
                    LRR = obj.LRR.ToString("##.##%");
                }

                string DPPM = "";
                if (obj.DPPM == 0)
                {
                    DPPM = "0";
                }
                else
                {
                    DPPM = obj.DPPM.ToString();
                }

                string dataGroup = "";
                if (this.drpDateGroup.SelectedValue == "MDATE")
                {
                    dataGroup = FormatHelper.ToDateString(obj.DateGroup);
                }
                else if (this.drpDateGroup.SelectedValue == "WEEK")
                {
                    dataGroup = obj.DateGroup.ToString().Insert(4, "W");
                }
                else if (this.drpDateGroup.SelectedValue == "MONTH")
                {
                    dataGroup = obj.DateGroup.ToString().Insert(4, "M");
                }
                else
                {
                    dataGroup = FormatHelper.ToDateString(obj.DateGroup);
                }

                (e as DomainObjectToGridRowEventArgs).GridRow =
                    new UltraGridRow(new object[] {
                    dataGroup,
                    obj.ModelCode,
                    obj.LotTotalCount.ToString(),
                    obj.LotNGCount.ToString(),
                    obj.LotSize.ToString(),
                    obj.LotSampleCount.ToString(),
                    obj.LotSampleNGCount.ToString(),
                    LRR,
                    DPPM
                }
                                     );
            }
        }
Exemplo n.º 2
0
        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";
            }
        }