Beispiel #1
0
        private static void ReadTable()
        {
            if (PLVendor.bRead)
            {
                return;
            }
            uint   num          = 0;
            object szValue      = new object();
            string empty        = string.Empty;
            string szText       = "VendorID|VendorNickName|VendorQuickBooksID";
            uint   createHandle = PLLink.GetLink().TableGET_CreateHandle("Vendor", 0, 0, 0U);

            PLLink.GetLink().TableGET_AddFilter(createHandle, "VendorStatus", "EQ", "0", 1);
            PLLink.GetLink().TableGET_AddDirective(createHandle, "FieldList", szText);
            while (PLLink.GetLink().TableGET_GetNextRecord(createHandle) == 0)
            {
                PLLink.GetLink().TableGET_RecordField_ValueString(createHandle, "VendorNickName", "", ref szValue);
                string Key = szValue.ToString().ToUpper().Trim();
                int    recordFieldValueI32 = PLLink.GetLink().TableGET_RecordField_ValueI32(createHandle, "VendorID");
                PLVendor.AddMapIDtoNN(recordFieldValueI32, Key);
                PLVendor.AddMapNNtoID(Key, recordFieldValueI32);
                PLLink.GetLink().TableGET_RecordField_ValueString(createHandle, "VendorQuickBooksID", "", ref szValue);
                if (!szValue.ToString().ToUpper().Trim().Equals(""))
                {
                    PLVendor.AddMapIDtoQuickBooksID(recordFieldValueI32, szValue.ToString());
                }
            }
            PLLink.GetLink().TableGET_CloseHandle(createHandle);
            num            = 0U;
            PLVendor.bRead = true;
        }
Beispiel #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 szDefault           = "";

            this.m_lSendErrorCount = 0L;
            try
            {
                this.GetLink().TablePOST_Send(this.m_hndPOST, ref nProcessed, ref nExceptions);
            }
            catch (Exception ex)
            {
                string str1    = ex.Data == null ? "" : ex.Data.ToString();
                string str2    = ex.HelpLink == null ? "" : ex.HelpLink.ToString();
                string str3    = ex.InnerException == null ? "" : ex.InnerException.ToString();
                string message = ex.Message;
                string str4    = ex.Source == null ? "" : ex.Source.ToString();
                string str5    = ex.StackTrace == null ? "" : ex.StackTrace.ToString();
                string str6    = ex.TargetSite == (MethodBase)null ? "" : ex.TargetSite.ToString();
                this.GetLink().TablePOST_Reset(this.m_hndPOST);
                this.m_lCounter = 0;
                return;
            }
            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);
                PLVendor plVendor = this;
                plVendor.m_lSendErrorCount = plVendor.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)
                {
                    int int32 = Convert.ToInt32(vunIDCreated);
                    this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_NickName.sLinkName, szDefault, ref szValue);
                    PLVendor.AddMapNNtoID(szValue.ToString().ToUpper(), int32);
                    PLVendor.AddMapIDtoNN(int32, szValue.ToString().ToUpper());
                    this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_ExternalID_1.sLinkName, szDefault, ref szValue);
                    if (!szValue.ToString().Equals(""))
                    {
                        PLVendor.AddMapExtID1toPLID(szValue.ToString(), int32);
                    }
                    this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_ExternalID_2.sLinkName, szDefault, ref szValue);
                    if (!szValue.ToString().Equals(""))
                    {
                        PLVendor.AddMapExtID2toPLID(szValue.ToString(), int32);
                    }
                    this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, "NameKey", szDefault, ref szValue);
                    if (!szValue.ToString().Equals(""))
                    {
                        PLVendor.AddMapNameKeytoPLID(szValue.ToString().Trim(), int32);
                    }
                    this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_QuickBooksID.sLinkName, szDefault, ref szValue);
                    if (!szValue.ToString().Equals(""))
                    {
                        PLVendor.AddMapIDtoQuickBooksID(int32, szValue.ToString());
                    }
                }
            }
            this.GetLink().TablePOST_Reset(this.m_hndPOST);
            this.m_lCounter = 0;
        }