Beispiel #1
0
        private DataSet GetResultDataSet(bool _pProb, string _pParamItem, string _pOperationID, ArrayList _arrInfo, ArrayList _arrSubData)
        {
            DataSet _dsResult = null;

            if (_pProb)
            {
                LinkedList _llstCol = new LinkedList();
                string     sCol     = string.Empty;
                string     sGroup   = string.Empty;
                for (int i = 0; i < this._arrSortingKey.Count; i++)
                {
                    if (this._arrSortingKey[i].ToString().Equals("SAMPLE"))
                    {
                        continue;
                    }
                    else if (this._arrSortingKey[i].ToString().Equals("WORKDATE"))
                    {
                        sCol   += "TO_CHAR(EVENT_DTTS,'yyyy-MM-dd') AS WORKDATE,";
                        sGroup += "TO_CHAR(EVENT_DTTS,'yyyy-MM-dd'),";
                    }
                    else
                    {
                        sCol   += this._arrSortingKey[i].ToString() + ",";
                        sGroup += this._arrSortingKey[i].ToString() + ",";
                    }
                }
                for (int i = 0; i < _arrInfo.Count; i++)
                {
                    sCol   += _arrInfo[i].ToString() + ",";
                    sGroup += _arrInfo[i].ToString() + ",";
                }

                for (int i = 0; i < _arrSubData.Count; i++)
                {
                    if (_arrSubData[i].ToString().Equals(Definition.CHART_COLUMN.USL) || _arrSubData[i].ToString().Equals(Definition.CHART_COLUMN.LSL))
                    {
                        sCol   += _arrSubData[i].ToString() + ",";
                        sGroup += _arrSubData[i].ToString() + ",";
                    }
                }

                if (!string.IsNullOrEmpty(sCol))
                {
                    sCol   = sCol.Substring(0, sCol.Length - 1);
                    sGroup = sGroup.Substring(0, sGroup.Length - 1);
                }

                this._llstData.Clear();
                this._llstData.Add(Definition.DynamicCondition_Condition_key.FAB, this._sFab);
                this._llstData.Add(Definition.DynamicCondition_Condition_key.START_DTTS, this._sStartTime);
                this._llstData.Add(Definition.DynamicCondition_Condition_key.END_DTTS, this._sEndTime);
                this._llstData.Add(Definition.DynamicCondition_Condition_key.PARAM, _pParamItem);
                this._llstData.Add(Definition.DynamicCondition_Condition_key.OPERATION_ID, _pOperationID);
                this._llstData.Add(Definition.DynamicCondition_Condition_key.COLUMN_LIST, sCol);
                this._llstData.Add(Definition.DynamicCondition_Condition_key.GROUP, sGroup);
                _dsResult = this._wsSPC.GetMultiData(this._llstData.GetSerialData());
            }
            else
            {
                string sModelConfigRawID = string.Empty;
                this._llstData.Clear();

                this._llstData.Add(Definition.DynamicCondition_Condition_key.LINE_RAWID, this._LineRawID);
                if (!string.IsNullOrEmpty(this._AreaRawID))
                {
                    this._llstData.Add(Definition.DynamicCondition_Condition_key.AREA_RAWID, this._AreaRawID);
                }

                if (!string.IsNullOrEmpty(this._EQPModel))
                {
                    this._llstData.Add(Definition.DynamicCondition_Condition_key.EQP_MODEL, this._EQPModel);
                }


                this._llstData.Add(Definition.DynamicCondition_Condition_key.PARAM_TYPE_CD, this._ParamType);
                this._llstData.Add(Definition.DynamicCondition_Condition_key.PARAM_ALIAS, _pParamItem);
                this._llstData.Add(Definition.DynamicCondition_Condition_key.OPERATION_ID, CommonPageUtil.GetConCatString(_pOperationID));
                DataSet ds = _wsSPC.GetSPCModelConfigSearch(_llstData.GetSerialData());
                if (!DataUtil.IsNullOrEmptyDataSet(ds))
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        sModelConfigRawID += ds.Tables[0].Rows[i][COLUMN.MODEL_CONFIG_RAWID].ToString() + ",";
                    }

                    if (ds != null)
                    {
                        ds.Dispose();
                    }
                    if (!string.IsNullOrEmpty(sModelConfigRawID))
                    {
                        sModelConfigRawID = sModelConfigRawID.Substring(0, sModelConfigRawID.Length - 1);
                    }
                }

                if (ds != null)
                {
                    ds.Dispose();
                }

                this._llstData.Clear();
                this._llstData.Add(Definition.DynamicCondition_Condition_key.START_DTTS, this._sStartTime);
                this._llstData.Add(Definition.DynamicCondition_Condition_key.END_DTTS, this._sEndTime);
                this._llstData.Add(Definition.DynamicCondition_Condition_key.MODEL_CONFIG_RAWID, sModelConfigRawID);
                _dsResult = this._wsSPC.GetSPCControlChartData(this._llstData.GetSerialData());
            }

            return(_dsResult);
        }
