public override string MakeNN(bool bSetNickName) { if (!PLLawyer.bRead) { PLLawyer.ReadTable(); } string str = this.MakeListNN(this.Name, PLLawyer.m_NNs, (short)4); if (bSetNickName) { this.NickName = str; } return(str); }
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 GetNNFromID(int nID) { string str; if (!nID.Equals(0)) { if (!PLLawyer.bRead) { PLLawyer.ReadTable(); } str = PLLawyer.m_MapIDtoNN == null ? "" : (PLLawyer.m_MapIDtoNN.ContainsKey(nID) ? PLLawyer.m_MapIDtoNN[nID].ToString() : ""); } else { str = ""; } return(str); }
public static string GetQBIDFromPLID(int nID) { string str; if (!nID.Equals(0)) { if (!PLLawyer.bRead) { PLLawyer.ReadTable(); } str = PLLawyer.m_MapPLIDtoQBID == null ? "" : (PLLawyer.m_MapPLIDtoQBID.ContainsKey(nID) ? Convert.ToString(PLLawyer.m_MapPLIDtoQBID[nID]) : ""); } else { str = ""; } return(str); }
public static int GetGLIDFromPLID(int nID) { int num; if (!nID.Equals(0)) { if (!PLLawyer.bRead) { PLLawyer.ReadTable(); } num = PLLawyer.m_MapPLIDtoGLID == null ? 0 : (PLLawyer.m_MapPLIDtoGLID.ContainsKey(nID) ? Convert.ToInt32(PLLawyer.m_MapPLIDtoGLID[nID]) : 0); } else { num = 0; } return(num); }
public static int GetIDFromNN(string Key) { Key = Key.ToUpper(); int num; if (!Key.Equals("")) { if (!PLLawyer.bRead) { PLLawyer.ReadTable(); } num = PLLawyer.m_MapNNtoID == null ? 0 : (PLLawyer.m_MapNNtoID.ContainsKey(Key) ? Convert.ToInt32(PLLawyer.m_MapNNtoID[Key]) : 0); } else { num = 0; } return(num); }
public static int GetPLIDFromQBID(string sQBID) { int num1; if (!sQBID.Equals("")) { if (!PLLawyer.bRead) { PLLawyer.ReadTable(); } if (PLLawyer.m_MapPLIDtoQBID == null) { num1 = 0; } else if (PLLawyer.m_MapPLIDtoQBID.ContainsValue(sQBID)) { int num2 = 0; Dictionary <int, string> .Enumerator enumerator = PLLawyer.m_MapPLIDtoQBID.GetEnumerator(); while (enumerator.MoveNext()) { Dictionary <int, string> mapPliDtoQbid = PLLawyer.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); }
private static void ReadTable() { if (PLLawyer.bRead) { return; } uint num = 0; object szValue = new object(); string empty = string.Empty; uint createHandle = PLLink.GetLink().TableGET_CreateHandle("Lawyer", 0, 0, 0U); while (PLLink.GetLink().TableGET_GetNextRecord(createHandle) == 0) { PLLink.GetLink().TableGET_RecordField_ValueString(createHandle, "LawyerStatus", "", ref szValue); int int32 = Convert.ToInt32(szValue.ToString().ToUpper().Trim()); PLLink.GetLink().TableGET_RecordField_ValueString(createHandle, "LawyerNickName", "", ref szValue); string str1 = szValue.ToString().ToUpper().Trim(); if (int32 <= 0 || (str1.ToLower() == "it~" ? 0 : (str1.ToLower() != "int~" ? 1 : 0)) == 0) { int recordFieldValueI32_1 = PLLink.GetLink().TableGET_RecordField_ValueI32(createHandle, "LawyerID"); int recordFieldValueI32_2 = PLLink.GetLink().TableGET_RecordField_ValueI32(createHandle, "LawyerFeesAccountID"); PLLink.GetLink().TableGET_RecordField_ValueString(createHandle, "LawyerQuickBooksID", "", ref szValue); string str2 = szValue.ToString().ToUpper().Trim(); PLLawyer.AddMapNNtoID(str1, recordFieldValueI32_1); PLLawyer.AddMapIDtoNN(recordFieldValueI32_1, str1); PLLawyer.AddMapPLIDtoGLID(recordFieldValueI32_1, recordFieldValueI32_2); PLLawyer.AddNicknameToList(str1); if (!str2.Equals("")) { PLLawyer.AddMapPLIDtoQBID(recordFieldValueI32_1, str2); } } } PLLink.GetLink().TableGET_CloseHandle(createHandle); num = 0U; PLLawyer.bRead = true; }
public override void AddRecord() { if (!this.m_NickName.m_bIsSet) { this.NickName = this.MakeNN(true); } else if ((this.m_ID.m_bIsSet && this.m_ID.nValue.Equals(0) || !this.m_ID.m_bIsSet) && PLLawyer.GetIDFromNN(this.NickName) > 0) { this.NickName = this.MakeNN(true); } else if ((this.NickName.Length.Equals(0) ? 1 : (this.NickName.Length > 4 ? 1 : 0)) != 0) { this.NickName = this.MakeNN(true); } PLLawyer.AddNicknameToList(this.NickName); base.AddRecord(); for (short index = 1; (int)index <= this.m_RateArr.Count; ++index) { this.m_RateID.SetValue(this.m_RateArr[(int)index - 1].RateID); this.m_RateID.AddRepeatField(this.m_hndPOST, (int)index); this.m_RateAmt.SetValue(this.m_RateArr[(int)index - 1].RateAmount); this.m_RateAmt.AddRepeatField(this.m_hndPOST, (int)index); this.m_RateDate.SetValue(this.m_RateArr[(int)index - 1].RateDate); this.m_RateDate.AddRepeatField(this.m_hndPOST, (int)index); } this.m_RateArr.Clear(); this.GetLink().TablePOST_AddRecord(this.m_hndPOST); PLLawyer plLawyer = this; plLawyer.m_lCounter = plLawyer.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; 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; } }
// public void AddLawyer(string sNN) //// { // this.m_LawyerID.nValue = // } // public void AddLawyer(int nID) // { // this.m_LawyerID.SetValue(nID); // } public override void AddRecord() { PLDiary.eType entryType = this.EntryType; if ((int)this.m_hndPOST == 0) { this.m_hndPOST = this.GetLink().TablePOST_CreateHandle(this.m_sTableName, 0); } if (this.EntryType == PLDiary.eType.Appointment) { if (this.AllDayEvent) { this.StartTime = 700; this.DurationSeconds = 43200; } else if ((this.StartTime > 700 ? 0 : (this.DurationSeconds > 43200 ? 1 : 0)) != 0) { this.StartTime = 700; this.DurationSeconds = 43200; } this.AllDayEvent = false; if (this.DurationSeconds < 360) { this.DurationSeconds = 360; } } if (this.EntryType == PLDiary.eType.TODO && this.DurationSeconds < 360) { this.DurationSeconds = 360; } if (this.IsRecurringEntry) { this.RecurringType = this.EntryType; this.RecurringDescription = this.Description; this.RecurringStartTime = this.StartTime; this.RecurringDuration = this.Duration; if (this.RecurringRepeatUnit != PLDiary.eRepeatUnit.Year || (this.RecurringMonthOfYear == 0 || this.RecurringWeekOfMonth == 0 ? 0 : (this.RecurringDayOfWeek == (PLDiary.eDay) 0 ? 1 : 0)) == 0) { ; } if (this.RecurringRepeatUnit != PLDiary.eRepeatUnit.Month || (this.RecurringWeekOfMonth == 0 ? 0 : (this.RecurringDayOfWeek == (PLDiary.eDay) 0 ? 1 : 0)) == 0) { ; } } if (this.EntryType == PLDiary.eType.Call) { this.ReminderDate = this.DueDate; this.EnteredDate = this.DueDate; } if (this.ReminderDate == 0) { this.ReminderDate = this.DueDate; } if (this.EntryType == PLDiary.eType.Holiday) { //this.ArrLawyers.Clear(); this.ArrMSGRead.Clear(); this.ArrContacts.Clear(); this.m_StartTime.Clear(); this.m_DurationSeconds.Clear(); this.m_ReminderDate.Clear(); } this.Completed = this.m_CompletionDate.m_bIsSet; if ((m_LawyerID != null && m_MsgUserID != null) && (m_LawyerID.nValue > 0 && m_MsgUserID.nValue > 0)) { this.m_LawyerID.AddField(this.m_hndPOST); //this.m_MsgUserID.SetValue(m_MsgUserID.nValue); this.m_MsgUserID.AddField(this.m_hndPOST); this.ArrMSGRead.Clear(); } else { this.m_LawyerID.SetValue(PLLawyer.GetIDFromNN("~IT")); this.m_LawyerID.AddField(this.m_hndPOST); this.m_MsgUserID.SetValue(PLLawyer.GetIDFromNN("~IT")); this.m_MsgUserID.AddField(this.m_hndPOST); } base.AddRecord(); this.m_EntryType.AddField(this.m_hndPOST); if (this.ArrContacts.Count > 0) { for (int nRepeat = 1; nRepeat <= this.ArrContacts.Count; ++nRepeat) { this.m_ContactID.SetValue(Convert.ToInt32(this.ArrContacts[nRepeat - 1])); this.m_ContactID.AddRepeatField(this.m_hndPOST, nRepeat); } this.ArrContacts.Clear(); } this.GetLink().TablePOST_AddRecord(this.m_hndPOST); PLDiary plDiary = this; plDiary.m_lCounter = plDiary.m_lCounter + 1; if (this.m_lCounter < PLXMLData.m_nMaxCounter) { return; } this.Send(); }