Exemplo n.º 1
0
        private void ClickButtonChartView()
        {
            if (string.IsNullOrEmpty(_ChartVariable.DEFAULT_CHART))
            {
                MSGHandler.DisplayMessage(MSGType.Information, string.Format(MSGHandler.GetMessage("GENERAL_NO_ITEM"), "Default Charts"));
                return;
            }

            if (_ChartVariable.dtResource == null)
            {
                MSGHandler.DisplayMessage(MSGType.Information, MSGHandler.GetMessage("INFORMATION_NODATA"));
                return;
            }

            ChartViewPopup chartViewPop = new ChartViewPopup();

            chartViewPop.ChartVariable = _ChartVariable;
            chartViewPop.URL           = this.URL;
            //SPC-1292, KBLEE, START
            chartViewPop.LINE_RAWID = this._lineRawid;
            chartViewPop.AREA_RAWID = this._areaRawid;
            chartViewPop.GROUP_NAME = this._llGroup[_ChartVariable.SPC_MODEL].ToString();
            //SPC-1292, KBLEE, END
            chartViewPop.SessionData = this.sessionData;
            chartViewPop.ParamTypeCD = "ATT";
            if (_dsOcapComment != null && _dsOcapComment.Tables.Count > 0)
            {
                chartViewPop.ChartVariable.dtOCAP = _dsOcapComment.Tables[0];
            }
            chartViewPop.InitializePopup();

            chartViewPop.linkTraceDataViewEventPopup -= new Common.ChartViewPopup.LinkTraceDataViewEventHandlerPopup(chartViewPop_linkTraceDataViewEventPopup);
            chartViewPop.linkTraceDataViewEventPopup += new Common.ChartViewPopup.LinkTraceDataViewEventHandlerPopup(chartViewPop_linkTraceDataViewEventPopup);

            DialogResult result = chartViewPop.ShowDialog(this);

            this._llGroup[_ChartVariable.SPC_MODEL] = chartViewPop.GROUP_NAME; //SPC-1292, KBLEE
            if (result == DialogResult.OK)
            {
            }
        }
Exemplo n.º 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;
        }