Exemple #1
0
        public List <string> CallRefCol(DataTable dtResourceData)
        {
            List <string>    lstRawCol   = new List <string>();
            DataTableGroupBy dtGroupBy   = new DataTableGroupBy();
            DataTable        dtParamList = null;
            string           sColumn     = string.Empty;

            if (COMPLEX_YN.Equals("Y") && dtResourceData.Columns.Contains(Definition.BLOB_FIELD_NAME.PARAM_LIST.ToUpper()))
            {
                sColumn     = Definition.BLOB_FIELD_NAME.PARAM_LIST.ToUpper();
                dtParamList = DataUtil.DataTableImportRow(dtResourceData.Select(null, sColumn + " desc"));
            }
            else
            {
                if (dtResourceData.Columns.Contains(Definition.BLOB_FIELD_NAME.REF_PARAM_LIST.ToUpper()))
                {
                    sColumn     = Definition.BLOB_FIELD_NAME.PARAM_LIST.ToUpper();
                    dtParamList = DataUtil.DataTableImportRow(dtResourceData.Select(null, sColumn + " desc"));
                }
            }

            if (DataUtil.IsNullOrEmptyDataTable(dtParamList))
            {
                return(lstRawCol);
            }
            for (int j = 0; j < dtParamList.Rows.Count; j++)
            {
                _strRawCol = dtParamList.Rows[j][sColumn].ToString();

                if (string.IsNullOrEmpty(_strRawCol))
                {
                    return(lstRawCol);
                }
                string[] arrRaw = _strRawCol.Split(';');
                for (int i = 0; i < arrRaw.Length; i++)
                {
                    if (string.IsNullOrEmpty(arrRaw[i].ToString()))
                    {
                        continue;
                    }
                    if (lstRawCol.Contains(arrRaw[i].ToString()))
                    {
                        continue;
                    }
                    else
                    {
                        lstRawCol.Add(arrRaw[i].ToString());
                    }
                }
            }
            return(lstRawCol);
        }
