Ejemplo n.º 1
0
        private DataTable GetSPCModelList(LinkedList llCondition)
        {
            string sSite            = string.Empty;
            string sFab             = string.Empty;
            string sLineRawID       = string.Empty;
            string sLine            = string.Empty;
            string sAreaRawID       = string.Empty;
            string sArea            = string.Empty;
            string sEqpModel        = string.Empty;
            string sParamAlias      = string.Empty;
            string sParamTypeCd     = string.Empty;
            string sSPC_MODEL_LEVEL = string.Empty;

            DataTable dtresult = null;
            DataSet   dsData   = null;

            try
            {
                LinkedList llstCondition = new LinkedList();
                llstCondition.Add(Definition.CONDITION_KEY_CATEGORY, "SPC_ATT_MODEL_LEVEL");
                llstCondition.Add(Definition.CONDITION_KEY_USE_YN, "Y");
                //llstCondition.Add(Definition.CONDITION_KEY_DEFAULT_COL, "Y");

                DataSet ds = _ws.GetATTCodeData(llstCondition.GetSerialData());

                if (ds != null && ds.Tables[0].Rows[0]["CODE"].ToString().ToUpper() == "AREA")
                {
                    sSPC_MODEL_LEVEL = "AREA";
                }
                else
                {
                    sSPC_MODEL_LEVEL = "EQP MODEL";
                }

                if (llCondition[Definition.DynamicCondition_Search_key.SITE] != null &&
                    ((DataTable)llCondition[Definition.DynamicCondition_Search_key.SITE]).Rows.Count > 0)
                {
                    sSite =
                        ((DataTable)llCondition[Definition.DynamicCondition_Search_key.SITE]).Rows[0][Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString();
                }
                if (llCondition[Definition.DynamicCondition_Search_key.FAB] != null &&
                    ((DataTable)llCondition[Definition.DynamicCondition_Search_key.FAB]).Rows.Count > 0)
                {
                    sFab =
                        ((DataTable)llCondition[Definition.DynamicCondition_Search_key.FAB]).Rows[0][Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString();
                }
                if (llCondition[Definition.DynamicCondition_Search_key.LINE] != null &&
                    ((DataTable)llCondition[Definition.DynamicCondition_Search_key.LINE]).Rows.Count > 0)
                {
                    sLineRawID =
                        ((DataTable)llCondition[Definition.DynamicCondition_Search_key.LINE]).Rows[0][Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString();
                    sLine = ((DataTable)llCondition[Definition.DynamicCondition_Search_key.LINE]).Rows[0][Definition.CONDITION_SEARCH_KEY_DISPLAYDATA].ToString();
                }

                if (llCondition[Definition.DynamicCondition_Search_key.AREA] != null &&
                    ((DataTable)llCondition[Definition.DynamicCondition_Search_key.AREA]).Rows.Count > 0)
                {
                    sAreaRawID =
                        ((DataTable)llCondition[Definition.DynamicCondition_Search_key.AREA]).Rows[0][Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString();
                    sArea = ((DataTable)llCondition[Definition.DynamicCondition_Search_key.AREA]).Rows[0][Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString();
                }

                if (llCondition[Definition.DynamicCondition_Search_key.EQPMODEL] != null &&
                    ((DataTable)llCondition[Definition.DynamicCondition_Search_key.EQPMODEL]).Rows.Count > 0)
                {
                    sEqpModel =
                        ((DataTable)llCondition[Definition.DynamicCondition_Search_key.EQPMODEL]).Rows[0][Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString();
                }

                if (llCondition[Definition.DynamicCondition_Search_key.PARAM_ALIAS] != null &&
                    ((DataTable)llCondition[Definition.DynamicCondition_Search_key.PARAM_ALIAS]).Rows.Count > 0)
                {
                    sParamAlias =
                        ((DataTable)llCondition[Definition.DynamicCondition_Search_key.PARAM_ALIAS]).Rows[0][Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString();
                }

                if (llCondition[Definition.DynamicCondition_Search_key.PARAM_TYPE] != null &&
                    ((DataTable)llCondition[Definition.DynamicCondition_Search_key.PARAM_TYPE]).Rows.Count > 0)
                {
                    sParamTypeCd =
                        ((DataTable)llCondition[Definition.DynamicCondition_Search_key.PARAM_TYPE]).Rows[0][Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString();
                }

                if (string.IsNullOrEmpty(sLineRawID) || (sSPC_MODEL_LEVEL == "AREA" && string.IsNullOrEmpty(sAreaRawID)) || (sSPC_MODEL_LEVEL == "EQP MODEL" && string.IsNullOrEmpty(sEqpModel)) ||
                    string.IsNullOrEmpty(sParamAlias) || string.IsNullOrEmpty(sParamTypeCd))
                {
                    this.MsgClose();
                    MSGHandler.DisplayMessage(MSGType.Information, "SPC_INFO_SELECT_PARAM", null, null);
                    return(null);
                }

                if (!this.ApplyAuthory(this.bbtnList, sSite, sFab, sLine, sAreaRawID))
                {
                    return(null);
                }

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

                AsyncCallHandler ach = new AsyncCallHandler(EESProgressBar.AsyncCallManager);

                object objDataSet = ach.SendWait(_ws, "GetATTSPCModelList", new object[] { sLineRawID, sAreaRawID, sEqpModel, sParamAlias, sParamTypeCd, _bUseComma });

                EESProgressBar.CloseProgress(this);

                if (objDataSet != null)
                {
                    dsData   = (DataSet)objDataSet;
                    dtresult = MergeWithContextTable(dsData.Tables[BISTel.eSPC.Common.TABLE.CHART_VW_SPC], dsData.Tables[BISTel.eSPC.Common.TABLE.MODEL_CONTEXT_ATT_MST_SPC]);
                    this.controller.dtSPCModelList = dtresult;
                }
                else
                {
                    MSGHandler.DisplayMessage(MSGType.Warning, MSGHandler.GetMessage("INFORMATION_NODATA"));
                }
            }
            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);
                }
                //this.MsgClose();
                LogHandler.ExceptionLogWrite(Definition.APPLICATION_NAME, ex);
            }
            finally
            {
                EESProgressBar.CloseProgress(this);
            }
            return(dtresult);
        }
Ejemplo n.º 2
0
        public override void PageSearch(LinkedList llCondition)
        {
            try
            {
                if (llCondition[Definition.DynamicCondition_Search_key.SPCMODEL] == null ||
                    ((DataTable)llCondition[Definition.DynamicCondition_Search_key.SPCMODEL]).Rows.Count == 0)
                {
                    InitializePage();
                    return;
                }

                lastestCondition = llCondition;

                DataTable     spcmodels   = (DataTable)llCondition[Definition.DynamicCondition_Search_key.SPCMODEL];
                List <string> modelRawids = new List <string>();
                foreach (DataRow dr in spcmodels.Rows)
                {
                    modelRawids.Add(dr[Definition.CONDITION_SEARCH_KEY_VALUEDATA].ToString());
                }

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

                AsyncCallHandler ach = new AsyncCallHandler(EESProgressBar.AsyncCallManager);

                object objDataSet = ach.SendWait(_ws, "GetATTSPCModelsData", new object[] { modelRawids.ToArray(), _bUseComma });

                EESProgressBar.CloseProgress(this);

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

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

                spcModels = new Dictionary <string, BISTel.eSPC.Page.Common.SPCModel>();

                foreach (DataRow dr in _ds.Tables[BISTel.eSPC.Common.TABLE.MODEL_ATT_MST_SPC].Rows)
                {
                    BISTel.eSPC.Page.Common.SPCModel spcModel = new BISTel.eSPC.Page.Common.SPCModel
                    {
                        SPCModelRawID = dr[BISTel.eSPC.Common.COLUMN.RAWID].ToString(),
                        SPCModelName  = dr[BISTel.eSPC.Common.COLUMN.SPC_MODEL_NAME].ToString(),
                    };
                    spcModels.Add(spcModel.SPCModelRawID, spcModel);
                }

                foreach (var kvp in spcModels)
                {
                    DataRow[] drs = _ds.Tables[BISTel.eSPC.Common.TABLE.MODEL_CONFIG_ATT_MST_SPC].Select(BISTel.eSPC.Common.COLUMN.MODEL_RAWID + " = '" + kvp.Key + "'");
                    if (drs.Length == 0)
                    {
                        continue;
                    }

                    kvp.Value.SubModels = new List <BISTel.eSPC.Page.Common.SPCModel>();

                    foreach (DataRow dr in drs)
                    {
                        if (dr[BISTel.eSPC.Common.COLUMN.MAIN_YN].ToString().ToUpper() == "Y")
                        {
                            kvp.Value.ChartID     = dr[BISTel.eSPC.Common.COLUMN.RAWID].ToString();
                            kvp.Value.Version     = dr[BISTel.eSPC.Common.COLUMN.VERSION].ToString();
                            kvp.Value.IsMainModel = true;
                            continue;
                        }

                        BISTel.eSPC.Page.Common.SPCModel spcModel = new BISTel.eSPC.Page.Common.SPCModel
                        {
                            ChartID       = dr[BISTel.eSPC.Common.COLUMN.RAWID].ToString(),
                            SPCModelRawID = kvp.Value.SPCModelRawID,
                            SPCModelName  = kvp.Value.SPCModelName,
                            Version       = dr[BISTel.eSPC.Common.COLUMN.VERSION].ToString(),
                            IsMainModel   = false,
                            ParamType     = kvp.Value.ParamType
                        };
                        kvp.Value.SubModels.Add(spcModel);
                    }
                }


                if (DSUtil.GetResultInt(_ds) != 0)
                {
                    MSGHandler.DisplayMessage(MSGType.Error, DSUtil.GetResultMsg(_ds));
                    InitializePage();
                    return;
                }

                BindingSpread();
            }
            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);
                }
                LogHandler.ExceptionLogWrite(Definition.APPLICATION_NAME, ex);
            }
            finally
            {
                EESProgressBar.CloseProgress(this);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
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();
            }
        }
Ejemplo n.º 5
0
        private void ConfigListDataBinding(string _sSPCModelRawid)
        {
            try
            {
                LinkedList _llstSearchCondition = new LinkedList();
                DataSet    _dsSPCModeData       = new DataSet();

                string strParamAlias = "";
                //초기화
                _llstSearchCondition.Clear();
                _llstSearchCondition.Add(Definition.CONDITION_KEY_MODEL_RAWID, _sSPCModelRawid);


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

                AsyncCallHandler ach = new AsyncCallHandler(EESProgressBar.AsyncCallManager);

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

                EESProgressBar.CloseProgress(this);
                //

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

                if (!DSUtil.CheckRowCount(_dsSPCModeData, TABLE.MODEL_MST_SPC))
                {
                    MSGHandler.DisplayMessage(MSGType.Information, "SPC_INFO_MODEL_ELIMINATED", null, null);
                    return;
                }

                DataTable dtConfig  = _dsSPCModeData.Tables[TABLE.MODEL_CONFIG_MST_SPC];
                DataTable dtContext = _dsSPCModeData.Tables[TABLE.MODEL_CONTEXT_MST_SPC];
                DataTable dtRuleMst = _dsSPCModeData.Tables[TABLE.MODEL_RULE_MST_SPC];

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

                DataTable dtSPCModelChartList = new DataTable();

                dtSPCModelChartList.Columns.Add(COLUMN.SELECT, typeof(Boolean));
                dtSPCModelChartList.Columns.Add(COLUMN.CHART_ID);
                dtSPCModelChartList.Columns.Add(COLUMN.PARAM_ALIAS);
                dtSPCModelChartList.Columns.Add(COLUMN.MAIN_YN);
                dtSPCModelChartList.Columns.Add(COLUMN.VERSION);
                dtSPCModelChartList.Columns.Add("MODE");

                //CONTEXT COLUMN 생성
                DataRow[] drConfigs = dtConfig.Select(COLUMN.MAIN_YN + " = 'Y'", COLUMN.RAWID);

                if (drConfigs != null && drConfigs.Length > 0)
                {
                    DataRow[] drMainContexts = dtContext.Select(string.Format("{0} = '{1}'", COLUMN.MODEL_CONFIG_RAWID, drConfigs[0][COLUMN.RAWID]), COLUMN.KEY_ORDER);

                    foreach (DataRow drMainContext in drMainContexts)
                    {
                        dtSPCModelChartList.Columns.Add(drMainContext["CONTEXT_KEY_NAME"].ToString());
                    }
                }

                LinkedList llCondition = new LinkedList();
                llCondition.Add(Definition.CONDITION_KEY_CATEGORY, Definition.CODE_CATEGORY_CHART_MODE);
                DataSet _dsChartMode = this._ws.GetCodeData(llCondition.GetSerialData());

                Dictionary <string, string> modeCodeData = new Dictionary <string, string>();
                if (_dsChartMode != null && _dsChartMode.Tables.Count > 0)
                {
                    foreach (DataRow dr in _dsChartMode.Tables[0].Rows)
                    {
                        modeCodeData.Add(dr[COLUMN.CODE].ToString(), dr[COLUMN.NAME].ToString());
                    }
                }

                foreach (DataRow drConfig in dtConfig.Rows)
                {
                    DataRow drChartList = dtSPCModelChartList.NewRow();

                    drChartList[COLUMN.CHART_ID]    = drConfig[COLUMN.RAWID].ToString();
                    drChartList[COLUMN.PARAM_ALIAS] = drConfig[COLUMN.PARAM_ALIAS].ToString();
                    drChartList[COLUMN.MAIN_YN]     = drConfig[COLUMN.MAIN_YN].ToString();
                    //#Version이 Null 또는 Empty인 경우 대비 Check Logic 추가
                    if (!string.IsNullOrEmpty(drConfig[COLUMN.VERSION].ToString()))
                    {
                        drChartList[COLUMN.VERSION] = (1 + Convert.ToDouble(drConfig[COLUMN.VERSION].ToString()) / 100).ToString("N2");
                    }
                    string modeValue = drConfig[COLUMN.CHART_MODE_CD].ToString();
                    if (modeCodeData.ContainsKey(modeValue))
                    {
                        modeValue = modeCodeData[modeValue];
                    }
                    drChartList["MODE"] = modeValue;

                    if (strParamAlias == "")
                    {
                        strParamAlias = drConfig[COLUMN.PARAM_ALIAS].ToString();
                    }

                    DataRow[] drContexts = dtContext.Select(string.Format("{0} = '{1}'", COLUMN.MODEL_CONFIG_RAWID, drConfig[COLUMN.RAWID]));

                    foreach (DataRow drContext in drContexts)
                    {
                        //2009-11-27 bskwon 추가 : Sub Model 상속 구조가 아닌경우 예외처리
                        if (!dtSPCModelChartList.Columns.Contains(drContext["CONTEXT_KEY_NAME"].ToString()))
                        {
                            dtSPCModelChartList.Columns.Add(drContext["CONTEXT_KEY_NAME"].ToString());
                        }

                        drChartList[drContext["CONTEXT_KEY_NAME"].ToString()] = drContext[COLUMN.CONTEXT_VALUE].ToString();
                    }

                    dtSPCModelChartList.Rows.Add(drChartList);
                }

                dtSPCModelChartList.AcceptChanges();

                bsprData.ClearHead();
                bsprData.UseEdit      = true;
                bsprData.UseHeadColor = true;
                bsprData.Locked       = true;

                for (int i = 0; i < dtSPCModelChartList.Columns.Count; i++)
                {
                    string sColumn = dtSPCModelChartList.Columns[i].ColumnName.ToString();
                    if (i == 0)
                    {
                        this.bsprData.AddHead(i, sColumn, sColumn, 50, 20, null, null, null, ColumnAttribute.Null,
                                              ColumnType.CheckBox, null, null, null, false, true);
                    }
                    else
                    {
                        this.bsprData.AddHead(i, sColumn, sColumn, 100, 20, null, null, null, ColumnAttribute.Null,
                                              ColumnType.Null, null, null, null, false, true);
                    }
                }

                this.bsprData.AddHeadComplete();
                this.bsprData.DataSet = dtSPCModelChartList;

                this.bsprData.Locked = true;
                this.bsprData.ActiveSheet.Columns[0].Locked  = false;
                this.bsprData.ActiveSheet.Columns[2].Visible = false;



                this.bsprData.AllowNewRow = false;

                FarPoint.Win.Spread.CellType.TextCellType tc = new FarPoint.Win.Spread.CellType.TextCellType();
                tc.MaxLength = 1024;

                //Column Size 조절
                for (int cIdx = 0; cIdx < this.bsprData.ActiveSheet.Columns.Count; cIdx++)
                {
                    this.bsprData.ActiveSheet.Columns[cIdx].Width = this.bsprData.ActiveSheet.Columns[cIdx].GetPreferredWidth();

                    if (this.bsprData.ActiveSheet.Columns[cIdx].Width > 150)
                    {
                        this.bsprData.ActiveSheet.Columns[cIdx].Width = 150;
                    }

                    if (this.bsprData.ActiveSheet.Columns[cIdx].CellType != null &&
                        this.bsprData.ActiveSheet.Columns[cIdx].CellType.GetType() == typeof(FarPoint.Win.Spread.CellType.TextCellType))
                    {
                        this.bsprData.ActiveSheet.Columns[cIdx].CellType = tc;
                    }
                }

                //MAIN은 첫번째 ROW에 배치하고 ROW HIGHLIGHT
                if (this.bsprData.GetCellText(0, 3).Equals("Y"))
                {
                    this.bsprData.ActiveSheet.Rows[0].BackColor = Color.LightGreen; //Color.LemonChiffon;
                }

                this.bsprData.LeaveCellAction();
            }
            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);
                }
                LogHandler.ExceptionLogWrite(Definition.APPLICATION_NAME, ex);
            }
            finally
            {
                EESProgressBar.CloseProgress(this);
            }
        }
