public static string GetSuspenseNN() { if (!PLGLAccts.bRead) { PLGLAccts.ReadTable(); } return(PLGLAccts.m_SuspenseNN); }
public static int GetIDFromNN(string Key) { if (!PLGLAccts.bRead) { PLGLAccts.ReadTable(); } return(PLGLAccts.m_MapNNtoID.ContainsKey(Key) ? Convert.ToInt32(PLGLAccts.m_MapNNtoID[Key]) : 0); }
public static int GetTrustLiabilityID() { if (!PLGLAccts.bRead) { PLGLAccts.ReadTable(); } return(PLGLAccts.m_TrustLiabilityID); }
public static string GetExpRecovNN() { if (!PLGLAccts.bRead) { PLGLAccts.ReadTable(); } return(PLGLAccts.m_ExpRecovNN); }
public static int GetFeesEarnedAccountID() { if (!PLGLAccts.bRead) { PLGLAccts.ReadTable(); } return(PLGLAccts.m_FeesEarnedAccountID); }
public static string GetARAccountNN() { if (!PLGLAccts.bRead) { PLGLAccts.ReadTable(); } return(PLGLAccts.m_ARAccountNN); }
public static int GetExpRecovID() { if (!PLGLAccts.bRead) { PLGLAccts.ReadTable(); } return(PLGLAccts.m_ExpRecovID); }
public static int GetARAccountID() { if (!PLGLAccts.bRead) { PLGLAccts.ReadTable(); } return(PLGLAccts.m_ARAccountID); }
public static int GetSuspenseID() { if (!PLGLAccts.bRead) { PLGLAccts.ReadTable(); } return(PLGLAccts.m_SuspenseID); }
public static string GetNNFromID(int Key) { if (!PLGLAccts.bRead) { PLGLAccts.ReadTable(); } return(PLGLAccts.m_MapIDtoNN.ContainsKey(Key) ? PLGLAccts.m_MapIDtoNN[Key].ToString() : ""); }
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; string szDefault = ""; this.m_lSendErrorCount = 0L; 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); PLGLAccts.AddMapIDtoNN(int32, szValue.ToString()); PLGLAccts.AddMapNNtoID(szValue.ToString(), int32); this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_ExternalID_1.sLinkName, szDefault, ref szValue); if (!szValue.ToString().Equals("")) { PLGLAccts.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("")) { PLGLAccts.AddMapExtID2toPLID(szValue.ToString(), Convert.ToInt32(vunIDCreated)); } this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, "PostRefQuickBooksID", szDefault, ref szValue); string str = szValue.ToString().ToUpper().Trim(); if (!str.Equals("")) { PLGLAccts.AddMapPLIDtoQBID(int32, str); } } } 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); PLGLAccts plglAccts = this; plglAccts.m_lSendErrorCount = plglAccts.m_lSendErrorCount + 1L; } this.GetLink().TablePOST_Reset(this.m_hndPOST); this.m_lCounter = 0; }
public override void AddRecord() { base.AddRecord(); this.GetLink().TablePOST_AddRecord(this.m_hndPOST); PLGLAccts plglAccts = this; plglAccts.m_lCounter = plglAccts.m_lCounter + 1; if (this.m_lCounter < PLXMLData.m_nMaxCounter) { return; } this.Send(); }
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 string GetQBIDFromPLID(int nID) { string str; if (!nID.Equals(0)) { if (!PLGLAccts.bRead) { PLGLAccts.ReadTable(); } str = PLGLAccts.m_MapPLIDtoQBID == null ? "" : (PLGLAccts.m_MapPLIDtoQBID.ContainsKey(nID) ? Convert.ToString(PLGLAccts.m_MapPLIDtoQBID[nID]) : ""); } else { str = ""; } return(str); }
public static int GetPLIDFromQBID(string sQBID) { int num1; if (!sQBID.Equals("")) { if (!PLGLAccts.bRead) { PLGLAccts.ReadTable(); } if (PLGLAccts.m_MapPLIDtoQBID == null) { num1 = 0; } else if (PLGLAccts.m_MapPLIDtoQBID.ContainsValue(sQBID)) { int num2 = 0; Dictionary <int, string> .Enumerator enumerator = PLGLAccts.m_MapPLIDtoQBID.GetEnumerator(); while (enumerator.MoveNext()) { Dictionary <int, string> mapPliDtoQbid = PLGLAccts.m_MapPLIDtoQBID; KeyValuePair <int, string> current = enumerator.Current; if (mapPliDtoQbid[current.Key].ToUpper().CompareTo(sQBID.ToUpper()) == 0) { current = enumerator.Current; num2 = current.Key; } } num1 = num2; } else { num1 = 0; } } else { num1 = 0; } return(num1); }
public override void AddRecord() { if ((int)this.m_hndPOST == 0) { this.m_hndPOST = this.GetLink().TablePOST_CreateHandle(this.m_sTableName, 0); } if (!this.m_NickName.m_bIsSet) { ++PLVendor.m_nVendorNN; this.NickName = "~" + PLVendor.m_nVendorNN.ToString(); } else if ((this.m_ID.m_bIsSet && this.m_ID.nValue.Equals(0) || !this.m_ID.m_bIsSet) && PLVendor.GetIDFromNN(this.NickName) > 0) { ++PLVendor.m_nVendorNN; this.NickName = "~" + PLVendor.m_nVendorNN.ToString(); } else if ((this.NickName.Length.Equals(0) ? 1 : (this.NickName.Length > 6 ? 1 : 0)) != 0) { ++PLVendor.m_nVendorNN; this.NickName = "~" + PLVendor.m_nVendorNN.ToString(); } this.Name.AddFields(this.m_hndPOST); this.Address.AddFields(this.m_hndPOST); this.Phone.AddFields(this.m_hndPOST); this.m_ID.AddField(this.m_hndPOST); this.m_Status.AddField(this.m_hndPOST); this.m_NickName.AddField(this.m_hndPOST); if (this.DefExpCodeNN.Length > 0) { int idFromNn = PLExpCode.GetIDFromNN(this.DefExpCodeNN); if (idFromNn > 0) { this.DefExpCodeID = idFromNn; this.m_DefExpCode.AddField(this.m_hndPOST); this.DefExpCodeNN = ""; } } if (this.DefGLAcctNN.Length > 0) { int idFromNn = PLGLAccts.GetIDFromNN(this.DefExpCodeNN); if (idFromNn > 0) { this.DefGLAcctID = idFromNn; this.m_DefGLAcctID.AddField(this.m_hndPOST); this.DefGLAcctNN = ""; } } this.m_US1099BoxNumber.AddField(this.m_hndPOST); this.m_US1099ID.AddField(this.m_hndPOST); this.m_US1099Type.AddField(this.m_hndPOST); this.m_AcctNum.AddField(this.m_hndPOST); this.m_ActiveFlag.AddField(this.m_hndPOST); this.m_DefGSTCat.AddField(this.m_hndPOST); this.m_DiscDays1.AddField(this.m_hndPOST); this.m_DiscPct1.AddField(this.m_hndPOST); this.m_DiscDays2.AddField(this.m_hndPOST); this.m_DiscPct2.AddField(this.m_hndPOST); this.m_DiscDays3.AddField(this.m_hndPOST); this.m_DiscPct3.AddField(this.m_hndPOST); this.m_Notes.AddField(this.m_hndPOST); this.m_Terms.AddField(this.m_hndPOST); this.m_QuickBooksID.AddField(this.m_hndPOST); this.m_ContactID.AddField(this.m_hndPOST); this.m_ExternalID_1.AddField(this.m_hndPOST); this.m_ExternalID_2.AddField(this.m_hndPOST); this.GetLink().TablePOST_AddRecord(this.m_hndPOST); PLVendor plVendor = this; plVendor.m_lCounter = plVendor.m_lCounter + 1; if (this.m_lCounter < PLXMLData.m_nMaxCounter) { return; } this.Send(); }
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; }
public void AddGJAllocation(string GLNN, double dAmount) { this.AddGJAllocation(PLGLAccts.GetIDFromNN(GLNN), dAmount); }
private static void ReadTable() { if (PLGLAccts.bRead) { return; } uint num = 0; object szValue = new object(); uint createHandle = PLLink.GetLink().TableGET_CreateHandle("PostRef", 0, 0, 0U); PLLink.GetLink().TableGET_AddFilter(createHandle, "PostRefStatus", "EQ", "0", 1); while (PLLink.GetLink().TableGET_GetNextRecord(createHandle) == 0) { PLLink.GetLink().TableGET_RecordField_ValueString(createHandle, "PostRefNickName", "", ref szValue); string Key = szValue.ToString().ToUpper().Trim(); int recordFieldValueI32_1 = PLLink.GetLink().TableGET_RecordField_ValueI32(createHandle, "PostRefID"); PLGLAccts.AddMapNNtoID(Key, recordFieldValueI32_1); PLGLAccts.AddMapIDtoNN(recordFieldValueI32_1, Key); int recordFieldValueI32_2 = PLLink.GetLink().TableGET_RecordField_ValueI32(createHandle, "LawyerID"); PLLink.GetLink().TableGET_RecordField_ValueString(createHandle, "PostRefSpecialAcct", "", ref szValue); if (!szValue.ToString().Equals("")) { if (Convert.ToInt32(szValue) == Convert.ToInt32((object)PLGLAccts.eSPEC_ACCT.DISB_REC)) { PLGLAccts.m_ExpRecovNN = Key; PLGLAccts.m_ExpRecovID = recordFieldValueI32_1; } else if (Convert.ToInt32(szValue) == Convert.ToInt32((object)PLGLAccts.eSPEC_ACCT.SUSPENSE)) { PLGLAccts.m_SuspenseNN = Key; PLGLAccts.m_SuspenseID = recordFieldValueI32_1; } else if (Convert.ToInt32(szValue) == Convert.ToInt32((object)PLGLAccts.eSPEC_ACCT.AP)) { PLGLAccts.m_APAccountNN = Key; PLGLAccts.m_APAccountID = recordFieldValueI32_1; } else if (Convert.ToInt32(szValue) == Convert.ToInt32((object)PLGLAccts.eSPEC_ACCT.AR)) { PLGLAccts.m_ARAccountNN = Key; PLGLAccts.m_ARAccountID = recordFieldValueI32_1; } else if (recordFieldValueI32_2 == 0 && Convert.ToInt32(szValue) == Convert.ToInt32((object)PLGLAccts.eSPEC_ACCT.FEES)) { PLGLAccts.m_FeesEarnedAccountID = recordFieldValueI32_1; } else if (Convert.ToInt32(szValue) == Convert.ToInt32((object)PLGLAccts.eSPEC_ACCT.TRUST_LIABILITY)) { PLGLAccts.m_TrustLiabilityID = recordFieldValueI32_1; } } PLLink.GetLink().TableGET_RecordField_ValueString(createHandle, "PostRefQuickBooksID", "", ref szValue); string str = szValue.ToString().ToUpper().Trim(); if (!str.Equals("")) { PLGLAccts.AddMapPLIDtoQBID(recordFieldValueI32_1, str); } } PLLink.GetLink().TableGET_CloseHandle(createHandle); num = 0U; PLGLAccts.bRead = true; }
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; string str2; string str3; string str4; string str5; string str6; try { this.GetLink().TablePOST_Send(this.m_hndPOST, ref nProcessed, ref nExceptions); } catch (AccessViolationException ex) { str1 = ex.Data == null ? "" : ex.Data.ToString(); str2 = ex.HelpLink == null ? "" : ex.HelpLink.ToString(); str3 = ex.InnerException == null ? "" : ex.InnerException.ToString(); string 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().LinkLog_AddLinkLogMessage("AccessViolationException Execption: " + message); this.GetLink().TablePOST_DumpExceptionsToLinkLog(this.m_hndPOST); 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(); string 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().LinkLog_AddLinkLogMessage("Format Execption: " + message); this.GetLink().TablePOST_DumpExceptionsToLinkLog(this.m_hndPOST); 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(); string 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().LinkLog_AddLinkLogMessage("Catch All Execption: " + message); this.GetLink().TablePOST_DumpExceptionsToLinkLog(this.m_hndPOST); this.GetLink().TablePOST_Reset(this.m_hndPOST); this.m_lCounter = 0; return; } try { 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); PLLawyer plLawyer = this; plLawyer.m_lSendErrorCount = plLawyer.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) { this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_ExternalID_1.sLinkName, szDefault, ref szValue); PLLawyer.AddMapExtID1toPLID(szValue.ToString(), Convert.ToInt32(vunIDCreated)); this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_ExternalID_2.sLinkName, szDefault, ref szValue); PLLawyer.AddMapExtID2toPLID(szValue.ToString(), Convert.ToInt32(vunIDCreated)); PLGLAccts plglAccts = new PLGLAccts(); plglAccts.AddFilter("LawyerID", PLXMLData.eFilterCompare.EQ, vunIDCreated.ToString(), 1); while (plglAccts.GetNextRecord() == 0) { PLGLAccts.AddMapNNtoID(plglAccts.NickName, plglAccts.ID); PLGLAccts.AddMapIDtoNN(plglAccts.ID, plglAccts.NickName); } } } PLLawyer.ClearMapIDtoNN(); PLLawyer.ClearMapNNtoID(); PLLawyer.ClearMapPLIDtoGLID(); PLLawyer.ClearMapPLIDtoQBID(); PLLawyer.bRead = false; PLLawyer.ReadTable(); this.GetLink().TablePOST_Reset(this.m_hndPOST); this.m_lCounter = 0; } catch (Exception ex) { str1 = ex.Data == null ? "" : ex.Data.ToString(); str2 = ex.HelpLink == null ? "" : ex.HelpLink.ToString(); str3 = ex.InnerException == null ? "" : ex.InnerException.ToString(); string 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().LinkLog_AddLinkLogMessage("Catch All Execption: " + message); this.GetLink().TablePOST_DumpExceptionsToLinkLog(this.m_hndPOST); this.GetLink().TablePOST_Reset(this.m_hndPOST); this.m_lCounter = 0; } }