Exemple #2
0
        private void GetOCAPRawID()
        {
            if (ChartVariable.dtParamData == null)
            {
                return;
            }
            if (ChartVariable.dtParamData.Columns.Contains(Definition.CHART_COLUMN.OCAP_RAWID))
            {
                string _fieldList = Definition.CHART_COLUMN.OCAP_RAWID;
                string _groupby   = Definition.CHART_COLUMN.OCAP_RAWID;
                string _rowFilter = "ocap_rawid <>''";

                dtGroupBy = new DataTableGroupBy();
                DataTable dtOCAP = dtGroupBy.SelectGroupByInto("OCAP", ChartVariable.dtParamData, _fieldList, _rowFilter, _groupby);

                _llstChartSearchCondition.Clear();
                _llstChartSearchCondition.Add(Definition.DynamicCondition_Condition_key.OCAP_DATATABLE, dtOCAP);
                _dsOCAPValue = _wsSPC.GetOCAPDetails(_llstChartSearchCondition.GetSerialData());
            }
        }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="strCol"></param>
        /// <param name="strValue"></param>
        /// <param name="rowIndex"></param>
        /// <returns></returns>
        private string CreateToolTipString(string strCol, string strValue, int rowIndex, string strChartName)
        {
            StringBuilder sb = new StringBuilder();
            LinkedList    llstChartSeries = new LinkedList();

            string _sEQPID       = "-";
            string _sLOTID       = "-";
            string _sOperationID = "-";
            string _sSubstrateID = "-";
            string _sProductID   = "-";


            if (_dataManager.RawDataTable.Columns.Contains(Definition.CHART_COLUMN.EQP_ID))
            {
                _sEQPID = _dataManager.RawDataTable.Rows[rowIndex][Definition.CHART_COLUMN.EQP_ID].ToString();
            }

            if (_dataManager.RawDataTable.Columns.Contains(Definition.CHART_COLUMN.LOT_ID))
            {
                _sLOTID = _dataManager.RawDataTable.Rows[rowIndex][Definition.CHART_COLUMN.LOT_ID].ToString();
            }

            if (_dataManager.RawDataTable.Columns.Contains(Definition.CHART_COLUMN.OPERATION_ID))
            {
                _sOperationID = _dataManager.RawDataTable.Rows[rowIndex][Definition.CHART_COLUMN.OPERATION_ID].ToString();
            }

            if (_dataManager.RawDataTable.Columns.Contains(Definition.CHART_COLUMN.SUBSTRATE_ID))
            {
                _sSubstrateID = _dataManager.RawDataTable.Rows[rowIndex][Definition.CHART_COLUMN.SUBSTRATE_ID].ToString();
            }

            if (_dataManager.RawDataTable.Columns.Contains(Definition.CHART_COLUMN.PRODUCT_ID))
            {
                _sProductID = _dataManager.RawDataTable.Rows[rowIndex][Definition.CHART_COLUMN.PRODUCT_ID].ToString();
            }

            sb.AppendFormat("{0} : {1}\r\n", this._mlthandler.GetVariable(Definition.SPC_LABEL_ + Definition.CHART_COLUMN.PRODUCT_ID), _sProductID);
            sb.AppendFormat("{0} : {1}\r\n", this._mlthandler.GetVariable(Definition.SPC_LABEL_ + Definition.CHART_COLUMN.EQP_ID), _sEQPID);
            sb.AppendFormat("{0} : {1}\r\n", this._mlthandler.GetVariable(Definition.SPC_LABEL_ + Definition.CHART_COLUMN.LOT_ID), _sLOTID);
            sb.AppendFormat("{0} : {1}\r\n", this._mlthandler.GetVariable(Definition.SPC_LABEL_ + Definition.CHART_COLUMN.OPERATION_ID), _sOperationID);
            sb.AppendFormat("{0} : {1}\r\n", this._mlthandler.GetVariable(Definition.SPC_LABEL_ + Definition.CHART_COLUMN.SUBSTRATE_ID), _sSubstrateID);

            if (_dataManager.RawDataTable.Columns.Contains(strChartName))
            {
                llstChartSeries = CommonChart.GetChartSeries(strChartName, ChartVariable.lstRawColumn);
                for (int i = 0; i < llstChartSeries.Count; i++)
                {
                    string sKey   = llstChartSeries.GetKey(i).ToString();
                    string sValue = llstChartSeries.GetValue(i).ToString();

                    if (sValue.Equals(Definition.CHART_COLUMN.USL) ||
                        sValue.Equals(Definition.CHART_COLUMN.LSL) ||
                        sValue.Equals(Definition.CHART_COLUMN.UCL) ||
                        sValue.Equals(Definition.CHART_COLUMN.LCL) ||
                        sValue.Equals(Definition.CHART_COLUMN.TARGET))
                    {
                        continue;
                    }

                    if (_dataManager.RawDataTable.Columns.Contains(sKey))
                    {
                        sb.AppendFormat("{0} : {1}\r\n", this._mlthandler.GetVariable(sValue), _dataManager.RawDataTable.Rows[rowIndex][sKey].ToString());
                    }
                }
                llstChartSeries = null;
            }

            if (_dataManager.RawDataTable.Columns.Contains(Definition.CHART_COLUMN.OCAP_RAWID))
            {
                string    strRawid = GetOCAPRawID(_dataManager.RawDataTable, rowIndex);
                DataTable dtOCAP   = null;

                this.dtGroupBy = new DataTableGroupBy();
                if (!string.IsNullOrEmpty(strRawid))
                {
                    string _fieldList = "ocap_rawid,RAW_RULE";
                    string _groupby   = "ocap_rawid,RAW_RULE";
                    string _sRuleNo   = string.Empty;
                    if (string.IsNullOrEmpty(strRawid.Replace(";", "")))
                    {
                        return(sb.ToString());
                    }
                    if (ChartVariable.dtParamData.Columns.Contains(Definition.CHART_COLUMN.OCAP_RAWID))
                    {
                        string _rowFilter = string.Format("ocap_rawid ='{0}'", strRawid);
                        dtOCAP = this.dtGroupBy.SelectGroupByInto("OCAP", ChartVariable.dtParamData, _fieldList, _rowFilter, _groupby);
                        foreach (DataRow dr in dtOCAP.Rows)
                        {
                            if (!string.IsNullOrEmpty(_sRuleNo))
                            {
                                _sRuleNo += ",";
                            }
                            _sRuleNo += dr["RAW_RULE"].ToString().Replace(";", ",");
                        }
                        sb.AppendFormat("{0} : {1}\r\n", "OOC", _sRuleNo);
                    }
                }
                this.dtGroupBy = null;
                if (dtOCAP != null)
                {
                    dtOCAP.Dispose();
                }
            }

            return(sb.ToString());
        }
