public void SetDelegateSecurity(officeDB.OfficerDelegateRow odr) { if (odr.WorkAs) { officeDB.OfficerRow or = odr.OfficerRowByOfficerWorkAs; if (or == null) { or = myA.AtMng.GetOfficeForOfficer(odr.DelegateToId).GetOfficer().Load(odr.DelegateToId); } SecurityDB.secUserRow sur = myA.AtMng.SecurityManager.GetsecUser().GetSecUserForOfficer(or); if (!odr.OfficerRow.IsMyFileIdNull()) { myA.GetOfficer().AddUserFileRule(sur.UserId, myA.AtMng.GetFile(odr.OfficerRow.MyFileId).CurrentFile, (int)atSecurity.SpecialRules.DelegateFileRW); } } }
public officeDB.OfficerRow LoadByEmail(string email) { if (myA.AtMng.AppMan.UseService) { Fill(myA.AtMng.AppMan.AtriumX().OfficerLoadByEmail(email, myA.AtMng.AppMan.AtriumXCon)); } else { try { Fill(myDAL.LoadByEmail(email)); } catch (System.Runtime.Serialization.SerializationException x) { RecoverDAL(); Fill(myDAL.LoadByEmail(email)); } } officeDB.OfficerRow[] ors = (officeDB.OfficerRow[]) this.myOfficerDT.Select("EmailAddress='" + email.Replace("'", "''") + "'"); if (ors.Length == 1) { SetLocalDates(); officeDB.OfficerRow or = ors[0]; return(or); } else { myA.GetContactEmail().LoadByEmail(email); officeDB.ContactEmailRow[] cers = (officeDB.ContactEmailRow[])myA.DB.ContactEmail.Select("Email='" + email.Replace("'", "''") + "'"); if (cers.Length > 0) { SetLocalDates(); officeDB.OfficerRow or = myA.GetOfficer().Load(cers[0].ContactId); return(or); } else { return(null); } } }
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."; } } } }