Beispiel #2
0
        private void ClickButtonChartView()
        {
            ArrayList alCheckRowIndex = _bSpreadUtil.GetCheckedRowIndex(this.bsprData, (int)enum_ProcessCapability.SPC_V_SELECT);

            if (alCheckRowIndex.Count < 1 || alCheckRowIndex.Count > 1)
            {
                MSGHandler.DisplayMessage(MSGType.Information, MSGHandler.GetMessage("FDC_ALLOW_SINGLE_SELECTED_ROW"));
                return;
            }

            int    iRowIndex           = (int)alCheckRowIndex[0];
            string strSPCModeName      = this.bsprData.ActiveSheet.Cells[iRowIndex, (int)enum_PpkUC.PARAM_ALIAS].Text;
            string strModelConfigRawID = this.bsprData.ActiveSheet.Cells[iRowIndex, (int)enum_PpkUC.MODEL_CONFIG_RAWID].Text;
            string strDefaultChart     = this.bsprData.ActiveSheet.Cells[iRowIndex, (int)enum_PpkUC.DEFAULT_CHART_LIST].Text;
            string strComplex_yn       = this.bsprData.ActiveSheet.Cells[iRowIndex, (int)enum_PpkUC.COMPLEX_YN].Text;
            string strParamAlias       = this.bsprData.ActiveSheet.Cells[iRowIndex, (int)enum_PpkUC.PARAM_ALIAS].Text;
            string strArea             = this.bsprData.ActiveSheet.Cells[iRowIndex, (int)enum_PpkUC.AREA].Text;
            string strOperation        = this.bsprData.ActiveSheet.Cells[iRowIndex, (int)enum_PpkUC.OPERATION_ID].Text;

            if (string.IsNullOrEmpty(strDefaultChart))
            {
                MSGHandler.DisplayMessage(MSGType.Information, string.Format(MSGHandler.GetMessage("GENERAL_NO_ITEM"), "Default Charts"));
                return;
            }

            StringBuilder sb = new StringBuilder();

            sb.AppendFormat(" ({0} ={1} OR {2} ={1})", Definition.DynamicCondition_Condition_key.OPERATION_ID, CommonPageUtil.GetConCatString(strOperation), Definition.DynamicCondition_Condition_key.MEASURE_OPERATION_ID);
            sb.AppendFormat(" AND {0} = {1}", Definition.DynamicCondition_Condition_key.PARAM_ALIAS, CommonPageUtil.GetConCatString(strParamAlias));

            for (int i = 1; i < this._sortHeader.Count; i++)
            {
                string sColumn = this._sortHeader[i].ToString();
                string sValue  = this.bsprData.ActiveSheet.Cells[iRowIndex, i].Text;
                if (sColumn == Definition.CHART_COLUMN.USL)
                {
                    if (string.IsNullOrEmpty(sValue))
                    {
                        sb.AppendFormat(" AND {0} IS NULL", Definition.CHART_COLUMN.MEAN_USL);
                    }
                    else
                    {
                        sb.AppendFormat(" AND {0} = {1}", Definition.CHART_COLUMN.MEAN_USL, CommonPageUtil.GetConCatString(sValue));
                    }
                }
                else if (sColumn == Definition.CHART_COLUMN.LSL)
                {
                    if (string.IsNullOrEmpty(sValue))
                    {
                        sb.AppendFormat(" AND {0} IS NULL", Definition.CHART_COLUMN.MEAN_LSL);
                    }
                    else
                    {
                        sb.AppendFormat(" AND {0} = {1}", Definition.CHART_COLUMN.MEAN_LSL, CommonPageUtil.GetConCatString(sValue));
                    }
                }
                else if (sColumn == Definition.CHART_COLUMN.PERIOD)
                {
                    sb.AppendFormat(" AND {0} = {1}", Definition.CHART_COLUMN.PERIOD, CommonPageUtil.GetConCatString(sValue));
                }
                if (this.arrSortingKey.Contains(sColumn))
                {
                    if (!string.IsNullOrEmpty(sValue))
                    {
                        sb.AppendFormat(" AND {0} = {1}", sColumn, CommonPageUtil.GetConCatString(sValue));
                    }
                }
            }


            DataTable dtParamData = DataUtil.DataTableImportRow(_dtResult.Select(sb.ToString()));

            if (DataUtil.IsNullOrEmptyDataTable(dtParamData))
            {
                MSGHandler.DisplayMessage(MSGType.Information, MSGHandler.GetMessage("INFORMATION_NODATA"));
                return;
            }

            CreateChartDataTable _chartData = new CreateChartDataTable();

            _chartData.COMPLEX_YN = strComplex_yn;
            dtParamData           = _chartData.GetPpkChkartMakeDataTable(dtParamData);

            ChartViewPopup chartViewPop = new ChartViewPopup();

            chartViewPop.ChartVariable.LINE               = _Line;
            chartViewPop.ChartVariable.AREA               = strArea;
            chartViewPop.ChartVariable.DEFAULT_CHART      = strDefaultChart;
            chartViewPop.ChartVariable.SPC_MODEL          = strSPCModeName;
            chartViewPop.ChartVariable.PARAM_ALIAS        = strSPCModeName;
            chartViewPop.ChartVariable.OPERATION_ID       = strOperation;
            chartViewPop.ChartVariable.PRODUCT_ID         = null;
            chartViewPop.ChartVariable.lstRawColumn       = _chartData.lstRawColumn;
            chartViewPop.ChartVariable.dtParamData        = dtParamData;
            chartViewPop.ChartVariable.complex_yn         = strComplex_yn;
            chartViewPop.ChartVariable.dateTimeStart      = DateTime.Parse(sStartTime);
            chartViewPop.ChartVariable.dateTimeEnd        = DateTime.Parse(sEndTime);
            chartViewPop.ChartVariable.MODEL_CONFIG_RAWID = strModelConfigRawID;
            chartViewPop.ChartVariable.MAIN_YN            = this.bsprData.ActiveSheet.Cells[iRowIndex, (int)enum_PpkUC.MAIN_YN].Text;
            chartViewPop.ChartVariable.CONTEXT_LIST       = sb.ToString();
            chartViewPop.ChartVariable.CHART_PARENT_MODE  = CHART_PARENT_MODE.PPK_REPORT;
            chartViewPop.URL         = this.URL;
            chartViewPop.SessionData = this.sessionData;
            chartViewPop.InitializePopup();
            DialogResult result = chartViewPop.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                dtParamData  = null;
                chartViewPop = null;
            }

            _chartData = null;
        }
