private static void ReadTable() { if (!PLClient.m_bRead) { uint num = 0; object obj = new object(); if (PLClient.m_MapNameKeytoPLID == null) { PLClient.m_MapNameKeytoPLID = new Dictionary <string, int>(); } num = PLLink.GetLink().TableGET_CreateHandle("Client", 0, 0, 0); PLLink.GetLink().TableGET_AddFilter(num, "ClientStatus", "EQ", "0", 1); if (!PLClient.m_sFieldList.Equals("")) { PLLink.GetLink().TableGET_AddDirective(num, "FieldList", PLClient.m_sFieldList); } while (PLLink.GetLink().TableGET_GetNextRecord(num) == 0) { PLLink.GetLink().TableGET_RecordField_ValueString(num, "ClientNum", "", ref obj); string str = obj.ToString().ToUpper().Trim(); int num1 = PLLink.GetLink().TableGET_RecordField_ValueI32(num, "ClientID"); PLClient.AddMapIDtoNN(num1, str); PLClient.AddMapNNtoID(str, num1); int num2 = PLLink.GetLink().TableGET_RecordField_ValueI32(num, "ClientPersonContactID"); PLClient.AddMapNNtoContactID(str, num2); PLClient.AddMapClientIDtoContactID(num1, num2); PLClient.AddMapContactIDtoClientID(num2, num1); PLLink.GetLink().TableGET_RecordField_ValueString(num, "ClientFirstName", "", ref obj); string str1 = obj.ToString().ToUpper().Trim(); PLLink.GetLink().TableGET_RecordField_ValueString(num, "ClientInitial", "", ref obj); string str2 = obj.ToString().ToUpper().Trim(); PLLink.GetLink().TableGET_RecordField_ValueString(num, "ClientLastName", "", ref obj); string str3 = obj.ToString().ToUpper().Trim(); PLLink.GetLink().TableGET_RecordField_ValueString(num, "ClientCompany", "", ref obj); string str4 = obj.ToString().ToUpper().Trim(); string str5 = string.Concat(str1, str2, str3, str4); str5 = str5.ToUpper().Trim(); while (str5.IndexOf(" ") > 0) { str5 = str5.Replace(" ", " "); } PLClient.AddMapNameKeytoPLID(str5, num1); PLLink.GetLink().TableGET_RecordField_ValueString(num, "ClientQuickBooksID", "", ref obj); string str6 = obj.ToString().ToUpper().Trim(); if (!str6.Equals("")) { PLClient.AddMapPLIDtoQBID(num1, str6); } } PLLink.GetLink().TableGET_CloseHandle(num); num = 0; PLClient.m_bRead = true; } }
public override void Send() { string str; string str1; string str2; string message; string str3; string str4; string str5; FormatException formatException; object obj = new object(); object obj1 = new object(); object obj2 = new object(); object obj3 = new object(); object obj4 = new object(); object obj5 = new object(); object obj6 = new object(); short num = 0; short num1 = 0; string empty = string.Empty; string empty1 = string.Empty; string empty2 = string.Empty; int num2 = 0; int num3 = 0; this.m_lSendErrorCount = (long)0; try { base.GetLink().TablePOST_Send(this.m_hndPOST, ref obj, ref obj1); goto Label0; } catch (NullReferenceException nullReferenceException1) { NullReferenceException nullReferenceException = nullReferenceException1; str = (nullReferenceException.Data == null ? "" : nullReferenceException.Data.ToString()); str1 = (nullReferenceException.HelpLink == null ? "" : nullReferenceException.HelpLink.ToString()); str2 = (nullReferenceException.InnerException == null ? "" : nullReferenceException.InnerException.ToString()); message = nullReferenceException.Message; str3 = (nullReferenceException.Source == null ? "" : nullReferenceException.Source.ToString()); str4 = (nullReferenceException.StackTrace == null ? "" : nullReferenceException.StackTrace.ToString()); str5 = (nullReferenceException.TargetSite == null ? "" : nullReferenceException.TargetSite.ToString()); base.GetLink().LinkLog_AddLinkLogMessage(string.Concat("Clients, Null Ref Execption: ", message)); base.GetLink().TablePOST_DumpExceptionsToLinkLog(this.m_hndPOST); base.GetLink().TablePOST_Reset(this.m_hndPOST); } catch (AccessViolationException accessViolationException1) { AccessViolationException accessViolationException = accessViolationException1; str = (accessViolationException.Data == null ? "" : accessViolationException.Data.ToString()); str1 = (accessViolationException.HelpLink == null ? "" : accessViolationException.HelpLink.ToString()); str2 = (accessViolationException.InnerException == null ? "" : accessViolationException.InnerException.ToString()); message = accessViolationException.Message; str3 = (accessViolationException.Source == null ? "" : accessViolationException.Source.ToString()); str4 = (accessViolationException.StackTrace == null ? "" : accessViolationException.StackTrace.ToString()); str5 = (accessViolationException.TargetSite == null ? "" : accessViolationException.TargetSite.ToString()); base.GetLink().LinkLog_AddLinkLogMessage(string.Concat("Clients, Access Violation Execption: ", message)); base.GetLink().TablePOST_DumpExceptionsToLinkLog(this.m_hndPOST); base.GetLink().TablePOST_Reset(this.m_hndPOST); } catch (FormatException formatException1) { formatException = formatException1; str = (formatException.Data == null ? "" : formatException.Data.ToString()); str1 = (formatException.HelpLink == null ? "" : formatException.HelpLink.ToString()); str2 = (formatException.InnerException == null ? "" : formatException.InnerException.ToString()); message = formatException.Message; str3 = (formatException.Source == null ? "" : formatException.Source.ToString()); str4 = (formatException.StackTrace == null ? "" : formatException.StackTrace.ToString()); str5 = (formatException.TargetSite == null ? "" : formatException.TargetSite.ToString()); base.GetLink().LinkLog_AddLinkLogMessage(string.Concat("Clients, Format Execption: ", message)); base.GetLink().TablePOST_DumpExceptionsToLinkLog(this.m_hndPOST); base.GetLink().TablePOST_Reset(this.m_hndPOST); } catch (Exception exception1) { Exception exception = exception1; str = (exception.Data == null ? "" : exception.Data.ToString()); str1 = (exception.HelpLink == null ? "" : exception.HelpLink.ToString()); str2 = (exception.InnerException == null ? "" : exception.InnerException.ToString()); message = exception.Message; str3 = (exception.Source == null ? "" : exception.Source.ToString()); str4 = (exception.StackTrace == null ? "" : exception.StackTrace.ToString()); str5 = (exception.TargetSite == null ? "" : exception.TargetSite.ToString()); base.GetLink().LinkLog_AddLinkLogMessage(string.Concat("Clients, Catch All Execption: ", message)); base.GetLink().TablePOST_DumpExceptionsToLinkLog(this.m_hndPOST); base.GetLink().TablePOST_Reset(this.m_hndPOST); this.m_lCounter = 0; } return; Label0: try { num = Convert.ToInt16(obj); num1 = Convert.ToInt16(obj1); PLXMLData.m_lErrorCount = PLXMLData.m_lErrorCount + (long)num1; if ((num1 > 0 ? true : this.m_lCounter != num)) { base.GetLink().TablePOST_DumpExceptionsToLinkLog(this.m_hndPOST); PLClient mLSendErrorCount = this; mLSendErrorCount.m_lSendErrorCount = mLSendErrorCount.m_lSendErrorCount + (long)1; } while (base.GetLink().TablePOST_GetNextResult(this.m_hndPOST, ref obj2, ref obj3, ref obj4, ref obj5) == 0) { if (Convert.ToInt32(obj3) <= 0) { num3 = Convert.ToInt32(obj2); base.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_NickName.sLinkName, empty, ref obj6); empty1 = obj6.ToString(); PLClient.AddMapIDtoNN(num3, empty1); PLClient.AddMapNNtoID(empty1, num3); base.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_ExternalID_1.sLinkName, empty, ref obj6); if (!obj6.ToString().Equals("")) { PLClient.AddMapExtID1toPLID(obj6.ToString(), num3); } base.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_ExternalID_2.sLinkName, empty, ref obj6); if (!obj6.ToString().Equals("")) { PLClient.AddMapExtID2toPLID(obj6.ToString(), num3); } base.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, "NameKey", empty, ref obj6); if (!obj6.ToString().Equals("")) { PLClient.AddMapNameKeytoPLID(obj6.ToString(), num3); } base.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, "ClientPersonContactID", empty, ref obj6); if (StringManip.IsNumeric(obj6.ToString())) { num2 = StringManip.NullToInt(obj6); if (num2 != 0) { PLClient.AddMapNNtoContactID(empty1, num2); PLClient.AddMapClientIDtoContactID(num3, num2); PLClient.AddMapContactIDtoClientID(num2, num3); } } base.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, "ClientQuickBooksID", empty, ref obj6); empty2 = obj6.ToString().ToUpper().Trim(); if (!empty2.Equals("")) { PLClient.AddMapPLIDtoQBID(num3, empty2); } } } base.GetLink().TablePOST_Reset(this.m_hndPOST); this.m_lCounter = 0; base.GetLink().SubField_CloseHandle(this.m_hndSubFld); this.m_hndSubFld = 0; } catch (FormatException formatException2) { formatException = formatException2; str = (formatException.Data == null ? "" : formatException.Data.ToString()); str1 = (formatException.HelpLink == null ? "" : formatException.HelpLink.ToString()); str2 = (formatException.InnerException == null ? "" : formatException.InnerException.ToString()); message = formatException.Message; str3 = (formatException.Source == null ? "" : formatException.Source.ToString()); str4 = (formatException.StackTrace == null ? "" : formatException.StackTrace.ToString()); str5 = (formatException.TargetSite == null ? "" : formatException.TargetSite.ToString()); base.GetLink().LinkLog_AddLinkLogMessage(string.Concat("Clients Reading posted items, Catch All Execption: ", message)); base.GetLink().TablePOST_DumpExceptionsToLinkLog(this.m_hndPOST); this.m_lCounter = 0; return; } }