Exemple #1
0
        private static void ReadTable()
        {
            if (PLGBAcct.bRead)
            {
                return;
            }
            uint   num          = 0;
            object szValue      = new object();
            uint   createHandle = PLLink.GetLink().TableGET_CreateHandle("GeneralBankAcct", 0, 0, 0U);

            PLLink.GetLink().TableGET_AddFilter(createHandle, "GeneralBankAcctStatus", "EQ", "0", 1);
            while (PLLink.GetLink().TableGET_GetNextRecord(createHandle) == 0)
            {
                PLLink.GetLink().TableGET_RecordField_ValueString(createHandle, "GeneralBankAcctNickName", "", ref szValue);
                string Key = szValue.ToString().ToUpper().Trim();
                int    recordFieldValueI32 = PLLink.GetLink().TableGET_RecordField_ValueI32(createHandle, "GeneralBankAcctID");
                PLGBAcct.AddMapNNtoID(Key, recordFieldValueI32);
                PLGBAcct.AddMapIDtoNN(recordFieldValueI32, Key);
                PLLink.GetLink().TableGET_RecordField_ValueString(createHandle, "GeneralBankAcctPostRefNickName", "", ref szValue);
                string str1 = szValue.ToString().ToUpper().Trim();
                PLGBAcct.AddMapIDtoGLNN(recordFieldValueI32, str1);
                PLLink.GetLink().TableGET_RecordField_ValueString(createHandle, "GeneralBankAcctQuickBooksID", "", ref szValue);
                string str2 = szValue.ToString().ToUpper().Trim();
                if (!str2.Equals(""))
                {
                    PLGBAcct.AddMapPLIDtoQBID(recordFieldValueI32, str2);
                }
            }
            PLLink.GetLink().TableGET_CloseHandle(createHandle);
            num            = 0U;
            PLGBAcct.bRead = true;
        }
Exemple #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;
            string    str1      = "";
            PLGLAccts plglAccts = new PLGLAccts();

            this.GetLink().TablePOST_Send(this.m_hndPOST, ref nProcessed, ref nExceptions);
            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);
                    PLGBAcct.AddMapIDtoNN(int32, szValue.ToString());
                    PLGBAcct.AddMapNNtoID(szValue.ToString(), int32);
                    this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_GLNN.sLinkName, szDefault, ref szValue);
                    PLGBAcct.AddMapIDtoGLNN(int32, szValue.ToString());
                    this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_ExternalID_1.sLinkName, szDefault, ref szValue);
                    if (!szValue.ToString().Equals(""))
                    {
                        PLGBAcct.AddMapExtID1toPLID(szValue.ToString(), Convert.ToInt32(vunIDCreated));
                    }
                    this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_ExternalID_2.sLinkName, szDefault, ref szValue);
                    if (!szValue.ToString().Equals(""))
                    {
                        PLGBAcct.AddMapExtID2toPLID(szValue.ToString(), Convert.ToInt32(vunIDCreated));
                    }
                    this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, "GeneralBankAcctQuickBooksID", szDefault, ref szValue);
                    szValue = (object)szValue.ToString().ToUpper().Trim();
                    if (!szValue.Equals((object)""))
                    {
                        PLGBAcct.AddMapPLIDtoQBID(int32, szValue.ToString());
                        str1 = szValue.ToString();
                    }
                    this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, "GeneralBankAcctPostRefNickName", szDefault, ref szValue);
                    szValue = (object)szValue.ToString().ToUpper().Trim();
                    if (!szValue.Equals((object)""))
                    {
                        string str2 = szValue.ToString();
                        plglAccts.AddFilter(plglAccts.NickName_LinkName, PLXMLData.eFilterCompare.EQ, str2, 1);
                        while (plglAccts.GetNextRecord() == 0)
                        {
                            PLGLAccts.AddMapNNtoID(str2, plglAccts.ID);
                            PLGLAccts.AddMapIDtoNN(plglAccts.ID, str2);
                            plglAccts.ReadExisting((uint)plglAccts.ID);
                            if (str1 != "")
                            {
                                plglAccts.QuickBooksID = str1;
                                plglAccts.AddRecord();
                                plglAccts.SendLast();
                            }
                        }
                    }
                }
            }
            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);
                PLGBAcct plgbAcct = this;
                plgbAcct.m_lSendErrorCount = plgbAcct.m_lSendErrorCount + 1L;
            }
            this.GetLink().TablePOST_Reset(this.m_hndPOST);
            this.m_lCounter = 0;
        }