public void AddContact(string sContactExternalID1) { if (PLContact.GetIDFromExtID1(sContactExternalID1).Equals(0)) { return; } this.AddContact(PLContact.GetIDFromExtID1(sContactExternalID1), 0); }
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 GetIDFromNameKey(string Key) { Key = Key.ToUpper(); int num; if (!string.IsNullOrEmpty(Key)) { if (!PLContact.bRead) { PLContact.ReadTable(); } num = PLContact.m_MapNameKeytoPLID == null ? 0 : (PLContact.m_MapNameKeytoPLID.ContainsKey(Key) ? Convert.ToInt32(PLContact.m_MapNameKeytoPLID[Key]) : 0); } else { num = 0; } return(num); }
private static void ReadTable() { if (PLContact.bRead) { return; } uint num = 0; object szValue = new object(); PCLawATLClass pcLawAtlClass = new PCLawATLClass(); uint createHandle = pcLawAtlClass.TableGET_CreateHandle("Contact", 0, 0, 0U); pcLawAtlClass.TableGET_AddFilter(createHandle, "ContactStatus", "EQ", "0", 1); pcLawAtlClass.TableGET_AddDirective(createHandle, "FieldList", "ContactID|ContactFirstName|ContactMiddleName|ContactLastName|ContactCompany"); while (pcLawAtlClass.TableGET_GetNextRecord(createHandle) == 0) { pcLawAtlClass.TableGET_RecordField_ValueString(createHandle, "ContactFirstName", "", ref szValue); string str1 = szValue.ToString().ToUpper().Trim(); pcLawAtlClass.TableGET_RecordField_ValueString(createHandle, "ContactMiddleName", "", ref szValue); string str2 = szValue.ToString().ToUpper().Trim(); pcLawAtlClass.TableGET_RecordField_ValueString(createHandle, "ContactLastName", "", ref szValue); string str3 = szValue.ToString().ToUpper().Trim(); pcLawAtlClass.TableGET_RecordField_ValueString(createHandle, "ContactCompany", "", ref szValue); string str4 = szValue.ToString().ToUpper().Trim(); string Key = (str1 + str2 + str3 + str4).ToString().ToUpper().Trim(); while (Key.IndexOf(" ") > 0) { Key = Key.Replace(" ", " "); } if (!string.IsNullOrEmpty(Key)) { PLContact.AddMapNameKeytoPLID(Key, pcLawAtlClass.TableGET_RecordField_ValueI32(createHandle, "ContactID")); } } pcLawAtlClass.TableGET_CloseHandle(createHandle); num = 0U; PLContact.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 empty = string.Empty; this.m_lSendErrorCount = 0L; string str1; string str2; string str3; string message; string str4; string str5; string str6; try { this.GetLink().TablePOST_Send(this.m_hndPOST, ref nProcessed, ref nExceptions); } catch (NullReferenceException ex) { str1 = ex.Data == null ? "" : ex.Data.ToString(); str2 = ex.HelpLink == null ? "" : ex.HelpLink.ToString(); str3 = ex.InnerException == null ? "" : ex.InnerException.ToString(); 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().TablePOST_Reset(this.m_hndPOST); return; } catch (AccessViolationException ex) { str1 = ex.Data == null ? "" : ex.Data.ToString(); str2 = ex.HelpLink == null ? "" : ex.HelpLink.ToString(); str3 = ex.InnerException == null ? "" : ex.InnerException.ToString(); 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().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(); 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().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(); 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().TablePOST_Reset(this.m_hndPOST); this.m_lCounter = 0; return; } 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_ExternalID_1.sLinkName, empty, ref szValue); if (!string.IsNullOrEmpty(szValue.ToString())) { PLContact.AddMapExtID1toPLID(szValue.ToString(), int32); } this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, this.m_ExternalID_2.sLinkName, empty, ref szValue); if (!string.IsNullOrEmpty(szValue.ToString())) { PLContact.AddMapExtID2toPLID(szValue.ToString(), int32); } this.GetLink().TablePOST_ResultDataField_String(this.m_hndPOST, "NameKey", empty, ref szValue); if (!string.IsNullOrEmpty(szValue.ToString())) { PLContact.AddMapNameKeytoPLID(szValue.ToString(), int32); } } } 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); PLContact plContact = this; plContact.m_lSendErrorCount = plContact.m_lSendErrorCount + 1L; } this.GetLink().TablePOST_Reset(this.m_hndPOST); this.m_lCounter = 0; this.GetLink().SubField_CloseHandle(this.m_hndSubFld); this.m_hndSubFld = 0U; }
public override void AddRecord() { object Result = new object(); if ((int)this.m_hndPOST == 0) { this.m_hndPOST = this.GetLink().TablePOST_CreateHandle(this.m_sTableName, 0); } if ((int)this.m_hndSubFld == 0) { this.m_hndSubFld = this.GetLink().SubField_CreateHandle(); } this.Name.AddFields(this.m_hndPOST); this.AddressMain.AddFields(this.m_hndPOST); this.AddressOther.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_Notes.AddField(this.m_hndPOST); for (short index = 1; (int)index <= this.ContTypes.Count; ++index) { this.m_ContTypeID.SetValue(Convert.ToInt32(this.ContTypes[(int)index - 1])); if (this.m_ContTypeID.nValue != 0) { this.m_ContTypeID.m_bIsSet = true; this.m_ContTypeID.AddRepeatField(this.m_hndPOST, (int)index); } if (!this.m_MainContTypeID.m_bIsSet) { this.m_MainContTypeID.SetValue(Convert.ToInt32(this.ContTypes[(int)index - 1])); } } this.ContTypes.Clear(); this.m_MainContTypeID.AddField(this.m_hndPOST); this.m_LawyerID.AddField(this.m_hndPOST); foreach (CPostItem postItem in this.PostItems) { postItem.AddField(this.m_hndPOST); } for (short index = 1; (int)index <= this.conMatters.Count; ++index) { this.m_PartyId.SetValue(0); this.m_PartyId.AddRepeatField(this.m_hndPOST, (int)index); this.m_AssocMatt.SetValue(Convert.ToInt32(this.conMatters[(int)index - 1].MatterID)); this.m_AssocMatt.AddRepeatField(this.m_hndPOST, (int)index); this.m_AssocMattRole.SetValue(Convert.ToInt32(this.conMatters[(int)index - 1].RollID)); this.m_AssocMattRole.AddRepeatField(this.m_hndPOST, (int)index); this.m_AssocMattDelete.SetValue(Convert.ToBoolean(this.conMatters[(int)index - 1].DeleteContact)); this.m_AssocMattDelete.AddRepeatField(this.m_hndPOST, (int)index); } this.m_ExternalID_1.AddField(this.m_hndPOST); this.m_ExternalID_2.AddField(this.m_hndPOST); for (short index1 = 1; (int)index1 <= this.m_CustomTabIDArr.Count; ++index1) { this.m_CustomTabID.SetValue(Convert.ToInt32(this.m_CustomTabIDArr[(int)index1 - 1])); this.m_CustomTabID.AddRepeatField(this.m_hndPOST, (int)index1); this.m_CustomTabEntityID.SetValue(Convert.ToInt32(this.m_CustomTabEntityIDArr[(int)index1 - 1])); this.m_CustomTabEntityID.AddRepeatField(this.m_hndPOST, (int)index1); this.m_CustomTabType.SetValue(Convert.ToInt32(this.m_CustomTabTypeArr[(int)index1 - 1])); this.m_CustomTabType.AddRepeatField(this.m_hndPOST, (int)index1); this.m_CustomTabLinkID.SetValue(Convert.ToInt32(this.m_CustomTabLinkIDArr[(int)index1 - 1])); this.m_CustomTabLinkID.AddRepeatField(this.m_hndPOST, (int)index1); ArrayList arrayList = (ArrayList)this.m_CustomTabFieldInfoArr[(int)index1 - 1]; if (arrayList != null) { this.m_CustomTabFieldIDsArr = (ArrayList)arrayList[0]; this.GetLink().SubField_Reset(this.m_hndSubFld); for (short index2 = 0; (int)index2 < this.m_CustomTabFieldIDsArr.Count; ++index2) { this.GetLink().SubField_AddValueString(this.m_hndSubFld, (int)index2 + 1, this.m_CustomTabFieldIDsArr[(int)index2].ToString()); } this.GetLink().SubField_String(this.m_hndSubFld, ref Result); this.m_CustomTabFldIDs.SetValue(Result.ToString()); this.m_CustomTabFldIDs.AddRepeatField(this.m_hndPOST, (int)index1); this.m_CustomTabFldValuesRAWArr = (ArrayList)arrayList[1]; this.GetLink().SubField_Reset(this.m_hndSubFld); for (short index2 = 0; (int)index2 < this.m_CustomTabFldValuesRAWArr.Count; ++index2) { this.GetLink().SubField_AddValueString(this.m_hndSubFld, (int)index2 + 1, this.m_CustomTabFldValuesRAWArr[(int)index2].ToString()); } this.GetLink().SubField_String(this.m_hndSubFld, ref Result); this.m_CustomTabFldValuesRAW.SetValue(Result.ToString()); this.m_CustomTabFldValuesRAW.AddRepeatField(this.m_hndPOST, (int)index1); this.m_htCustomTabHelpTypeArr = (ArrayList)arrayList[2]; this.GetLink().SubField_Reset(this.m_hndSubFld); for (short index2 = 0; (int)index2 < this.m_htCustomTabHelpTypeArr.Count; ++index2) { this.GetLink().SubField_AddValueString(this.m_hndSubFld, (int)index2 + 1, this.m_htCustomTabHelpTypeArr[(int)index2].ToString()); } this.GetLink().SubField_String(this.m_hndSubFld, ref Result); this.m_CustomTabHelpType.SetValue(Result.ToString()); this.m_CustomTabHelpType.AddRepeatField(this.m_hndPOST, (int)index1); 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); } this.GetLink().TablePOST_AddRecord(this.m_hndPOST); PLContact plContact = this; plContact.m_lCounter = plContact.m_lCounter + 1; if (this.m_lCounter < PLXMLData.m_nMaxCounter) { return; } this.Send(); }