Beispiel #1
0
        public static string GetNNFromID(int nID)
        {
            string str;

            if (!nID.Equals(0))
            {
                if (!PLCustomTab.bRead)
                {
                    PLCustomTab.ReadTable();
                }
                str = PLCustomTab.m_MapIDtoNN == null ? "" : (PLCustomTab.m_MapIDtoNN.ContainsKey((object)nID) ? PLCustomTab.m_MapIDtoNN[(object)nID].ToString() : "");
            }
            else
            {
                str = "";
            }
            return(str);
        }
Beispiel #2
0
        public static int GetIDFromNN(string Key)
        {
            Key = Key.ToUpper();
            int num;

            if (!Key.Equals(""))
            {
                if (!PLCustomTab.bRead)
                {
                    PLCustomTab.ReadTable();
                }
                num = PLCustomTab.m_MapNNtoID == null ? 0 : (PLCustomTab.m_MapNNtoID.ContainsKey((object)Key) ? Convert.ToInt32(PLCustomTab.m_MapNNtoID[(object)Key]) : 0);
            }
            else
            {
                num = 0;
            }
            return(num);
        }
Beispiel #3
0
        public override void Send()
        {
            object nProcessed          = new object();
            object nExceptions         = new object();
            object vunIDCreated        = new object();
            object nExceptionError     = new object();
            object szExceptionErrorMsg = new object();
            object szExceptionSentData = new object();
            object szValue             = new object();
            string szDefault           = "";

            this.m_lSendErrorCount = 0L;
            string str1;
            string str2;
            string str3;
            string str4;
            string str5;
            string str6;

            try
            {
                this.GetLink().TablePOST_Send(this.m_hndPOST, ref nProcessed, ref nExceptions);
            }
            catch (AccessViolationException ex)
            {
                str1 = ex.Data == null ? "" : ex.Data.ToString();
                str2 = ex.HelpLink == null ? "" : ex.HelpLink.ToString();
                str3 = ex.InnerException == null ? "" : ex.InnerException.ToString();
                string message = ex.Message;
                str4 = ex.Source == null ? "" : ex.Source.ToString();
                str5 = ex.StackTrace == null ? "" : ex.StackTrace.ToString();
                str6 = ex.TargetSite == (MethodBase)null ? "" : ex.TargetSite.ToString();
                this.GetLink().LinkLog_AddLinkLogMessage("AccessViolationException Execption: " + message);
                this.GetLink().TablePOST_DumpExceptionsToLinkLog(this.m_hndPOST);
                this.GetLink().TablePOST_Reset(this.m_hndPOST);
                return;
            }
            catch (FormatException ex)
            {
                str1 = ex.Data == null ? "" : ex.Data.ToString();
                str2 = ex.HelpLink == null ? "" : ex.HelpLink.ToString();
                str3 = ex.InnerException == null ? "" : ex.InnerException.ToString();
                string message = ex.Message;
                str4 = ex.Source == null ? "" : ex.Source.ToString();
                str5 = ex.StackTrace == null ? "" : ex.StackTrace.ToString();
                str6 = ex.TargetSite == (MethodBase)null ? "" : ex.TargetSite.ToString();
                this.GetLink().LinkLog_AddLinkLogMessage("Format Execption: " + message);
                this.GetLink().TablePOST_DumpExceptionsToLinkLog(this.m_hndPOST);
                this.GetLink().TablePOST_Reset(this.m_hndPOST);
                return;
            }
            catch (Exception ex)
            {
                str1 = ex.Data == null ? "" : ex.Data.ToString();
                str2 = ex.HelpLink == null ? "" : ex.HelpLink.ToString();
                str3 = ex.InnerException == null ? "" : ex.InnerException.ToString();
                string message = ex.Message;
                str4 = ex.Source == null ? "" : ex.Source.ToString();
                str5 = ex.StackTrace == null ? "" : ex.StackTrace.ToString();
                str6 = ex.TargetSite == (MethodBase)null ? "" : ex.TargetSite.ToString();
                this.GetLink().LinkLog_AddLinkLogMessage("Catch All Execption: " + message);
                this.GetLink().TablePOST_DumpExceptionsToLinkLog(this.m_hndPOST);
                this.GetLink().TablePOST_Reset(this.m_hndPOST);
                this.m_lCounter = 0;
                return;
            }
            try
            {
                short int16_1 = Convert.ToInt16(nProcessed);
                short int16_2 = Convert.ToInt16(nExceptions);
                PLXMLData.m_lErrorCount += (long)int16_2;
                if (((int)int16_2 > 0 ? 1 : (this.m_lCounter != (int)int16_1 ? 1 : 0)) != 0)
                {
                    this.GetLink().TablePOST_DumpExceptionsToLinkLog(this.m_hndPOST);
                    PLCustomTab plCustomTab = this;
                    plCustomTab.m_lSendErrorCount = plCustomTab.m_lSendErrorCount + 1L;
                }
                while (this.GetLink().TablePOST_GetNextResult(this.m_hndPOST, ref vunIDCreated, ref nExceptionError, ref szExceptionErrorMsg, ref szExceptionSentData) == 0)
                {
                    if (Convert.ToInt32(nExceptionError) <= 0)
                    {
                        this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_ExternalID_1.sLinkName, szDefault, ref szValue);
                        PLCustomTab.AddMapExtID1toPLID(szValue.ToString(), Convert.ToInt32(vunIDCreated));
                        this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_ExternalID_2.sLinkName, szDefault, ref szValue);
                        PLCustomTab.AddMapExtID2toPLID(szValue.ToString(), Convert.ToInt32(vunIDCreated));
                    }
                }
                PLCustomTab.ClearMapIDtoNN();
                PLCustomTab.ClearMapNNtoID();
                PLCustomTab.bRead = false;
                PLCustomTab.ReadTable();
                this.GetLink().TablePOST_Reset(this.m_hndPOST);
                this.m_lCounter = 0;
            }
            catch (Exception ex)
            {
                str1 = ex.Data == null ? "" : ex.Data.ToString();
                str2 = ex.HelpLink == null ? "" : ex.HelpLink.ToString();
                str3 = ex.InnerException == null ? "" : ex.InnerException.ToString();
                string message = ex.Message;
                str4 = ex.Source == null ? "" : ex.Source.ToString();
                str5 = ex.StackTrace == null ? "" : ex.StackTrace.ToString();
                str6 = ex.TargetSite == (MethodBase)null ? "" : ex.TargetSite.ToString();
                this.GetLink().LinkLog_AddLinkLogMessage("Catch All Execption: " + message);
                this.GetLink().TablePOST_DumpExceptionsToLinkLog(this.m_hndPOST);
                this.GetLink().TablePOST_Reset(this.m_hndPOST);
                this.m_lCounter = 0;
            }
        }