Пример #1
0
        public ExecuteResult Execute()
        {
            ExecuteResult result = new ExecuteResult();

            try
            {
                CurrentLogViewModel.AppendLineToUI(String.Format((String)Application.Current.FindResource("InfoMessage_LotQueryToMes"), StripId), LogLevel.Info);

                EAPOutput output;

                LotQueryInput lotQueryInput = new LotQueryInput();

                lotQueryInput.EquipmentId = EquipmentId;
                lotQueryInput.StripId     = StripId;
                lotQueryInput.WaferId     = WaferId;
                lotQueryInput.LotId       = AoLotId;
                lotQueryInput.Source      = Source;


                output = MesMessage.Send <LotQueryInput>(lotQueryInput);


                result.TransactionId = lotQueryInput.TransactionId;

                if (!output.ErrCode.Equals("0"))
                {
                    String errorMessage = String.Empty;
                    Object langResource = Application.Current.TryFindResource("Language");

                    if (langResource != null && langResource.ToString().Equals("zh-CN"))
                    {
                        errorMessage = String.Format((String)Application.Current.FindResource("WariningMessage_LotQueryToMesReturnError"), output.ErrCode, output.CNErrMsg);
                    }
                    else
                    {
                        errorMessage = String.Format((String)Application.Current.FindResource("WariningMessage_LotQueryToMesReturnError"), output.ErrCode, output.ENErrMsg);
                    }

                    CurrentLogViewModel.AppendLineToUI(errorMessage, LogLevel.Warn);

                    result.ErrorCode = output.ErrCode.ToString();
                    result.ErrorText = String.Format((String)CommonParameter.EnLangResourceDictionary["WariningMessage_LotQueryToMesReturnError"], output.ErrCode, output.ENErrMsg);
                }
                else
                {
                    CurrentLogViewModel.AppendLineToUI((String)Application.Current.FindResource("InfoMessage_LotQueryToMesSuccess"), LogLevel.Info);
                    result.Data.Add("OutputMessage", output.OutputMessage);
                }
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex);
                CurrentLogViewModel.AppendLineToUI(String.Format((String)Application.Current.FindResource("ErrorMessage_LotQueryToMesUnknownError"), ex.Message), LogLevel.Error);
                result.ErrorCode = "1999";
                result.ErrorText = "[ATS] LotQuery to MES Unkown Error";
            }

            return(result);
        }