public static int GetIDFromNN(string Key) { int num; Key = Key.ToUpper(); if (!string.IsNullOrEmpty(Key)) { if (!PLClient.m_bRead) { PLClient.ReadTable(); } if (PLClient.m_MapNNtoID != null) { num = (PLClient.m_MapNNtoID.ContainsKey(Key) ? Convert.ToInt32(PLClient.m_MapNNtoID[Key]) : 0); } else { num = 0; } } else { num = 0; } return(num); }
public static string GetQBIDFromPLID(int nID) { string str; if (!nID.Equals(0)) { if (!PLClient.m_bRead) { PLClient.ReadTable(); } if (PLClient.m_MapPLIDtoQBID != null) { str = (PLClient.m_MapPLIDtoQBID.ContainsKey(nID) ? Convert.ToString(PLClient.m_MapPLIDtoQBID[nID]) : ""); } else { str = ""; } } else { str = ""; } return(str); }
public static string GetNNFromID(int nID) { string empty; if (!nID.Equals(0)) { if (!PLClient.m_bRead) { PLClient.ReadTable(); } if (PLClient.m_MapIDtoNN != null) { empty = (PLClient.m_MapIDtoNN.ContainsKey(nID) ? PLClient.m_MapIDtoNN[nID].ToString() : string.Empty); } else { empty = string.Empty; } } else { empty = string.Empty; } return(empty); }
public static int GetContactIDFromClientID(int Key) { int num; if (!Key.Equals(0)) { if (!PLClient.m_bRead) { PLClient.ReadTable(); } if (PLClient.m_mapClientIDtoContactID != null) { num = (PLClient.m_mapClientIDtoContactID.ContainsKey(Key) ? PLClient.m_mapClientIDtoContactID[Key] : 0); } else { num = 0; } } else { num = 0; } return(num); }
public static int GetCount() { int num; if (!PLClient.m_bRead) { PLClient.ReadTable(); } num = (PLClient.m_MapNNtoID != null ? PLClient.m_MapNNtoID.Count : 0); return(num); }
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 PCLawConversion() { try { this.PL = new PLLink(); this.GenInf = new PLGenInfo(); this.Lawyer = new PLLawyer(); this.User = new PLUser(); this.Rate = new PLRate(); this.ContactType = new PLContactType(); this.DiaryCode = new PLDiaryCode(); this.ExpCode = new PLExpCode(); this.GLAccts = new PLGLAccts(); this.Task = new PLTask(); this.GBAcct = new PLGBAcct(); this.TBAcct = new PLTBAcct(); this.TypeOfLaw = new PLTypeOfLaw(); this.Location = new PLLocationCode(); this.Department = new PLDepartment(); this.RefSource = new PLRefSource(); this.Client = new PLClient(); this.Contact = new PLContact(); this.Matter = new PLMatter(); this.Vendor = new PLVendor(); this.Bill = new PLBilling(); this.WUD = new PLWUD(); this.TimeEntry = new PLTimeEntry(); this.Trust = new PLTBEnt(); this.General = new PLGBEnt(); this.Expense = new PLExpense(); this.Payable = new PLPayableEntry(); this.GJ = new PLGJEntry(); this.Diary = new PLDiary(); this.SCStageGroup = new PLSafeCustStageGroup(); this.SCStage = new PLSafeCustStage(); this.SCType = new PLSafeCustType(); this.SCStatus = new PLSafeCustStatus(); this.SCPacket = new PLSafeCustPacket(); this.SCSafeCustRecord = new PLSafeCustEntry(); this.SCMovements = new PLSafeCustMovement(); this.CustomTab = new PLCustomTab(); } catch (Exception ex) { int num = (int)MessageBox.Show(ex.Message); } }
public static int GetPLIDFromQBID(string sQBID) { int num; if (!sQBID.Equals("")) { if (!PLClient.m_bRead) { PLClient.ReadTable(); } if (PLClient.m_MapPLIDtoQBID == null) { num = 0; } else if (PLClient.m_MapPLIDtoQBID.ContainsValue(sQBID)) { int key = 0; Dictionary <int, string> .Enumerator enumerator = PLClient.m_MapPLIDtoQBID.GetEnumerator(); while (enumerator.MoveNext()) { Dictionary <int, string> mMapPLIDtoQBID = PLClient.m_MapPLIDtoQBID; KeyValuePair <int, string> current = enumerator.Current; if (mMapPLIDtoQBID[current.Key].ToUpper().CompareTo(sQBID.ToUpper()) == 0) { current = enumerator.Current; key = current.Key; } } num = key; } else { num = 0; } } else { num = 0; } return(num); }
public override void AddRecord() { string str; short i = 0; short j = 0; object obj = new object(); ArrayList item = null; if (this.m_hndPOST == 0) { this.m_hndPOST = base.GetLink().TablePOST_CreateHandle(this.m_sTableName, 0); } if (this.m_hndSubFld == 0) { this.m_hndSubFld = base.GetLink().SubField_CreateHandle(); } if (this.m_NickName.m_bIsSet) { if ((!this.m_ID.m_bIsSet ? true : this.m_ID.nValue.Equals(0))) { if ((PLClient.GetIDFromNN(base.NickName) > 0 || base.NickName.Length.Equals(0) ? true : base.NickName.Length > 6)) { PLClient.m_nClientNN = PLClient.m_nClientNN + 1; str = PLClient.m_nClientNN.ToString(); base.NickName = string.Concat("~", str); } } } else if ((!this.m_ID.m_bIsSet ? true : this.m_ID.nValue.Equals(0))) { PLClient.m_nClientNN = PLClient.m_nClientNN + 1; str = PLClient.m_nClientNN.ToString(); base.NickName = string.Concat("~", str); } this.Name.AddFields(this.m_hndPOST); this.Address.AddFields(this.m_hndPOST); this.Phone.AddFields(this.m_hndPOST); foreach (CPostItem postItem in this.PostItems) { postItem.AddField(this.m_hndPOST); } for (i = 1; i <= this.m_CustomTabIDArr.Count; i = (short)(i + 1)) { this.m_CustomTabID.SetValue(Convert.ToInt32(this.m_CustomTabIDArr[i - 1])); this.m_CustomTabID.AddRepeatField(this.m_hndPOST, i); this.m_CustomTabEntityID.SetValue(Convert.ToInt32(this.m_CustomTabEntityIDArr[i - 1])); this.m_CustomTabEntityID.AddRepeatField(this.m_hndPOST, i); this.m_CustomTabType.SetValue(Convert.ToInt32(this.m_CustomTabTypeArr[i - 1])); this.m_CustomTabType.AddRepeatField(this.m_hndPOST, i); this.m_CustomTabLinkID.SetValue(Convert.ToInt32(this.m_CustomTabLinkIDArr[i - 1])); this.m_CustomTabLinkID.AddRepeatField(this.m_hndPOST, i); item = (ArrayList)this.m_CustomTabFieldInfoArr[i - 1]; if (item != null) { this.m_CustomTabFieldIDsArr = (ArrayList)item[0]; base.GetLink().SubField_Reset(this.m_hndSubFld); for (j = 0; j < this.m_CustomTabFieldIDsArr.Count; j = (short)(j + 1)) { base.GetLink().SubField_AddValueString(this.m_hndSubFld, j + 1, this.m_CustomTabFieldIDsArr[j].ToString()); } base.GetLink().SubField_String(this.m_hndSubFld, ref obj); this.m_CustomTabFldIDs.SetValue(obj.ToString()); this.m_CustomTabFldIDs.AddRepeatField(this.m_hndPOST, i); this.m_CustomTabFldValuesRAWArr = (ArrayList)item[1]; base.GetLink().SubField_Reset(this.m_hndSubFld); for (j = 0; j < this.m_CustomTabFldValuesRAWArr.Count; j = (short)(j + 1)) { base.GetLink().SubField_AddValueString(this.m_hndSubFld, j + 1, this.m_CustomTabFldValuesRAWArr[j].ToString()); } base.GetLink().SubField_String(this.m_hndSubFld, ref obj); this.m_CustomTabFldValuesRAW.SetValue(obj.ToString()); this.m_CustomTabFldValuesRAW.AddRepeatField(this.m_hndPOST, i); this.m_htCustomTabHelpTypeArr = (ArrayList)item[2]; base.GetLink().SubField_Reset(this.m_hndSubFld); for (j = 0; j < this.m_htCustomTabHelpTypeArr.Count; j = (short)(j + 1)) { base.GetLink().SubField_AddValueString(this.m_hndSubFld, j + 1, this.m_htCustomTabHelpTypeArr[j].ToString()); } base.GetLink().SubField_String(this.m_hndSubFld, ref obj); this.m_CustomTabHelpType.SetValue(obj.ToString()); this.m_CustomTabHelpType.AddRepeatField(this.m_hndPOST, i); this.m_CustomTabFieldIDsArr.Clear(); while (this.m_CustomTabFieldIDsArr.Count > 0) { this.m_CustomTabFieldIDsArr.RemoveAt(0); } this.m_CustomTabFldValuesRAWArr.Clear(); while (this.m_CustomTabFldValuesRAWArr.Count > 0) { this.m_CustomTabFldValuesRAWArr.RemoveAt(0); } this.m_htCustomTabHelpTypeArr.Clear(); while (this.m_htCustomTabHelpTypeArr.Count > 0) { this.m_htCustomTabHelpTypeArr.RemoveAt(0); } } } this.m_CustomTabIDArr.Clear(); while (this.m_CustomTabIDArr.Count > 0) { this.m_CustomTabIDArr.RemoveAt(0); } this.m_CustomTabEntityIDArr.Clear(); while (this.m_CustomTabEntityIDArr.Count > 0) { this.m_CustomTabEntityIDArr.RemoveAt(0); } this.m_CustomTabTypeArr.Clear(); while (this.m_CustomTabTypeArr.Count > 0) { this.m_CustomTabTypeArr.RemoveAt(0); } this.m_CustomTabLinkIDArr.Clear(); while (this.m_CustomTabLinkIDArr.Count > 0) { this.m_CustomTabLinkIDArr.RemoveAt(0); } this.m_CustomTabFieldInfoArr.Clear(); while (this.m_CustomTabFieldInfoArr.Count > 0) { this.m_CustomTabFieldInfoArr.RemoveAt(0); } base.GetLink().TablePOST_AddRecord(this.m_hndPOST); PLClient mLCounter = this; mLCounter.m_lCounter = mLCounter.m_lCounter + 1; if (this.m_lCounter >= PLXMLData.m_nMaxCounter) { this.Send(); } }
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; } }