Ejemplo n.º 6
0
        private void CallDataTrxDataFirst(double dSearchPeriod)
        {
            DataSet              _ds            = null;
            DataTable            _dtChartData   = new DataTable();
            CreateChartDataTable _createChartDT = new CreateChartDataTable();

            try
            {
                LinkedList _llstSearchCondition = new LinkedList();
                _llstSearchCondition.Add(Definition.CONDITION_KEY_START_DTTS, CommonPageUtil.StartDate(this.bDtStart.Value.ToString(Definition.DATETIME_FORMAT)));
                _llstSearchCondition.Add(Definition.CONDITION_KEY_END_DTTS, CommonPageUtil.EndDate(this.bDtEnd.Value.ToString(Definition.DATETIME_FORMAT)));
                _llstSearchCondition.Add(Definition.CONDITION_KEY_MODEL_CONFIG_RAWID, ChartVariable.MODEL_CONFIG_RAWID);
                if (!string.IsNullOrEmpty(ChartVariable.CONTEXT_LIST))
                {
                    _llstSearchCondition.Add(Definition.CONDITION_KEY_CONTEXT_KEY_LIST, ChartVariable.CONTEXT_LIST);
                }

                //Cancle기능 추가
                EESProgressBar.ShowProgress(this, this._lang.GetMessage(Definition.LOADING_DATA), true);

                AsyncCallHandler ach = new AsyncCallHandler(EESProgressBar.AsyncCallManager);

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

                EESProgressBar.CloseProgress(this);

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

                ChartVariable.dateTimeStart = this.bDtStart.Value;
                ChartVariable.dateTimeEnd   = this.bDtEnd.Value;

                if (DataUtil.IsNullOrEmptyDataSet(_ds))
                {
                    DataSet DTTSTemp = _wsSPC.GetATTLastTRXDataDTTs(ChartVariable.MODEL_CONFIG_RAWID);

                    string temp = "";
                    foreach (DataRow dr in DTTSTemp.Tables[0].Rows)
                    {
                        temp = dr[0].ToString();
                    }

                    if (temp.Length != 0)
                    {
                        foreach (DataRow dr in DTTSTemp.Tables[0].Rows)
                        {
                            DateTime dt = (DateTime)dr[0];
                            this.bDtEnd.Value = dt;

                            if (!double.IsNaN(dSearchPeriod))
                            {
                                this.bDtStart.Value = dt.AddDays(dSearchPeriod);
                            }
                            else
                            {
                                this.bDtStart.Value = dt.AddDays(-7);
                            }
                        }
                        this.CallDataTrxData();
                    }
                    else
                    {
                        MSGHandler.DisplayMessage(MSGType.Warning, MSGHandler.GetMessage("INFORMATION_NODATA"));
                        return;
                    }
                }
                else
                {
                    this.MsgShow("Drawing Chart... Can't Cancel!!!");

                    _dtChartData = CommonPageUtil.CLOBnBLOBParsing(_ds, _llstSearchCondition, false);

                    if (!DataUtil.IsNullOrEmptyDataTable(_dtChartData))
                    {
                        _dtChartData = DataUtil.DataTableImportRow(_dtChartData.Select(null, Definition.CHART_COLUMN.TIME));
                        ChartVariable.DEFAULT_CHART     = _dtChartData.Rows[0][BISTel.eSPC.Common.COLUMN.DEFAULT_CHART_LIST].ToString();
                        ChartVariable.MAIN_YN           = _dtChartData.Rows[0][BISTel.eSPC.Common.COLUMN.MAIN_YN].ToString();
                        ChartVariable.complex_yn        = "Y";
                        ChartVariable.CHART_PARENT_MODE = BISTel.eSPC.Common.CHART_PARENT_MODE.SPC_CONTROL_CHART;
                        ChartVariable.dtResource        = _dtChartData;
                        _createChartDT.COMPLEX_YN       = ChartVariable.complex_yn;
                        ChartVariable.dtParamData       = _createChartDT.GetMakeDataTable(_dtChartData);
                        ChartVariable.lstRawColumn      = _createChartDT.lstRawColumn;
                        ChartVariable.lstDefaultChart.Clear();
                        ChartVariable.lstDefaultChart = CommonPageUtil.DefaultChartSplit(ChartVariable.DEFAULT_CHART);

                        List <string> rawIDs = new List <string>();
                        if (_dtChartData.Columns.Contains(Definition.CHART_COLUMN.OCAP_RAWID))
                        {
                            bool bPOcap  = _dtChartData.Columns.Contains(Definition.CHART_COLUMN.P_OCAP_LIST);
                            bool bPNOcap = _dtChartData.Columns.Contains(Definition.CHART_COLUMN.PN_OCAP_LIST);
                            bool bCOcap  = _dtChartData.Columns.Contains(Definition.CHART_COLUMN.C_OCAP_LIST);
                            bool bUOcap  = _dtChartData.Columns.Contains(Definition.CHART_COLUMN.U_OCAP_LIST);

                            foreach (DataRow dr in _dtChartData.Rows)
                            {
                                string rawid = dr[Definition.CHART_COLUMN.OCAP_RAWID].ToString();

                                string sTemp = rawid.Replace(";", "");

                                if (sTemp.Length > 0)
                                {
                                    string[] ids = rawid.Split(';');
                                    foreach (string id in ids)
                                    {
                                        if (string.IsNullOrEmpty(id))
                                        {
                                            continue;
                                        }
                                        if (!rawIDs.Contains(id))
                                        {
                                            rawIDs.Add(id);
                                        }
                                    }
                                }

                                if (bPOcap)
                                {
                                    rawid = dr[Definition.CHART_COLUMN.P_OCAP_LIST].ToString();

                                    sTemp = rawid.Replace("^", "").Replace(";", "");
                                    if (sTemp.Length > 0)
                                    {
                                        string[] ids = rawid.Replace(";", "^").Split('^');
                                        foreach (string id in ids)
                                        {
                                            if (string.IsNullOrEmpty(id))
                                            {
                                                continue;
                                            }
                                            if (!rawIDs.Contains(id))
                                            {
                                                rawIDs.Add(id);
                                            }
                                        }
                                    }
                                }

                                if (bPNOcap)
                                {
                                    rawid = dr[Definition.CHART_COLUMN.PN_OCAP_LIST].ToString();

                                    sTemp = rawid.Replace("^", "");
                                    if (sTemp.Length > 0)
                                    {
                                        string[] ids = rawid.Split('^');
                                        foreach (string id in ids)
                                        {
                                            if (string.IsNullOrEmpty(id))
                                            {
                                                continue;
                                            }
                                            if (!rawIDs.Contains(id))
                                            {
                                                rawIDs.Add(id);
                                            }
                                        }
                                    }
                                }

                                if (bCOcap)
                                {
                                    rawid = dr[Definition.CHART_COLUMN.C_OCAP_LIST].ToString();

                                    sTemp = rawid.Replace("^", "");
                                    if (sTemp.Length > 0)
                                    {
                                        string[] ids = rawid.Split('^');
                                        foreach (string id in ids)
                                        {
                                            if (string.IsNullOrEmpty(id))
                                            {
                                                continue;
                                            }
                                            if (!rawIDs.Contains(id))
                                            {
                                                rawIDs.Add(id);
                                            }
                                        }
                                    }
                                }

                                if (bUOcap)
                                {
                                    rawid = dr[Definition.CHART_COLUMN.U_OCAP_LIST].ToString();

                                    sTemp = rawid.Replace("^", "");
                                    if (sTemp.Length > 0)
                                    {
                                        string[] ids = rawid.Split('^');
                                        foreach (string id in ids)
                                        {
                                            if (string.IsNullOrEmpty(id))
                                            {
                                                continue;
                                            }
                                            if (!rawIDs.Contains(id))
                                            {
                                                rawIDs.Add(id);
                                            }
                                        }
                                    }
                                }
                            }
                            if (rawIDs.Count == 0)
                            {
                                rawIDs.Add("");
                            }

                            LinkedList llstTmpOcapComment = new LinkedList();
                            llstTmpOcapComment.Add(Definition.CONDITION_KEY_OOC_TRX_SPC_RAWID, rawIDs.ToArray());
                            llstTmpOcapComment.Add(Definition.CONDITION_KEY_START_DTTS, (this.bDtStart.Value.AddHours(-12)).ToString(Definition.DATETIME_FORMAT_MS));
                            llstTmpOcapComment.Add(Definition.CONDITION_KEY_END_DTTS, (this.bDtEnd.Value.AddHours(12)).ToString(Definition.DATETIME_FORMAT_MS));

                            byte[] baData = llstTmpOcapComment.GetSerialData();
                            _dsOcapComment       = _wsSPC.GetOCAPCommentList_New(baData);
                            ChartVariable.dtOCAP = _dsOcapComment.Tables[0];
                        }
                    }
                    this.pnlChart.Controls.Clear();
                    this.InitializeSPCChart();
                    this.MsgClose();
                }
            }
            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 (_createChartDT != null)
                {
                    _createChartDT = null;
                }
                if (_dtChartData != null)
                {
                    _dtChartData.Dispose();
                }
                if (_ds != null)
                {
                    _ds.Dispose();
                }
            }
        }