public void Resolve(atriumDB.ContactRow cr, docDB.RecipientRow newR) { if (!cr.IsEmailAddressNull()) { newR.Address = cr.EmailAddress; //addresstype will default to SMTP so that shouldbe the primary email type for all users } else { if (!cr.IsAddressCurrentIDNull()) { atriumDB.AddressRow ar = myA.FM.DB.Address.FindByAddressId(cr.AddressCurrentID); if (ar == null) { myA.FM.GetAddress().LoadByContactId(cr.ContactId); ar = myA.FM.DB.Address.FindByAddressId(cr.AddressCurrentID); } if (!ar.IsEmailAddressNull()) { newR.Address = ar.EmailAddress; } } if (newR.DocumentRow.isLawmail && newR.IsAddressNull()) { throw new ValidationException(String.Format(Properties.Resources.ContactNoEmailOnResolveAttempt, cr.DisplayName)); } } newR.Name = cr.DisplayName; }
protected override void AfterUpdate(DataRow dr) { atriumDB.AddressRow addr = (atriumDB.AddressRow)dr; //CLAS hook if (!myA.CurrentFile.IsOpponentIDNull() && addr.ContactId == myA.CurrentFile.OpponentID) { //find contact and determine if update is occuring on current address atriumDB.ContactRow cr = myA.DB.Contact.FindByContactId(addr.ContactId); bool updateFileStuct = false; if (cr == null) //collections file opening; contact not in DB yet { //find debtor in CLASManager DB if (myA.GetCLASMng().DB.Debtor[0].AddressCurrentID == addr.AddressId) { updateFileStuct = true; } } else if (!cr.IsAddressCurrentIDNull() && cr.AddressCurrentID == addr.AddressId) { updateFileStuct = true; } if (updateFileStuct) { //update toc for DB filecontact System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); xd.InnerXml = myA.CurrentFile.FileStructXml; myA.GetFileContact().MyXml(myA.CurrentFile, xd); myA.CurrentFile.FileStructXml = xd.InnerXml; } } }
public atriumDB.AddressRow Load(int AddressId) { atriumDB.AddressRow or = myAddressDT.FindByAddressId(AddressId); if (or == null) { if (myA.AtMng.AppMan.UseService) { Fill(myA.AtMng.AppMan.AtriumX().AddressLoad(AddressId, myA.AtMng.AppMan.AtriumXCon)); } else { try { Fill(myDAL.Load(AddressId)); } catch (System.Runtime.Serialization.SerializationException x) { RecoverDAL(); Fill(myDAL.Load(AddressId)); } } or = myAddressDT.FindByAddressId(AddressId); } return(or); }
private DataRow AddX(CLAS.PropertyRow cr) { atriumDB.AddressRow dr = (atriumDB.AddressRow)base.Add(cr); cr.AddressID = dr.AddressId; return(dr); }
private DataRow AddX(officeDB.OfficeRow cr) { atriumDB.AddressRow dr = (atriumDB.AddressRow)base.Add(cr); cr.AddressId = dr.AddressId; return(dr); }
private void DumpParticipants() { myA.DB.ADMSEParticipant.Clear(); myA.DB.ADMSEParticipant.AcceptChanges(); foreach (atriumDB.ContactRow pr in myA.FM.DB.Contact) { if (pr.ContactClass == "P") { SST.ADMSEParticipantRow apr = (SST.ADMSEParticipantRow)myA.GetADMSEParticipant().Add(null); if (!pr.IsFirstNameNull()) { apr.FirstName = pr.FirstName; } if (!pr.IsLastNameNull()) { apr.LastName = pr.LastName; } //if (!pr.IsPartyTypeCodeNull()) // apr.ParticipantTypeM = pr.PartyTypeCode; apr["SIN"] = pr["SIN"]; apr["BusinessNumber"] = pr["BusinessNumber"]; apr["LegalName"] = pr["LegalName"]; apr["OperatingAs"] = pr["OperatingAs"]; if (!pr.IsTelephoneNumberNull()) { apr["TelephoneNumber"] = pr["TelephoneNumber"]; } apr.LangCdM = pr.LanguageCode; // apr.AppealSeqId = myA.DB.SSTCase[0].ReconsiderationID; try { atriumDB.FileContactRow fcr = pr.GetFileContactRows()[0]; apr.ParticipantTypeM = fcr.ContactType; SST.FilePartyRow fpr = (SST.FilePartyRow)myA.DB.FileParty.Select("FileContactId=" + fcr.FileContactid.ToString())[0]; apr.IsAppellant = fpr.IsAppellant; } catch (Exception x) { apr.IsAppellant = false; } if (!pr.IsAddressCurrentIDNull()) { atriumDB.AddressRow ar = myA.FM.DB.Address.FindByAddressId(pr.AddressCurrentID); apr["AddressLine1"] = ar["Address1"]; apr["AddressLine2"] = ar["Address2"]; apr["AddressLine3"] = ar["Address3"]; apr["City"] = ar["City"]; apr["ProvinceCodeM"] = ar["ProvinceCode"]; apr["PostalCode"] = ar["PostalCode"]; apr["CountryM"] = ar["CountryCode"]; } } } }
private void addressBindingSource_CurrentChanged(object sender, EventArgs e) { atriumDB.AddressRow dr = CurrentRowAddress(); ApplyAddressSecurity(dr); string mask = FM.GetAddress().PhoneMask(CurrentRowAddress()); maskedEditBox1.Mask = mask; maskedEditBox2.Mask = mask; maskedEditBox3.Mask = mask; }
private void addAddressBtn_Click(object sender, EventArgs e) { ucAddress.Visible = true; addressGroupBox.Visible = true; addAddressBtn.Visible = false; atriumDB.AddressRow ar = (atriumDB.AddressRow)FM.GetAddress().Add(CurrentRow()); //CurrentRow().AddressCurrentID = ar.AddressId; //ar.ContactId = CurrentRow().OfficerId; int adrpos = addressBindingSource.Find("AddressId", CurrentRow().AddressCurrentID); addressBindingSource.Position = adrpos; }
private DataRow AddX(officeDB.OfficerRow cr) { atriumDB.AddressRow dr = (atriumDB.AddressRow)base.Add(cr); dr.ContactId = cr.OfficerId; if (cr.IsAddressCurrentIDNull()) { cr.AddressCurrentID = dr.AddressId; } return(dr); }
public override void Validate(DataRow row) { atriumDB.AddressRow dr = (atriumDB.AddressRow)row; this.Validate("City", dr); this.Validate("ProvinceCode", dr); this.Validate("CountryCode", dr); this.Validate("Address1", dr); if (!dr.IsContactIdNull()) { this.Validate("EffectiveTo", dr); this.Validate("AddressSourceCode", dr); this.Validate("AddressType", dr); } }
private void btnAddAddress_Click(object sender, EventArgs e) { ucAddress1.Visible = true; btnAddAddress.Visible = false; //UIHelper.EnableControls(addressBindingSource, true); //int contactId= CurrentRow().ContactId; //atriumDB.ContactRow cr = (atriumDB.ContactRow)FM.DB.Contact.Select("ContactId=" + contactId.ToString())[0]; // FM.GetAddress().Load(); atriumDB.AddressRow ar = (atriumDB.AddressRow)FM.GetAddress().Add(CurrentRowContact()); int adrpos = addressBindingSource.Find("AddressId", CurrentRowContact().AddressCurrentID); addressBindingSource.Position = adrpos; }
protected override void AfterChange(DataColumn dc, DataRow ddr) { string ObjectName = this.myAddressDT.TableName; atriumDB.AddressRow dr = (atriumDB.AddressRow)ddr; switch (dc.ColumnName) { case "PostalCode": if (dr.CountryCode == "CDN" || dr.CountryCode == "USA") { dr.PostalCode = dr.PostalCode.ToUpper(); } break; default: break; } }
protected override void BeforeDelete(DataRow row) { atriumDB.AddressRow dr = (atriumDB.AddressRow)row; string ObjectName = this.myAddressDT.TableName; if (myA.AtMng.GetSetting(AppBoolSetting.useCLASMngr)) { //if (this.myA.GetCLASMng().DB.Debtor.FindByDebtorId(dr.ContactId) == null) // this.myA.GetCLASMng().GetDebtor().Load(dr.ContactId); if (!myA.CurrentFile.IsOpponentIDNull() && dr.AddressId == myA.GetCLASMng().GetDebtor().CurrentDebtor.AddressCurrentID) { throw new AtriumException(Resources.AddressNoDelete); } else { this.myA.GetActivity().DeleteRelatedCA(this.myA.CurrentFile.FileId, ObjectName, dr.AddressId); } } }
protected override void BeforeUpdate(DataRow row) { atriumDB.AddressRow dr = (atriumDB.AddressRow)row; Validate(row); if (dr.HasErrors) { throw new AtriumException(ErrorsForTable(myDT)); } if (!myA.CurrentFile.IsOpponentIDNull() && dr.AddressType == "RE") { //COMMENTED OUT. DON'T NEED TO AUTO UPDATE VALUE OF "CURRENT" ANYMORE, RELFIELDS SHOULD HANDLE IT. //WTF????? //NOW there is an item in TFS to restore this. What is the expected behaviour??? // //check to see if this address has the most recent effective to atriumDB.AddressRow max = dr; foreach (atriumDB.AddressRow add in myAddressDT.Select("ContactId=" + myA.CurrentFile.OpponentID.ToString())) { if (add.AddressType == "RE") { if (add.IsCurrentNull() || add.Current) { add.Current = false; } if (add.EffectiveTo > max.EffectiveTo) { max = add; } } } // if (dr.EffectiveTo >= max.EffectiveTo) myA.GetCLASMng().GetDebtor().CurrentDebtor.AddressCurrentID = max.AddressId; max.Current = true; } }
public string PhoneMask(atriumDB.AddressRow adr) { if (adr == null) { return(""); } if (adr.IsNull("CountryCode")) { return(""); } switch (adr.CountryCode) { case "US": case "CA": case "USA": case "CDN": return("(###) ###-####"); default: return(""); } }
protected override void AfterAdd(DataRow row) { atriumDB.AddressRow dr = (atriumDB.AddressRow)row; string ObjectName = this.myAddressDT.TableName; dr.Current = false; dr.AddressType = "RE"; dr.EffectiveTo = DateTime.Today; //System.Diagnostics.Debug.WriteLine(dr["AddressId"] + dr.RowState.ToString() ); if (dr.IsNull("AddressId") || dr.AddressId == 0) { dr.AddressId = this.myA.AtMng.PKIDGet(ObjectName, 10); } dr.CountryCode = "CDN"; dr.AddressSourceCode = "HRDC"; //if (!dr.IsContactIdNull()) //{ // if(!myA.CurrentFile.IsOpponentIDNull() && (myA.GetCLASMng().GetDebtor().CurrentDebtor.IsAddressCurrentIDNull() || myA.GetCLASMng().GetDebtor().CurrentDebtor.RowState==DataRowState.Added)) // myA.GetCLASMng().GetDebtor().CurrentDebtor.AddressCurrentID=dr.AddressId; //} }
public void bindOfficeData(lmDatasets.officeDB.OfficeDataTable dt) { ucMultiDropDown1.SetDataBinding(FM.Codes("OfficeList"), ""); ucMultiDropDown2.SetDataBinding(FM.Codes("OfficeType"), ""); ucMultiDropDown3.SetDataBinding(FM.Codes("AppointmentType"), ""); ucMultiDropDown4.SetDataBinding(FM.Codes("CurrencyCode"), ""); UIHelper.ComboBoxInit("Department", mccDepartment, FM); UIHelper.ComboBoxInit(FM.Codes("OfficeList"), mccBranch, FM); UIHelper.ComboBoxInit(FM.Codes("TaxRate"), mccDefaultTaxRate, FM); officeBindingSource.DataSource = dt.DataSet; officeBindingSource.DataMember = dt.TableName; DataView dv; if (CurrentRow().IsAddressIdNull()) { atriumDB.AddressRow addr = (atriumDB.AddressRow)FM.GetAddress().Add(CurrentRow()); dv = new DataView(FM.DB.Address, "AddressId=" + addr.AddressId.ToString(), "", DataViewRowState.CurrentRows); } else { dv = new DataView(FM.DB.Address, "AddressId=" + CurrentRow().AddressId.ToString(), "", DataViewRowState.CurrentRows); } this.addressBindingSource.DataSource = dv; ucAddress1.FM = FM; ucAddress1.DataSource = addressBindingSource; dt.ColumnChanged += new DataColumnChangeEventHandler(dt_ColumnChanged); FM.DB.Address.ColumnChanged += new DataColumnChangeEventHandler(dt_ColumnChanged); FM.LeadOfficeMng.GetOffice().OnUpdate += new atLogic.UpdateEventHandler(ucOfficeInfo_OnUpdate); FM.GetAddress().OnUpdate += new atLogic.UpdateEventHandler(ucOfficeInfo_OnUpdate); }
private void fileContactBindingSource_CurrentChanged(object sender, EventArgs e) { try { atriumDB.FileContactRow fcr = CurrentRow(); if (fcr==null|| fcr.IsNull("FileContactid")) return; TogglePartyEditableMode(false); switch (fcr.ContactClass) { case "O": verifyContactType(true, false); UIHelper.ComboBoxInit("ContactTypeFile", ucMultiDropDown1, FM); break; case "P": displayParticipant(); UIHelper.ComboBoxInit("Test", ucMultiDropDown1, FM); //verifyContactType(false, true); break; default: verifyContactType(false,false); UIHelper.ComboBoxInit("ContactType", ucMultiDropDown1, FM); break; } atriumDB.ContactRow pr = CurrentRowContact(); if (pr == null || pr.IsNull("ContactId")) return; contactBindingSource.Position = contactBindingSource.Find("ContactId", fcr.ContactId); if (!CurrentRowContact().IsAddressCurrentIDNull() && (CurrentRow().IsPositionCodeNull() || CurrentRow().PositionCode !="TM")) { atriumDB.AddressRow adr = FM.DB.Address.FindByAddressId(CurrentRowContact().AddressCurrentID); if (adr == null) FM.GetAddress().Load(CurrentRowContact().AddressCurrentID); addressBindingSource.Filter = ""; addressBindingSource.Position = addressBindingSource.Find("AddressId", CurrentRowContact().AddressCurrentID.ToString()); ucAddress1.Visible = true; btnAddAddress.Visible = false; } else { //addressBindingSource.Filter = "contactid=0"; if(fcr.ContactClass=="P" || fcr.ContactClass=="B") btnAddAddress.Visible = true; else btnAddAddress.Visible = false; ucAddress1.Visible = false; } if (!CurrentRow().IsPositionCodeNull() && CurrentRow().PositionCode == "TM") { btnAddAddress.Visible = false; ucAddress1.Visible = false; } ApplySecurity(fcr); } catch (Exception x) { UIHelper.HandleUIException(x); } }
public void CalcRecipType() { myA.isMerging = true; //clear column first myFilePartyDT.AcceptChanges(); foreach (SST.FilePartyRow fpr in myFilePartyDT) { if (fpr.RowState != DataRowState.Deleted) { fpr.SetRecipTypeNull(); fpr.AcceptChanges(); } } //determine whether this record should be the recipient foreach (SST.FilePartyRow fpr in myFilePartyDT) { fpr.ClosestSCCId = 0; atriumDB.FileContactRow fcr = myA.FM.DB.FileContact.FindByFileContactid(fpr.FileContactId); if (fcr != null) { if (fcr.ContactRow != null) { if (!fcr.ContactRow.IsAddressCurrentIDNull()) { //calc sc atriumDB.AddressRow ar = myA.FM.DB.Address.FindByAddressId(fcr.ContactRow.AddressCurrentID); appDB.PostalCodeLocationRow pclr = null; if (ar != null) { if (!ar.IsPostalCodeNull()) { pclr = myA.AtMng.GetPostalCodeLocation().Load(ar.PostalCode.Replace(" ", "")); } if (pclr != null) { MemberManager mem = myA.AtMng.GetMemberMng(); fpr.ClosestSCCId = mem.GetClosestSCC(pclr.Latitude, pclr.Longitude); fpr.AcceptChanges(); } } } } //calc recip type if (fcr.IsDelegateForNull()) { atriumDB.FileContactRow[] fcrRep = (atriumDB.FileContactRow[])myA.FM.DB.FileContact.Select("DelegateFor='" + fcr.ContactType + "'"); if (fcrRep.Length == 1) { SST.FilePartyRow[] fprs = (SST.FilePartyRow[])myFilePartyDT.Select("FileContactId=" + fcrRep[0].FileContactid.ToString()); if (!fprs[0].IsPending) { fprs[0].RecipType = fpr.ContactType; fprs[0].AcceptChanges(); } else { fpr.RecipType = fpr.ContactType; fpr.AcceptChanges(); } } else { fpr.RecipType = fpr.ContactType; fpr.AcceptChanges(); } } } } myA.isMerging = false; }
public atriumDB.ContactRow SwapBySIN(atriumDB.ContactRow pr, string SIN) { if (pr.RowState == DataRowState.Added) { //load exisiting party row LoadBySIN(SIN); myA.RaiseWarning(WarningLevel.Display, Properties.Resources.ExistingPartyFound, myA.AtMng.AppMan.AppName); var ps = from p in myPersonDT where !p.IsSINNull() && p.SIN == SIN && pr.ContactId != p.ContactId select p; atriumDB.ContactRow existingPerson = ps.Single(); int currentContactId = pr.ContactId; //replace party row in related fields ACEngine ace = myA.CurrentActivityProcess.CurrentACE; if (ace.relTables.ContainsKey("Party0")) { DataView dv = new DataView(myPersonDT, "ContactId=" + existingPerson.ContactId.ToString(), "", DataViewRowState.CurrentRows); ace.relTables["Party0"].RowFilter = dv.RowFilter; } //swap address if (ace.relTables.ContainsKey("Address0") && !existingPerson.IsAddressCurrentIDNull()) { myA.DB.Address.FindByAddressId(pr.AddressCurrentID).Delete(); myA.GetAddress().Load(existingPerson.AddressCurrentID); DataView dv = new DataView(myA.DB.Address, "AddressId=" + existingPerson.AddressCurrentID.ToString(), "", DataViewRowState.CurrentRows); ace.relTables["Address0"].RowFilter = dv.RowFilter; } else if (ace.relTables.ContainsKey("Address0") && existingPerson.IsAddressCurrentIDNull()) { atriumDB.AddressRow adr = myA.DB.Address.FindByAddressId(pr.AddressCurrentID); adr.ContactId = existingPerson.ContactId; existingPerson.AddressCurrentID = adr.AddressId; } //change contact id on filecontact var fcs = from fc in myA.DB.FileContact where !fc.IsNull("ContactId") && fc.ContactId == currentContactId select fc; if (fcs.Count() == 1) { atriumDB.FileContactRow fcr = fcs.Single(); fcr.ContactId = existingPerson.ContactId; } pr.Delete(); // pr.AcceptChanges(); return(existingPerson); } else { return(pr); } }
private void AddOtherParty(MapBE map, DataRow drp) { atriumDB.ContactRow pr = null; //search for party if (!drp.IsNull("ID_SIN")) { string SIN = drp["ID_SIN"].ToString(); myA.FM.GetPerson().LoadBySIN(SIN); var ps = from p in myA.FM.DB.Contact where !p.IsSINNull() && p.SIN == SIN select p; if (ps.Count() == 1) { pr = ps.Single(); } } if (pr == null) { //create party pr = (atriumDB.ContactRow)myA.FM.GetPerson().Add(null); pr.SIN = drp["ID_SIN"].ToString(); } pr.ContactClass = "P"; //if (drp.IsNull("NAME_INDVDL_LST")) // pr.LastName = "Resources"; //else pr.LastName = drp["NAME_INDVDL_LST"].ToString(); //if (drp.IsNull("NAME_INDVDL_FRST")) // pr.FirstName = "Human"; //else pr.FirstName = drp["NAME_INDVDL_FRST"].ToString(); pr.LanguageCode = map.MapIn("LanguageCode", drp["CODE_LNG"].ToString()); pr.BusinessNumber = drp["ID_BSNS_NMBR"].ToString(); pr.LegalName = drp["NAME_ORG"].ToString(); pr.OperatingAs = drp["NAME_ORG_UNT"].ToString(); pr.PartyTypeCode = map.MapIn("ContactType", drp["CODE_PRTCPNT_TYP"].ToString()); pr.TelephoneNumber = drp["NMBR_TLPHN_AR_CD_H"].ToString() + "-" + drp["NMBR_TLPHN_LCL_H"].ToString(); //create address atriumDB.AddressRow ar = (atriumDB.AddressRow)myA.FM.GetAddress().Add(pr); // ar.ContactId = pr.ContactId; ar.EffectiveTo = DateTime.Today; ar.AddressSourceCode = "HRDC"; ar.Address1 = drp["ADRS_LN_1"].ToString(); ar.Address2 = drp["ADRS_LN_2"].ToString(); ar.Address3 = drp["ADRS_LN_3"].ToString(); string prov = map.MapIn("Province", drp["CODE_PRVNC_OR_ST"].ToString()); if (prov != null) { DataTable dtProv = myA.FM.Codes("Province"); DataRow drs = dtProv.Rows.Find(prov); if (drs != null) { ar.CountryCode = drs["CountryCode"].ToString(); } else { ar.CountryCode = "CDN"; } } else { ar.CountryCode = map.MapIn("Country", drp["NAME_CNTRY"].ToString()); if (drp.IsNull("NAME_CNTRY") || ar.IsNull("CountryCode")) { ar.CountryCode = "CDN"; } } ar.ProvinceCode = prov; ar.City = drp["ADRS_MNCPLTY"].ToString(); ar.PostalCode = drp["CODE_PSTL_OR_ZIP"].ToString(); // pr.AddressCurrentID = ar.AddressId; //create filecontact atriumDB.FileContactRow fcrp = (atriumDB.FileContactRow)myA.FM.GetFileContact().Add(myA.FM.CurrentFile); fcrp.ContactId = pr.ContactId; fcrp.ContactType = pr.PartyTypeCode; //create fileparty SST.FilePartyRow fpr = (SST.FilePartyRow)myA.GetFileParty().Add(myA.FM.CurrentFile); // fpr.PartyId = pr.PartyId; // fpr.ContactTypeCode = pr.PartyTypeCode; fpr.IsPending = true; fpr.FileContactId = fcrp.FileContactid; }
private void EI_WS(SST.ADMSLookupRow ADMSr, MapBE map, ADMS.ADMS_LookupClient ws) { ACEngine ace = myA.FM.CurrentActivityProcess.CurrentACE; DataSet ds = ws.Get_ADMS_SST_Info(ADMSr.ReconID, ADMSr.SIN, ADMSr.BusinessNumber); if (ds.Tables.Contains("ERROR")) { //get status message ADMSr.Message = ds.Tables["ERROR"].Rows[0]["MESSAGE"].ToString(); if (ADMSr.Message.ToUpper() == "SUCCESS") { if (ds.Tables.Contains("ADMS_SST_INFO")) { DataTable dtR = ds.Tables["ADMS_SST_INFO"]; DataRow dr = dtR.Rows[0]; SST.SSTCaseRow scr = (SST.SSTCaseRow)myA.GetSSTCase().GetCurrentRow()[0]; // scr.AppelantSourceId = System.Convert.ToInt32(map.MapIn("AppelantSource", dr["CODE_SRC"].ToString())); scr.ReconsiderationID = ADMSr.ReconID; if (!dr.IsNull("DATE_DCSN_ISD")) { scr.OrigDecisionDate = System.Convert.ToDateTime(dr["DATE_DCSN_ISD"]); } int officeid = System.Convert.ToInt32(map.MapIn("Office", dr["ID_OFC_ANCHR"].ToString())); atriumDB.FileOfficeRow focr = myA.FM.GetFileOffice().AddOfficeToFile(officeid, false, false, false); focr.OfficeFileNum = scr.ReconsiderationID.ToString(); //find the gd account OfficeManager om = myA.AtMng.GetOffice(focr.OfficeId); if (om.DB.Officer.Rows.Count == 0) { om.GetOfficer().LoadByOfficeId(focr.OfficeId); } var oGD = from o in om.DB.Officer where o.PositionCode == "GD" select o; if (oGD.Count() == 1) { atriumDB.FileContactRow fcr = myA.FM.GetFileContact().Add(oGD.Single(), "FHGD"); fcr.HideInToc = true; } if (ds.Tables.Contains("ADMS_SST_INFO_PARTICIPANTS")) { // string participantType = map.MapIn("Source2Participant", dr["CODE_SRC"].ToString()); foreach (DataRow drp in ds.Tables["ADMS_SST_INFO_PARTICIPANTS"].Rows) { bool isAppellant = false; if (!ADMSr.IsSINNull() && !drp.IsNull("ID_SIN") && ADMSr.SIN == drp["ID_SIN"].ToString()) { isAppellant = true; } else if (!ADMSr.IsBusinessNumberNull() && !drp.IsNull("ID_BSNS_NMBR")) { isAppellant = IsEmployerAppellant(ADMSr, drp, isAppellant); } if (isAppellant) { atriumDB.ContactRow pr = (atriumDB.ContactRow)ace.relTables["Party0"][0].Row; atriumDB.FileContactRow fcr4 = (atriumDB.FileContactRow)ace.relTables["FileContact4"][0].Row; SST.FilePartyRow fpr = (SST.FilePartyRow)ace.relTables["FileParty0"][0].Row; fpr.IsAppellant = true; pr.SIN = drp["ID_SIN"].ToString(); pr.ContactClass = "P"; //if (pr.GetColumnError("SIN") == Properties.Resources.DebtDuplicateSIN) //changed test to test for Added as the column error would never be present on the exisiting contact after the swap if (pr.RowState != DataRowState.Added) { //TFS#54669 CJW 2013-09-20 called in PersonBE beforechange now //pr = myA.FM.GetPerson().SwapBySIN(pr, pr.SIN); pr = (atriumDB.ContactRow)ace.relTables["Party0"][0].Row; fcr4 = (atriumDB.FileContactRow)ace.relTables["FileContact4"][0].Row; fpr = (SST.FilePartyRow)ace.relTables["FileParty0"][0].Row; //alert user off swap ADMSr.Message = Properties.Resources.ExistingPartyFound; } pr.LastName = drp["NAME_INDVDL_LST"].ToString(); pr.FirstName = drp["NAME_INDVDL_FRST"].ToString(); pr.LanguageCode = map.MapIn("LanguageCode", drp["CODE_LNG"].ToString()); pr.BusinessNumber = drp["ID_BSNS_NMBR"].ToString(); pr.LegalName = drp["NAME_ORG"].ToString(); pr.OperatingAs = drp["NAME_ORG_UNT"].ToString(); pr.PartyTypeCode = map.MapIn("ContactType", drp["CODE_PRTCPNT_TYP"].ToString()); fcr4.ContactId = pr.ContactId; fcr4.ContactType = pr.PartyTypeCode; fpr.FileContactId = fcr4.FileContactid; pr.TelephoneNumber = drp["NMBR_TLPHN_AR_CD_H"].ToString() + "-" + drp["NMBR_TLPHN_LCL_H"].ToString(); if (!pr.IsAddressCurrentIDNull()) { atriumDB.AddressRow ar = myA.FM.DB.Address.FindByAddressId(pr.AddressCurrentID); ar.ContactId = pr.ContactId; ar.EffectiveTo = DateTime.Today; ar.AddressSourceCode = "HRDC"; ar.Address1 = drp["ADRS_LN_1"].ToString(); ar.Address2 = drp["ADRS_LN_2"].ToString(); ar.Address3 = drp["ADRS_LN_3"].ToString(); string prov = map.MapIn("Province", drp["CODE_PRVNC_OR_ST"].ToString()); if (prov != null) { DataTable dtProv = myA.FM.Codes("Province"); DataRow drs = dtProv.Rows.Find(prov); if (drs != null) { ar.CountryCode = drs["CountryCode"].ToString(); } else { ar.CountryCode = "CDN"; } } else { ar.CountryCode = map.MapIn("Country", drp["NAME_CNTRY"].ToString()); if (drp.IsNull("NAME_CNTRY") || ar.IsNull("CountryCode")) { ar.CountryCode = "CDN"; } } ar.ProvinceCode = prov; ar.City = drp["ADRS_MNCPLTY"].ToString(); ar.PostalCode = drp["CODE_PSTL_OR_ZIP"].ToString(); } } else { //add other participants automatically AddOtherParty(map, drp); } } } } } else if (ADMSr.Message.ToUpper() == "ERROR") { // ADMSr.SetColumnError("Message", ADMSr.Message); ADMSr.Message = ds.Tables["ERROR"].Rows[0]["SQL"].ToString(); if (ADMSr.Message.StartsWith("ORA-01403")) { ADMSr.Message = "No matching reconsideration found in ADMS. / Aucune révision correspondante trouvée dans le SGPA."; } else if (ADMSr.Message.StartsWith("ORA-01422")) { ADMSr.Message = "More than one matching reconsideration found in ADMS. / Il y a plus qu'une révision correspondante trouvée dans le SGPA."; } else if (ADMSr.Message.StartsWith("ORA-1017")) { ADMSr.Message = "Configuration problem with ADMS EI web service. Contact IT support. / Il y a un problème de configuration avec le service web A-E SGPA. Contactez le support TI."; } else if (ADMSr.Message.StartsWith("ORA-12154")) { ADMSr.Message = "Configuration problem with ADMS EI web service. Contact IT support. / Il y a un problème de configuration avec le service web A-E SGPA. Contactez le support TI."; } } } }
private void MyXml(atriumDB.FileContactRow fcr, System.Xml.XmlDocument xd) { try { //JLL: MODIFIED 2009/07/24: take FileContact.Active into account - remove where not active bool removeNode = false; if (!fcr.HideInToc) { System.Xml.XmlElement xe = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@supertype='contact' and @id=" + fcr.FileContactid.ToString() + "]"); if (!fcr.Active) { removeNode = true; } else if (xe == null) { xe = xd.CreateElement("toc"); xe.SetAttribute("supertype", "contact"); } if (removeNode) { RemoveFileContactFromXML(xe); } else { xe.SetAttribute("id", fcr.FileContactid.ToString()); //if (fcr.IsLastNameNull()) //{ // xe.SetAttribute("titlee", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescEng.ToString() + ")", fcr.LegalName, "")); // xe.SetAttribute("titlef", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescFre.ToString() + ")", fcr.LegalName, "")); //} //else //{ // xe.SetAttribute("titlee", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescEng.ToString() + ")", fcr.LastName, fcr.FirstName)); // xe.SetAttribute("titlef", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescFre.ToString() + ")", fcr.LastName, fcr.FirstName)); //} xe.SetAttribute("titlee", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescEng.ToString() + ")", fcr.DisplayName, "")); xe.SetAttribute("titlef", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescFre.ToString() + ")", fcr.DisplayName, "")); if (fcr.ContactType == "FDB") { CLAS.DebtorRow debtor = myA.GetCLASMng().GetDebtor().CurrentDebtor; xe.SetAttribute("type", "opponent"); //check for Contact/Notes if (debtor != null && !debtor.IsNotesNull()) { //tweek title xe.SetAttribute("titlee", "*** " + xe.GetAttribute("titlee") + " ***"); xe.SetAttribute("titlef", "*** " + xe.GetAttribute("titlef") + " ***"); xe.SetAttribute("bold", "true"); xe.SetAttribute("tooltipe", "There are notes"); xe.SetAttribute("tooltipf", "Il y a des notes"); } else { xe.SetAttribute("bold", "false"); xe.SetAttribute("tooltipe", ""); xe.SetAttribute("tooltipf", ""); } //2014-06-11 //JLL //calculate address country to determine icon //assumes data is already loaded //DOES NOT WORK WHEN OPENING A FILE; CONTACT ROW IS NULL ... ARG if (debtor != null && !debtor.IsAddressCurrentIDNull()) { atriumDB.AddressRow dbAddress = myA.DB.Address.FindByAddressId(debtor.AddressCurrentID); if (dbAddress != null) { string country = dbAddress.CountryCode; switch (country) { case "CDN": xe.SetAttribute("icon", "34"); break; case "USA": xe.SetAttribute("icon", "35"); break; default: xe.SetAttribute("icon", "36"); break; } } } } else { xe.SetAttribute("type", "contact"); } if (xe.GetAttribute("isParticipant") != "true" && !fcr.IsOfficeIdNull()) { xe.SetAttribute("icon", "43"); //atrium officer; not necessarily a user } if (xe.ParentNode == null) { System.Xml.XmlElement xes = null; if (fcr.IsOfficeIdNull()) { xes = EFileBE.XmlAddFld(xd, "basecontacts", "Contacts", "Contacts", 210); xes.AppendChild(xe); } else { System.Xml.XmlElement xe1 = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@type='fileoffice' and @officeid=" + fcr.OfficeId.ToString() + "]"); if (xe1 != null) { xe1.AppendChild(xe); } else { xes = EFileBE.XmlAddFld(xd, "basecontacts", "Contacts", "Contacts", 210); xes.AppendChild(xe); } //xes.AppendChild(xe); //xes = EFileBE.XmlAddFld(xe1, "contacts", "Contacts", "Contacts", 320); //else //{ //JLL: Bug 2009/07/24 //When new contact is added through process (CM03.02), and no File Office record is present, // it sticks File Contact record on first "contact" match on filestructxml document // xes = EFileBE.XmlAddFld(xd, "contacts", "Contacts", "Contacts", 320); //} } //xes.AppendChild(xe); } } } } catch (Exception x) { } }
protected override void BeforeChange(DataColumn dc, DataRow ddr) { string ObjectName = this.myAddressDT.TableName; atriumDB.AddressRow dr = (atriumDB.AddressRow)ddr; WhereClause whereCl = new WhereClause(); switch (dc.ColumnName) { case "City": if (!dr.IsNull("CountryCode") && dr.CountryCode == "CDN") { if (dr.IsCityNull()) { throw new RequiredException(Resources.AddressCity); } if (myA.AtMng.GetSetting(AppBoolSetting.ValidateCity)) { if (!dr.IsProvinceCodeNull()) { DataTable dt = myA.Codes("vCity"); whereCl.Add("ProvinceCode", "=", dr.ProvinceCode); if (dt.Select(whereCl.Filter()).Length != 0) { whereCl.Add("City", "=", dr.City); //dt = myA.AtMng.GetGeneralRec("City", whereCl); if (dt.Select(whereCl.Filter()).Length == 0) { throw new AtriumException(Resources.AddressCityNotInProv, Resources.AddressCity, Resources.AddressProvince); } } } } } break; case "ProvinceCode": if (dr.IsProvinceCodeNull()) { if (!dr.IsNull("CountryCode")) { if (dr.CountryCode == "CDN" || dr.CountryCode == "USA") { throw new RequiredException(Resources.AddressProvinceCode); } } } else { if (!dr.IsNull("CountryCode")) { if (dr.CountryCode == "CDN" || dr.CountryCode == "USA") { DataTable dtP = myA.Codes("Province"); atLogic.WhereClause wc = new atLogic.WhereClause(); wc.Add("CountryCode", "=", dr.CountryCode); //if (!myA.Codes("Province").Rows.Contains(dr.ProvinceCode)) if (!dtP.Rows.Contains(dr.ProvinceCode)) { throw new AtriumException(Resources.IsNotValid, Resources.AddressProvinceCode); } } } } break; case "CountryCode": if (dr.IsNull(dc)) { throw new RequiredException(Resources.AddressCountryCode); } else if (!myA.Codes("Country").Rows.Contains(dr.CountryCode)) { throw new AtriumException(Resources.IsNotValid, Resources.AddressCountryCode); } break; case "AddressSourceCode": if (dr.IsAddressSourceCodeNull()) { throw new RequiredException(Resources.AddressAddressSourceCode); } else if (!myA.Codes("AddressSource").Rows.Contains(dr.AddressSourceCode)) { throw new AtriumException(Resources.IsNotValid, Resources.AddressAddressSourceCode); } break; case "AddressType": if (dr.IsAddressTypeNull()) { throw new RequiredException(Resources.AddressAddressType); } else if (!myA.Codes("AddressType").Rows.Contains(dr.AddressType)) { throw new AtriumException(Resources.IsNotValid, Resources.AddressAddressType); } break; case "Address1": if (dr.IsNull(dc)) { throw new RequiredException(Resources.AddressAddress1); } break; case "EffectiveTo": if (dr.IsEffectiveToNull()) { throw new RequiredException(Resources.AddressEffectiveTo); } myA.IsValidDate(Resources.AddressEffectiveTo, dr.EffectiveTo, false, DebtorBE.CSLBegin, DateTime.Today, Resources.ValidationCSLBegin, Resources.ValidationToday); break; default: break; } }