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"]; } } } }
protected override void AfterUpdate(DataRow dr) { SST.FilePartyRow fpr = (SST.FilePartyRow)dr; System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); xd.InnerXml = myA.FM.CurrentFile.FileStructXml; MyXml(fpr, xd); myA.FM.CurrentFile.FileStructXml = xd.InnerXml; CalcRecipType(); }
protected override void BeforeUpdate(DataRow row) { SST.FilePartyRow dr = (SST.FilePartyRow)row; if ((dr.IsRespondent & dr.IsAppellant) | (dr.IsRespondent & dr.IsAddedParty) | (dr.IsAddedParty & dr.IsAppellant)) { throw new AtriumException("A file party can only be one of the following: appellant, respondent or added party"); } BeforeChange("IsRespondent", row); BeforeChange("IsAppellant", row); }
private void MyXml(SST.FilePartyRow fcr, System.Xml.XmlDocument xd) { //TODO: need to fix this up //return; try { System.Xml.XmlElement xe = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@supertype='contact' and @id=" + fcr.FileContactId.ToString() + "]"); if (xe == null) { return; } if (fcr.IsPending) { xe.SetAttribute("italicize", "true"); xe.SetAttribute("icon", "26"); //hourglass pending xe.SetAttribute("tooltipe", "Pending Party"); xe.SetAttribute("tooltipf", "À confirmer"); } else if (fcr.IsAppellant) { xe.SetAttribute("icon", "27"); //appelant xe.SetAttribute("italicize", "false"); xe.SetAttribute("tooltipe", "Appellant"); xe.SetAttribute("tooltipf", "Appelant"); } else if (fcr.IsRespondent) { xe.SetAttribute("icon", "31"); //respondent xe.SetAttribute("italicize", "false"); xe.SetAttribute("tooltipe", "Respondent"); xe.SetAttribute("tooltipf", "Intimé"); } else if (fcr.IsAddedParty) { xe.SetAttribute("icon", "37"); //IsAddedParty xe.SetAttribute("italicize", "false"); xe.SetAttribute("tooltipe", "Added Party"); xe.SetAttribute("tooltipf", "Partie mise en cause"); } else { xe.SetAttribute("italicize", "false"); //added party xe.SetAttribute("icon", "32"); xe.SetAttribute("tooltipe", "Added Party"); xe.SetAttribute("tooltipf", "Partie jointe"); } xe.SetAttribute("isParticipant", "true"); } catch (Exception x) { } }
public override bool CanDelete(DataRow dr) { SST.FilePartyRow fpRow = (SST.FilePartyRow)dr; if (fpRow.IsPending | (!fpRow.IsAppellant & !fpRow.IsRespondent)) { return(true); } else { return(false); } }
protected override void AfterAdd(DataRow row) { SST.FilePartyRow dr = (SST.FilePartyRow)row; string ObjectName = this.myFilePartyDT.TableName; dr.FilePartyId = this.myA.AtMng.PKIDGet(ObjectName, 10); dr.FileId = myA.FM.CurrentFileId; dr.IsAppellant = false; dr.IsRespondent = false; dr.IsPending = false; dr.AllowAdministrativeEmail = false; dr.IsAddedParty = false; }
private void CreateAppeal(int fileAppealedId) { FileManager fmOrig = myA.AtMng.GetFile(fileAppealedId); SSTManager sstOrig = fmOrig.GetSSTMng(); SST.SSTCaseRow scr = mySSTCaseDT[0]; //copy sstcasematter if (!sstOrig.DB.SSTCase[0].IsDecisionSentDateNull()) { scr.OrigDecisionDate = sstOrig.DB.SSTCase[0].DecisionSentDate; } //is leave to app0eal required!! if (sstOrig.DB.SSTCase[0].OutcomeId == 5 || sstOrig.DB.SSTCase[0].OutcomeId == 18) { scr.LeaveToAppealNotRequired = true; } else { scr.LeaveToAppealNotRequired = false; } scr.ProgramId = sstOrig.DB.SSTCase[0].ProgramId; if (!sstOrig.DB.SSTCase[0].IsAccountIdNull()) { scr.AccountId = sstOrig.DB.SSTCase[0].AccountId; } foreach (SST.SSTCaseMatterRow scmr in sstOrig.DB.SSTCaseMatter) { SST.SSTCaseMatterRow newScmr = (SST.SSTCaseMatterRow)myA.GetSSTCaseMatter().Add(scr); if (!scmr.IsIssueIdNull()) { newScmr.IssueId = scmr.IssueId; } if (!scmr.IsAccountIdNull()) { newScmr.AccountId = scmr.AccountId; } newScmr.ProgramId = scmr.ProgramId; } //copy contacts/parties foreach (atriumDB.FileContactRow fcr in fmOrig.DB.FileContact) { if (fcr.ContactClass == "P") { atriumDB.FileContactRow newFcr = (atriumDB.FileContactRow)myA.FM.GetFileContact().Add(myA.FM.CurrentFile); newFcr.ContactId = fcr.ContactId; newFcr.ContactType = fcr.ContactType; SST.FilePartyRow fpr = (SST.FilePartyRow)sstOrig.DB.FileParty.Select("Filecontactid=" + fcr.FileContactid.ToString())[0]; SST.FilePartyRow newFpr = (SST.FilePartyRow)myA.GetFileParty().Add(scr); newFpr.IsAppellant = fpr.IsAppellant; newFpr.IsRespondent = fpr.IsRespondent; newFpr.IsPending = true; newFpr.FileContactId = newFcr.FileContactid; } } }
protected override void BeforeChange(DataColumn dc, DataRow row) { SST.FilePartyRow dr = (SST.FilePartyRow)row; if (!dr.IsFileContactIdNull()) // ensure FileContactId is not null { atriumDB.FileContactRow fcr = myA.FM.DB.FileContact.FindByFileContactid(dr.FileContactId); switch (dc.ColumnName) { case "IsRespondent": //add this test to prevent duplicate IsRespondent on a file if (dr.IsRespondent) { if (!fcr.IsNull("ContactType")) { if (fcr.ContactType.EndsWith("R")) { throw new AtriumException("A rep. cannot be the respondent"); } } } foreach (SST.FilePartyRow fcr1 in myFilePartyDT) { if (fcr1.RowState != DataRowState.Deleted) { fcr1.SetColumnError(dc, ""); if (dr.IsRespondent && fcr1.IsRespondent && dr.FilePartyId != fcr1.FilePartyId) { throw new AtriumException(Properties.Resources.DuplicateRespondent); } } } break; case "IsAddedParty": if (dr.IsAddedParty) { if (!fcr.IsNull("ContactType")) { if (fcr.ContactType.EndsWith("R")) { throw new AtriumException("A rep. cannot be an added party"); } } } break; case "IsAppellant": //TFS#51004 CJW 2013-8-26 //add this test to prevent duplicate appellants on a file if (dr.IsAppellant) { if (!fcr.IsNull("ContactType")) { if (fcr.ContactType.EndsWith("R")) { throw new AtriumException("A rep. cannot be the appellant"); } } } foreach (SST.FilePartyRow fcr1 in myFilePartyDT) { if (fcr1.RowState != DataRowState.Deleted) { fcr1.SetColumnError(dc, ""); if (dr.IsAppellant && fcr1.IsAppellant && dr.FilePartyId != fcr1.FilePartyId) { throw new AtriumException(Properties.Resources.DuplicateAppellant); //JLL 2013-09-27: Translation for 2013/10 build - string moved to resource. } } } break; default: break; } } }
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."; } } } }