Ejemplo n.º 1
0
        public static DataTable Parsing(DataSet _ds, LinkedList _llstWhere, bool bDataParsing, bool bMoCVD, 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);

                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(BISTel.eSPC.Common.COLUMN.FILE_DATA))
                        {
                            dtResult.Columns.Remove(BISTel.eSPC.Common.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.Contains(BISTel.eSPC.Common.COLUMN.DATA_LIST) || dc.ColumnName.Contains(BISTel.eSPC.Common.COLUMN.CONTEXT_LIST) || dc.ColumnName.Contains("NORMAL") || dc.ColumnName.Contains("ORIGINAL_PARAM"))
                                    {
                                        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(BISTel.eSPC.Common.COLUMN.DATA_LIST))
                                {
                                    dtResult.Columns.Remove(BISTel.eSPC.Common.COLUMN.DATA_LIST);
                                }
                                if (dtResult.Columns.Contains(BISTel.eSPC.Common.COLUMN.CONTEXT_LIST))
                                {
                                    dtResult.Columns.Remove(BISTel.eSPC.Common.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);
        }
Ejemplo n.º 2
0
        private void PROC_DataBinding()
        {
            this._bRemovedDuplicatedRow = false;
            ParseCLOB pclob = null;

            try
            {
                _dsOCAPList = new DataSet();

                EESProgressBar.ShowProgress(this, this._lang.GetMessage(Definition.LOADING_DATA), true);

                AsyncCallHandler ach = new AsyncCallHandler(EESProgressBar.AsyncCallManager);

                object objDataSet = ach.SendWait(_wsSPC, "GetATTOCAPList", new object[] { _llstSearchCondition.GetSerialData() });

                EESProgressBar.CloseProgress(this);

                this.bsprData.ActiveSheet.RowCount = 0;
                this.bsprData.DataSource           = null;

                //this.bsprData.ActiveSheet.FrozenColumnCount = 1;
                this.bsprData.ColFronzen = 1;

                if (objDataSet != null)
                {
                    _dsOCAPList = (DataSet)objDataSet;
                }
                else
                {
                    MSGHandler.DisplayMessage(MSGType.Warning, MSGHandler.GetMessage("INFORMATION_NODATA"));
                    return;
                }

                if (DataUtil.IsNullOrEmptyDataSet(_dsOCAPList))
                {
                    MSGHandler.DisplayMessage(MSGType.Warning, MSGHandler.GetMessage("INFORMATION_NODATA"));
                    return;
                }

                EESProgressBar.ShowProgress(this, MSGHandler.GetMessage("PROCESS_LOADING_PAGE_DATA"), false);

                pclob = new ParseCLOB();

                LinkedList _llstData = new LinkedList();
                _llstData.Add(Definition.DynamicCondition_Condition_key.USE_YN, "Y");
                DataSet    dsContextType    = _wsSPC.GetContextType(_llstData.GetSerialData());
                LinkedList mllstContextType = CommonPageUtil.SetContextType(dsContextType);

                _dsOCAPList = pclob.DecompressOCAPDataTRXData(_dsOCAPList.Tables[0], mllstContextType, false);

                string strTempWhere = "";
                if (this._sFilterEQPID.Length > 0)
                {
                    strTempWhere += string.Format(" EQP_ID = '{0}'", this._sFilterEQPID);
                }

                if (this._sFilterModuleID.Length > 0)
                {
                    if (strTempWhere.Length > 0)
                    {
                        strTempWhere += string.Format(" AND MODULE_ID = '{0}'", this._sFilterModuleID);
                    }
                    else
                    {
                        strTempWhere += string.Format(" MODULE_ID = '{0}'", this._sFilterModuleID);
                    }
                }

                if (this._sFilterLot.Length > 0)
                {
                    if (strTempWhere.Length > 0)
                    {
                        strTempWhere += string.Format(" AND LOT_ID = '{0}'", this._sFilterLot);
                    }
                    else
                    {
                        strTempWhere += string.Format(" LOT_ID = '{0}'", this._sFilterLot);
                    }
                }

                if (this._sFilterSubStrate.Length > 0)
                {
                    if (strTempWhere.Length > 0)
                    {
                        strTempWhere += string.Format(" AND SUBSTRATE_ID = '{0}'", this._sFilterSubStrate);
                    }
                    else
                    {
                        strTempWhere += string.Format(" SUBSTRATE_ID = '{0}'", this._sFilterSubStrate);
                    }
                }

                if (this._sFilterRecipe.Length > 0)
                {
                    if (strTempWhere.Length > 0)
                    {
                        strTempWhere += string.Format(" AND RECIPE_ID = '{0}'", this._sFilterRecipe);
                    }
                    else
                    {
                        strTempWhere += string.Format(" RECIPE_ID = '{0}'", this._sFilterRecipe);
                    }
                }

                if (strTempWhere.Length > 0)
                {
                    DataRow[] drs = _dsOCAPList.Tables[0].Select(strTempWhere);

                    DataSet _dsOCAPList_Filter = _dsOCAPList.Clone();
                    foreach (DataRow drTemp in drs)
                    {
                        _dsOCAPList_Filter.Tables[0].ImportRow(drTemp);
                    }

                    if (DataUtil.IsNullOrEmptyDataSet(_dsOCAPList_Filter))
                    {
                        this.MsgClose();
                        MSGHandler.DisplayMessage(MSGType.Warning, MSGHandler.GetMessage("INFORMATION_NODATA"));
                        return;
                    }

                    this.bsprData.DataSource = _dsOCAPList_Filter;
                }
                else
                {
                    this.bsprData.DataSource = _dsOCAPList;
                }
            }
            catch (Exception ex)
            {
                EESProgressBar.CloseProgress(this);

                if (ex is OperationCanceledException || ex is TimeoutException)
                {
                    MSGHandler.DisplayMessage(MSGType.Error, ex.Message, null, null, true);
                }
                else
                {
                    LogHandler.ExceptionLogWrite(Definition.APPLICATION_NAME, ex);
                    MSGHandler.DisplayMessage(MSGType.Error, ex.Message, null, null, true);
                }
            }
            finally
            {
                EESProgressBar.CloseProgress(this);
                this._dsOCAPList.Dispose();
            }
        }