public override void PageSearch(LinkedList llstCondition) { this._llstSearchCondition.Clear(); DataTable dt = null; DataSet _ds = null; if (llstCondition[Definition.DynamicCondition_Search_key.DATETIME_FROM] != null) { dt = (DataTable)llstCondition[Definition.DynamicCondition_Search_key.DATETIME_FROM]; sStartTime = CommonPageUtil.StartDate(dt.Rows[0][Definition.DynamicCondition_Condition_key.VALUEDATA].ToString()); } if (llstCondition[Definition.DynamicCondition_Search_key.DATETIME_TO] != null) { dt = (DataTable)llstCondition[Definition.DynamicCondition_Search_key.DATETIME_TO]; sEndTime = CommonPageUtil.EndDate(dt.Rows[0][Definition.DynamicCondition_Condition_key.VALUEDATA].ToString()); } if (llstCondition[Definition.DynamicCondition_Search_key.LINE] != null) { dt = (DataTable)llstCondition[Definition.DynamicCondition_Search_key.LINE]; _Line = DataUtil.GetDisplayData(dt); _LineRawID = DCUtil.GetValueData(dt); } if (llstCondition[Definition.DynamicCondition_Search_key.AREA] != null) { dt = (DataTable)llstCondition[Definition.DynamicCondition_Search_key.AREA]; _AreaRawID = DataUtil.GetConditionKeyDataList(dt, Definition.DynamicCondition_Condition_key.VALUEDATA); } if (llstCondition[Definition.DynamicCondition_Search_key.EQPMODEL] != null) { dt = (DataTable)llstCondition[Definition.DynamicCondition_Search_key.EQPMODEL]; _EQPModel = DataUtil.GetConditionKeyDataList(dt, Definition.DynamicCondition_Condition_key.VALUEDATA, true); } DataTable dtParameter = (DataTable)llstCondition[Definition.DynamicCondition_Search_key.PARAM]; this._sParamTypeCD = DCUtil.GetValueData((DataTable)llstCondition[Definition.DynamicCondition_Search_key.PARAM_TYPE]); this._sOperationID = DataUtil.GetConditionKeyDataList((DataTable)llstCondition[Definition.DynamicCondition_Search_key.OPERATION], Definition.DynamicCondition_Condition_key.VALUEDATA, true); this._sEQPID = DataUtil.GetConditionKeyDataList((DataTable)llstCondition[Definition.DynamicCondition_Search_key.EQP_ID], Definition.DynamicCondition_Condition_key.VALUEDATA, true); this._sProductID = DataUtil.GetConditionKeyDataList((DataTable)llstCondition[Definition.DynamicCondition_Search_key.PRODUCT], Definition.DynamicCondition_Condition_key.VALUEDATA, true); this._sPeriodPpk = DCUtil.GetValueData((DataTable)llstCondition[Definition.DynamicCondition_Search_key.PERIOD_PPK]); this.arrSortingKey = CommonPageUtil.GetConditionKeyDataListArr((DataTable)llstCondition[Definition.DynamicCondition_Search_key.SORTING_KEY], Definition.DynamicCondition_Condition_key.VALUEDATA); LinkedList _llstModelConfigRawID = new LinkedList(); arrModelCongifRawID.Clear(); string sParameter = DataUtil.GetConditionKeyDataList(dtParameter, Definition.DynamicCondition_Condition_key.VALUEDATA, true); _llstModelConfigRawID.Clear(); _llstModelConfigRawID.Add(Definition.DynamicCondition_Condition_key.LINE_RAWID, _LineRawID); if (!string.IsNullOrEmpty(_AreaRawID)) { _llstModelConfigRawID.Add(Definition.DynamicCondition_Condition_key.AREA_RAWID, _AreaRawID); } if (!string.IsNullOrEmpty(_EQPModel)) { _llstModelConfigRawID.Add(Definition.DynamicCondition_Condition_key.EQP_MODEL, _EQPModel); } _llstModelConfigRawID.Add(Definition.DynamicCondition_Condition_key.PARAM_TYPE_CD, _sParamTypeCD); if (!string.IsNullOrEmpty(sParameter) && sParameter.IndexOf(Definition.VARIABLE.STAR) < 0) { _llstModelConfigRawID.Add(Definition.DynamicCondition_Condition_key.PARAM_ALIAS, sParameter); } _llstModelConfigRawID.Add(Definition.DynamicCondition_Condition_key.MAIN_YN, "Y"); if (!string.IsNullOrEmpty(_sOperationID) && _sOperationID != "*") { _llstModelConfigRawID.Add(Definition.DynamicCondition_Condition_key.OPERATION_ID, _sOperationID); } //sub modeling 존재여부 확인 _ds = _wsSPC.GetSPCModelConfigSearch(_llstModelConfigRawID.GetSerialData()); if (!DataUtil.IsNullOrEmptyDataSet(_ds)) { for (int i = 0; i < _ds.Tables[0].Rows.Count; i++) { string strModelCongifRawID = _ds.Tables[0].Rows[i][Definition.DynamicCondition_Condition_key.MODEL_CONFIG_RAWID].ToString(); if (!arrModelCongifRawID.Contains(strModelCongifRawID)) { arrModelCongifRawID.Add(strModelCongifRawID); } } } if (arrModelCongifRawID.Count == 0) { MSGHandler.DisplayMessage(MSGType.Warning, MSGHandler.GetMessage("INFORMATION_NODATA")); return; } string sModelCongifRawid = CommonPageUtil.GetConditionKeyArrayList(arrModelCongifRawID); this._llstSearchCondition.Clear(); this._llstSearchCondition.Add(Definition.DynamicCondition_Condition_key.START_DTTS, sStartTime); this._llstSearchCondition.Add(Definition.DynamicCondition_Condition_key.END_DTTS, sEndTime); this._llstSearchCondition.Add(Definition.DynamicCondition_Condition_key.PERIOD_PPK, this._sPeriodPpk); this._llstSearchCondition.Add(Definition.DynamicCondition_Condition_key.MODEL_CONFIG_RAWID, sModelCongifRawid); if (this._sParamTypeCD.Equals("MET")) { _OperationColumnName = Definition.CHART_COLUMN.MEASURE_OPERATION_ID; } else { _OperationColumnName = Definition.CHART_COLUMN.OPERATION_ID; } PROC_DataBinding(); }
private void PROC_DataBinding() { DataSet ds = null; DataTableGroupBy dtGroupBy = null; string sFieldList = string.Empty; string sGroupBy = string.Empty; string sFilter = string.Empty; LinkedList _llstCol = new LinkedList(); DataRow nRow = null; DataTable dtResult = null; DataTable dtBasis = null; DataTable dtTarget = null; try { this.MsgShow(_lang.GetVariable("RMS_PROGRESS_SEARCH")); dtGroupBy = new DataTableGroupBy(); CreateChartDataTable _chartData = new CreateChartDataTable(); LinkedList _llstWhere = new LinkedList(); //Table 생성 dtResult = new DataTable(); CreateTable(dtResult); //기준Step string sParam = "'" + CommonPageUtil.GetConditionKeyArrayList(this._arrItem).Replace(",", "','") + "'"; DataSet dsBasis = GetResultDataSet(this._bProb, sParam, this._sOperation, this._arrInfo, this._arrSubData); if (!DataUtil.IsNullOrEmptyDataSet(dsBasis)) { if (!this._bProb) { _llstCol = GetQueryColumn(_bProb); if (this._arrSortingKey.Contains(Definition.CHART_COLUMN.MOCVDNAME)) { dtBasis = CommonPageUtil.CLOBnBLOBParsing(dsBasis, _llstWhere, false, true); } else { dtBasis = CommonPageUtil.CLOBnBLOBParsing(dsBasis, _llstWhere, false, false); } _llstCol.Clear(); for (int i = 0; i < this._arrSubData.Count; i++) { _llstCol.Add(this._arrSubData[i].ToString(), "1"); } dtBasis = _chartData.GetMakeDataTable(dtBasis, _llstCol); } else { dtBasis = dsBasis.Tables[0]; } } //Target if (!string.IsNullOrEmpty(_sTargetOperation)) { string sParamTarget = "'" + CommonPageUtil.GetConditionKeyArrayList(this._arrTargetItem).Replace(",", "','") + "'"; DataSet dsTarget = GetResultDataSet(this._bTartProb, sParamTarget, this._sTargetOperation, this._arrTargetInfo, this._arrTargetSubData); if (!DataUtil.IsNullOrEmptyDataSet(dsTarget)) { if (!this._bTartProb) { if (this._arrSortingKey.Contains(Definition.CHART_COLUMN.MOCVDNAME)) { dtTarget = CommonPageUtil.CLOBnBLOBParsing(dsTarget, _llstWhere, false, true); } else { dtTarget = CommonPageUtil.CLOBnBLOBParsing(dsTarget, _llstWhere, false, false); } _llstCol.Clear(); for (int i = 0; i < this._arrTargetSubData.Count; i++) { _llstCol.Add(this._arrTargetSubData[i].ToString(), "1"); } dtTarget = _chartData.GetMakeDataTable(dtTarget, _llstCol); } else { dtTarget = dsTarget.Tables[0]; } } } this.bSpread1.DataSource = null; if (!DataUtil.IsNullOrEmptyDataTable(dtBasis)) { this.MakeCrateTable(dtBasis, dtTarget, this._bProb, this._bTartProb, dtResult); } else { this.MsgClose(); MSGHandler.DisplayMessage(MSGType.Warning, MSGHandler.GetMessage("INFORMATION_NODATA")); } this.bSpread1.DataSource = dtResult; this.bSpread1.ActiveSheet.ColumnHeader.Cells[0, this._arrSortingKey.Count].Text = this._sOperationDesc; if (!string.IsNullOrEmpty(this._sTargetOperation)) { this.bSpread1.ActiveSheet.ColumnHeader.Cells[0, this.bSpread1.ActiveSheet.ColumnCount - (this._arrTargetItem.Count * this._arrTargetSubData.Count) - this._arrTargetInfo.Count].Text = this._sTargetOperationDesc; } } catch (Exception ex) { this.MsgClose(); LogHandler.ExceptionLogWrite(Definition.APPLICATION_NAME, ex); } finally { if (ds != null) { ds.Dispose(); } this.MsgClose(); } }