Exemple #4
0
        public static DataTable ParsingRaw(DataSet _ds, LinkedList _llstWhere, bool bDataParsing, bool includingToggleData)
        {
            ParseBLOB parseBlob    = null;
            ParseCLOB parseClob    = null;
            DataSet   _dsSelect    = null;
            DataTable dtResult     = new DataTable();
            bool      bResultTable = false;

            try
            {
                parseBlob = new ParseBLOB();
                parseClob = new ParseCLOB();
                _dsSelect = new DataSet();
                eSPCWebService.eSPCWebService _wsSPC = new WebServiceController <eSPCWebService.eSPCWebService>().Create();
                LinkedList _llstData     = new LinkedList();
                DataSet    dsContextType = _wsSPC.GetContextType(_llstData.GetSerialData());

                LinkedList       mllstContextType = SetContextType(dsContextType);
                DataTableGroupBy dtGroupBy        = null;


                for (int i = 0; i < _ds.Tables.Count; i++)
                {
                    string sTableName = _ds.Tables[i].TableName.ToString();
                    if (sTableName == Definition.TableName.USERNAME_DATA)
                    {
                        bResultTable = true;
                        _dsSelect    = parseBlob.DecompressDATA_TRX_DATA(_ds.Tables[i], _llstWhere, mllstContextType, bDataParsing, includingToggleData);
                        if (_dsSelect.Tables.Count > 0)
                        {
                            dtResult = _dsSelect.Tables[0].Copy();
                        }

                        _dsSelect.Dispose();
                        if (dtResult.Columns.Contains(COLUMN.FILE_DATA))
                        {
                            dtResult.Columns.Remove(COLUMN.FILE_DATA);
                        }
                    }
                    else if (sTableName == Definition.TableName.USERNAME_TEMPDATA)
                    {
                        _dsSelect = parseClob.DecompressData(_ds.Tables[i], _llstWhere, mllstContextType, bDataParsing, includingToggleData);
                        if (!DataUtil.IsNullOrEmptyDataSet(_dsSelect))
                        {
                            DataTable dt = _dsSelect.Tables[0];
                            if (bResultTable)
                            {
                                foreach (DataColumn dc in dt.Columns)
                                {
                                    if (dc.ColumnName.IndexOf(COLUMN.DATA_LIST) >= 0 || dc.ColumnName.IndexOf(COLUMN.CONTEXT_LIST) >= 0)
                                    {
                                        continue;
                                    }
                                    if (!dtResult.Columns.Contains(dc.ColumnName.ToString()))
                                    {
                                        dtResult.Columns.Add(dc.ColumnName.ToString(), dc.DataType);
                                    }
                                }

                                foreach (DataRow dr in dt.Rows)
                                {
                                    dtResult.ImportRow(dr);
                                }
                            }
                            else
                            {
                                dtResult.Merge(dt);
                                ArrayList arrTempColName = new ArrayList();
                                foreach (DataColumn dc in dtResult.Columns)
                                {
                                    if (dc.ColumnName.IndexOf(COLUMN.DATA_LIST) >= 0 || dc.ColumnName.IndexOf(COLUMN.CONTEXT_LIST) >= 0)
                                    {
                                        arrTempColName.Add(dc.ColumnName);
                                    }
                                }
                                if (arrTempColName.Count > 0)
                                {
                                    for (int iTmp = 0; iTmp < arrTempColName.Count; iTmp++)
                                    {
                                        dtResult.Columns.Remove(arrTempColName[iTmp].ToString());
                                    }
                                }
                                //if (dtResult.Columns.Contains(COLUMN.DATA_LIST)) dtResult.Columns.Remove(COLUMN.DATA_LIST);
                                //if (dtResult.Columns.Contains(COLUMN.CONTEXT_LIST)) dtResult.Columns.Remove(COLUMN.CONTEXT_LIST);
                            }
                        }
                        bResultTable = true;
                    }
                    else if (sTableName == Definition.TableName.USERNAME_SUMTEMPDATA)
                    {
                        _dsSelect = parseClob.DecompressDataRaw(_ds.Tables[i], _llstWhere, mllstContextType, bDataParsing);
                        if (!DataUtil.IsNullOrEmptyDataSet(_dsSelect))
                        {
                            DataTable dt = _dsSelect.Tables[0];
                            if (bResultTable)
                            {
                                foreach (DataColumn dc in dt.Columns)
                                {
                                    if (dc.ColumnName == COLUMN.DATA_LIST || dc.ColumnName == COLUMN.CONTEXT_LIST)
                                    {
                                        continue;
                                    }
                                    if (!dtResult.Columns.Contains(dc.ColumnName.ToString()))
                                    {
                                        dtResult.Columns.Add(dc.ColumnName.ToString(), dc.DataType);
                                    }
                                }

                                foreach (DataRow dr in dt.Rows)
                                {
                                    dtResult.ImportRow(dr);
                                }
                            }
                            else
                            {
                                dtResult.Merge(dt);
                                if (dtResult.Columns.Contains(COLUMN.DATA_LIST))
                                {
                                    dtResult.Columns.Remove(COLUMN.DATA_LIST);
                                }
                                if (dtResult.Columns.Contains(COLUMN.CONTEXT_LIST))
                                {
                                    dtResult.Columns.Remove(COLUMN.CONTEXT_LIST);
                                }
                            }
                        }
                    }
                }

                dtResult.Columns.Add(Definition.CHART_COLUMN.DTSOURCEID);
                for (int i = 0; i < dtResult.Rows.Count; i++)
                {
                    dtResult.Rows[i][Definition.CHART_COLUMN.DTSOURCEID] = i;
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                if (_ds != null)
                {
                    _ds.Dispose();
                }
                if (parseBlob != null)
                {
                    parseBlob = null;
                }
                if (parseClob != null)
                {
                    parseClob = null;
                }
                if (_dsSelect != null)
                {
                    _dsSelect.Dispose();
                }
            }

            return(dtResult);
        }