Пример #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);
        }