Esempio n. 1
0
        //添加其它统计栏位
        private object[] AddOtherInfo(object[] dataSource)
        {
            if (dataSource != null && dataSource.Length > 0)
            {
                QDOTSInfo otherQDOTSInfo = new QDOTSInfo();
                string    OtherCode      = "其它";
                otherQDOTSInfo.ErrorCodeGroup  = OtherCode;
                otherQDOTSInfo.ErrorCode       = OtherCode;
                otherQDOTSInfo.ErrorCauseGroup = OtherCode;
                otherQDOTSInfo.ErrorCause      = OtherCode;
                otherQDOTSInfo.ErrorLocation   = OtherCode;
                otherQDOTSInfo.Duty            = OtherCode;
                otherQDOTSInfo.ErrorComponent  = OtherCode;
                otherQDOTSInfo.AllQuantity     = ((QDOTSInfo)dataSource[0]).AllQuantity;
                otherQDOTSInfo.Quantity        = otherQDOTSInfo.AllQuantity - (int)this.getMaxNum(dataSource);
                decimal percent = ((decimal)otherQDOTSInfo.Quantity) / ((decimal)otherQDOTSInfo.AllQuantity);
                otherQDOTSInfo.Percent = percent;

                object[] newDataSource = new object[dataSource.Length + 1];
                for (int i = 0; i < dataSource.Length; i++)
                {
                    newDataSource[i] = dataSource[i];
                }
                newDataSource[dataSource.Length] = otherQDOTSInfo;

                return(newDataSource);
            }
            return(dataSource);
        }
Esempio n. 2
0
        private void _helper_DomainObjectToExportRow(object sender, EventArgs e)
        {
            if ((e as DomainObjectToExportRowEventArgsNew).DomainObject != null)
            {
                //modified by jessie lee for CS0096, 2005/10/10
                QDOTSInfo obj = (e as DomainObjectToExportRowEventArgsNew).DomainObject as QDOTSInfo;

                ArrayList objList = new ArrayList();
                if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.ErrorCode.ToUpper())
                {
                    objList.Add(obj.ErrorCodeGroup);
                    objList.Add(obj.ErrorCodeGroupDesc);
                    objList.Add(obj.ErrorCode);
                    objList.Add(obj.ErrorCodeDesc);
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.ErrorCodeGroup.ToUpper())
                {
                    objList.Add(obj.ErrorCodeGroup);
                    objList.Add(obj.ErrorCodeGroupDesc);
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.ErrorCauseGroup.ToUpper())
                {
                    objList.Add(obj.ErrorCauseGroup);
                    objList.Add(obj.ErrorCauseGroupDesc);
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.ErrorCause.ToUpper())
                {
                    objList.Add(obj.ErrorCause);
                    objList.Add(obj.ErrorCauseDesc);
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.ErrorLocation.ToUpper())
                {
                    objList.Add(obj.ErrorLocation);
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.Duty.ToUpper())
                {
                    objList.Add(obj.Duty);
                    objList.Add(obj.DutyDesc);
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.Errorcomponent.ToUpper())
                {
                    objList.Add(obj.ErrorComponent);
                }

                objList.Add(obj.Quantity.ToString());
                objList.Add(obj.Percent.ToString(".##%"));

                (e as DomainObjectToExportRowEventArgsNew).ExportRow =
                    (string[])objList.ToArray(typeof(string));
            }
        }
Esempio n. 3
0
        private void _helper_DomainObjectToGridRow(object sender, EventArgs e)
        {
            if ((e as DomainObjectToGridRowEventArgsNew).DomainObject != null)
            {
                QDOTSInfo obj = (e as DomainObjectToGridRowEventArgsNew).DomainObject as QDOTSInfo;
                DataRow   row = DtSource.NewRow();
                if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.ErrorCode.ToUpper())
                {
                    row[TSInfoSummaryTarget.ErrorCodeGroup] = obj.ErrorCodeGroup;
                    row["ErrorCodeGroupDescription"]        = obj.ErrorCodeGroupDesc;
                    row[TSInfoSummaryTarget.ErrorCode]      = obj.ErrorCode;
                    row["ErrorCodeDescription"]             = obj.ErrorCodeDesc;
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.ErrorCodeGroup.ToUpper())
                {
                    row[TSInfoSummaryTarget.ErrorCodeGroup] = obj.ErrorCodeGroup;
                    row["ErrorCodeGroupDescription"]        = obj.ErrorCodeGroupDesc;
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.ErrorCauseGroup.ToUpper())
                {
                    row[TSInfoSummaryTarget.ErrorCauseGroup] = obj.ErrorCauseGroup;
                    row["ErrorCauseGroupDescription"]        = obj.ErrorCauseGroupDesc;
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.ErrorCause.ToUpper())
                {
                    row[TSInfoSummaryTarget.ErrorCause] = obj.ErrorCause;
                    row["ErrorCauseDescription"]        = obj.ErrorCauseDesc;
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.ErrorLocation.ToUpper())
                {
                    row[TSInfoSummaryTarget.ErrorLocation] = obj.ErrorLocation;
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.Duty.ToUpper())
                {
                    row[TSInfoSummaryTarget.Duty] = obj.Duty;
                    row["ErrorDutyDescription"]   = obj.DutyDesc;
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.Errorcomponent.ToUpper())
                {
                    row[TSInfoSummaryTarget.Errorcomponent] = obj.ErrorComponent;
                }

                row["TsInfoQuantity"] = obj.Quantity;
                row["Percent"]        = System.Decimal.Round(obj.Percent * 100, 2) + "%";
                row["List"]           = "";

                (e as DomainObjectToGridRowEventArgsNew).GridRow = row;
            }
        }
Esempio n. 4
0
        private void _helper_DomainObjectToGridRow(object sender, EventArgs e)
        {
            if ((e as DomainObjectToGridRowEventArgs).DomainObject != null)
            {
                QDOTSInfo obj = (e as DomainObjectToGridRowEventArgs).DomainObject as QDOTSInfo;

                ArrayList objList = new ArrayList();
                if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.ErrorCode.ToUpper())
                {
                    objList.Add(obj.ErrorCodeGroup);
                    objList.Add(obj.ErrorCodeGroupDesc);
                    objList.Add(obj.ErrorCode);
                    objList.Add(obj.ErrorCodeDesc);
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.ErrorCodeGroup.ToUpper())
                {
                    objList.Add(obj.ErrorCodeGroup);
                    objList.Add(obj.ErrorCodeGroupDesc);
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.ErrorCause.ToUpper())
                {
                    objList.Add(obj.ErrorCause);
                    objList.Add(obj.ErrorCauseDesc);
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.ErrorLocation.ToUpper())
                {
                    objList.Add(obj.ErrorLocation);
                }
                else if (this.rblSummaryTargetQuery.SelectedValue.ToUpper() == TSInfoSummaryTarget.Duty.ToUpper())
                {
                    objList.Add(obj.Duty);
                    objList.Add(obj.DutyDesc);
                }

                objList.Add(obj.Quantity);
                objList.Add(System.Decimal.Round(obj.Percent * 100, 2) + "%");

                (e as DomainObjectToGridRowEventArgs).GridRow =
                    new UltraGridRow(objList.ToArray());
            }
        }