Beispiel #3
0
        /// <summary>
        /// Create Chart DataSet
        /// </summary>
        /// <param name="_llstPopup"></param>
        /// <param name="strModelConfigRawID"></param>
        /// <returns></returns>
        private DataTable GetChartData(LinkedList _llstPopup, string strModelConfigRawID, int iRowIndex)
        {
            DataSet    _ds          = null;
            DataTable  _dtChartData = new DataTable();
            LinkedList _llstSearch  = new LinkedList();

            try
            {
                _llstDTSelectCondition.Clear();
                _llstDTSelectCondition.Add(Definition.CHART_COLUMN.OPERATION_ID, CommonPageUtil.GetConCatString(this.bsprData.ActiveSheet.Cells[iRowIndex, (int)BISTel.eSPC.Common.enum_OCAPLIST.OPERATION_ID].Text));
                _llstDTSelectCondition.Add(Definition.CHART_COLUMN.PRODUCT_ID, CommonPageUtil.GetConCatString(this.bsprData.ActiveSheet.Cells[iRowIndex, (int)BISTel.eSPC.Common.enum_OCAPLIST.PRODUCT_ID].Text));
                _llstDTSelectCondition.Add(Definition.CHART_COLUMN.PARAM_ALIAS, CommonPageUtil.GetConCatString(this.bsprData.ActiveSheet.Cells[iRowIndex, (int)BISTel.eSPC.Common.enum_OCAPLIST.PARAM_ALIAS].Text));
                _llstDTSelectCondition.Add(Definition.CHART_COLUMN.EQP_ID, CommonPageUtil.GetConCatString(this.bsprData.ActiveSheet.Cells[iRowIndex, (int)BISTel.eSPC.Common.enum_OCAPLIST.EQP_ID].Text));

                _llstSearch.Add(Definition.CONDITION_KEY_START_DTTS, _ComUtil.NVL(this._llstSearchCondition[Definition.CONDITION_KEY_START_DTTS]));
                _llstSearch.Add(Definition.CONDITION_KEY_END_DTTS, _ComUtil.NVL(this._llstSearchCondition[Definition.CONDITION_KEY_END_DTTS]));
                _llstSearch.Add(Definition.CONDITION_KEY_MODEL_CONFIG_RAWID, strModelConfigRawID);

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

                AsyncCallHandler ach = new AsyncCallHandler(EESProgressBar.AsyncCallManager);

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

                EESProgressBar.CloseProgress(this);

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

                if (!DataUtil.IsNullOrEmptyDataSet(_ds))
                {
                    this.MsgShow("Drawing Chart... Can't Cancel!!!");
                    _llstSearch.Clear();
                    _dtChartData = CommonPageUtil.CLOBnBLOBParsing(_ds, _llstSearch, false, false, false);
                }
            }
            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
            {
                if (_ds != null)
                {
                    _ds.Dispose();
                }
            }
            return(_dtChartData);
        }