Пример #1
0
        private static void ReadTable()
        {
            if (PLContact.bRead)
            {
                return;
            }
            uint          num           = 0;
            object        szValue       = new object();
            PCLawATLClass pcLawAtlClass = new PCLawATLClass();
            uint          createHandle  = pcLawAtlClass.TableGET_CreateHandle("Contact", 0, 0, 0U);

            pcLawAtlClass.TableGET_AddFilter(createHandle, "ContactStatus", "EQ", "0", 1);
            pcLawAtlClass.TableGET_AddDirective(createHandle, "FieldList", "ContactID|ContactFirstName|ContactMiddleName|ContactLastName|ContactCompany");
            while (pcLawAtlClass.TableGET_GetNextRecord(createHandle) == 0)
            {
                pcLawAtlClass.TableGET_RecordField_ValueString(createHandle, "ContactFirstName", "", ref szValue);
                string str1 = szValue.ToString().ToUpper().Trim();
                pcLawAtlClass.TableGET_RecordField_ValueString(createHandle, "ContactMiddleName", "", ref szValue);
                string str2 = szValue.ToString().ToUpper().Trim();
                pcLawAtlClass.TableGET_RecordField_ValueString(createHandle, "ContactLastName", "", ref szValue);
                string str3 = szValue.ToString().ToUpper().Trim();
                pcLawAtlClass.TableGET_RecordField_ValueString(createHandle, "ContactCompany", "", ref szValue);
                string str4 = szValue.ToString().ToUpper().Trim();
                string Key  = (str1 + str2 + str3 + str4).ToString().ToUpper().Trim();
                while (Key.IndexOf("  ") > 0)
                {
                    Key = Key.Replace("  ", " ");
                }
                if (!string.IsNullOrEmpty(Key))
                {
                    PLContact.AddMapNameKeytoPLID(Key, pcLawAtlClass.TableGET_RecordField_ValueI32(createHandle, "ContactID"));
                }
            }
            pcLawAtlClass.TableGET_CloseHandle(createHandle);
            num             = 0U;
            PLContact.bRead = true;
        }
Пример #2
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 empty = string.Empty;

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

            try
            {
                this.GetLink().TablePOST_Send(this.m_hndPOST, ref nProcessed, ref nExceptions);
            }
            catch (NullReferenceException ex)
            {
                str1    = ex.Data == null ? "" : ex.Data.ToString();
                str2    = ex.HelpLink == null ? "" : ex.HelpLink.ToString();
                str3    = ex.InnerException == null ? "" : ex.InnerException.ToString();
                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().TablePOST_Reset(this.m_hndPOST);
                return;
            }
            catch (AccessViolationException ex)
            {
                str1    = ex.Data == null ? "" : ex.Data.ToString();
                str2    = ex.HelpLink == null ? "" : ex.HelpLink.ToString();
                str3    = ex.InnerException == null ? "" : ex.InnerException.ToString();
                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().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();
                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().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();
                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().TablePOST_Reset(this.m_hndPOST);
                this.m_lCounter = 0;
                return;
            }
            while (this.GetLink().TablePOST_GetNextResult(this.m_hndPOST, ref vunIDCreated, ref nExceptionError, ref szExceptionErrorMsg, ref szExceptionSentData) == 0)
            {
                if (Convert.ToInt32(nExceptionError) <= 0)
                {
                    int int32 = Convert.ToInt32(vunIDCreated);
                    this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_ExternalID_1.sLinkName, empty, ref szValue);
                    if (!string.IsNullOrEmpty(szValue.ToString()))
                    {
                        PLContact.AddMapExtID1toPLID(szValue.ToString(), int32);
                    }
                    this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_ExternalID_2.sLinkName, empty, ref szValue);
                    if (!string.IsNullOrEmpty(szValue.ToString()))
                    {
                        PLContact.AddMapExtID2toPLID(szValue.ToString(), int32);
                    }
                    this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, "NameKey", empty, ref szValue);
                    if (!string.IsNullOrEmpty(szValue.ToString()))
                    {
                        PLContact.AddMapNameKeytoPLID(szValue.ToString(), int32);
                    }
                }
            }
            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);
                PLContact plContact = this;
                plContact.m_lSendErrorCount = plContact.m_lSendErrorCount + 1L;
            }
            this.GetLink().TablePOST_Reset(this.m_hndPOST);
            this.m_lCounter = 0;
            this.GetLink().SubField_CloseHandle(this.m_hndSubFld);
            this.m_hndSubFld = 0U;
        }