private void AddUpdateLeadOfficeContact(CLAS.FileHistoryRow fhr) { OfficeManager om = myA.FM.AtMng.GetOffice(fhr.OfficeId); officeDB.OfficerRow[] OfficerRow = (officeDB.OfficerRow[])om.DB.Officer.Select("OfficerCode='" + om.CurrentOffice.OfficeCode + ".REC'", ""); if (OfficerRow.Length == 0) { throw new AtriumException("Officer Record for Officer Code: {0}.REC could not be found. Office does not have a proper Reception Officer. Contact an administrator.", om.CurrentOffice.OfficeCode); } //verify if FLO contact type exists already atriumDB.FileContactRow[] LeadOfficeContact = (atriumDB.FileContactRow[])myA.FM.DB.FileContact.Select("ContactType='FLO'", ""); if (LeadOfficeContact.Length == 1) { //found it, need to update it to new office LeadOfficeContact[0].StartDate = DateTime.Today; LeadOfficeContact[0].ContactId = OfficerRow[0].ContactId; } else { //create a new one. FLO should be set to only onePerFile otherwise this code will run when there is more than one LFO atriumDB.FileContactRow fcr = (atriumDB.FileContactRow)myA.FM.GetFileContact().Add(myA.FM.CurrentFile); fcr.ContactId = OfficerRow[0].ContactId; fcr.ContactType = "FLO"; } }
internal ServiceCentreBE(OfficeManager pBEMng) : base(pBEMng, pBEMng.DB.ServiceCentre) { myA = pBEMng; myServiceCentreDT = (officeDB.ServiceCentreDataTable)myDT; if (!myA.AtMng.AppMan.UseService && myODAL == null) { myODAL = myA.AtMng.DALMngr.GetServiceCentre(); } }
internal OfficerRoleBE(OfficeManager pBEMng) : base(pBEMng, pBEMng.DB.OfficerRole) { myA = pBEMng; myOfficerRoleDT = (officeDB.OfficerRoleDataTable)myDT; if (!myA.AtMng.AppMan.UseService && myODAL == null) { myODAL = myA.AtMng.DALMngr.GetOfficerRole(); } }
internal ContactEmailBE(OfficeManager pBEMng) : base(pBEMng, pBEMng.DB.ContactEmail) { myA = pBEMng; myContactEmailDT = (officeDB.ContactEmailDataTable)myDT; if (!myA.AtMng.AppMan.UseService && myODAL == null) { myODAL = myA.AtMng.DALMngr.GetContactEmail(); } }
internal OfficerBE(OfficeManager pBEMng) : base(pBEMng, pBEMng.DB.Officer) { myA = pBEMng; myOfficerDT = (officeDB.OfficerDataTable)myDT; // myOfficerDT.ContactIdColumn.ColumnMapping = MappingType.Hidden; if (!myA.AtMng.AppMan.UseService && myODAL == null) { myODAL = myA.AtMng.DALMngr.GetOfficer(); } }
internal OfficeBE(OfficeManager pBEMng) : base(pBEMng, pBEMng.DB.Office) { myA = pBEMng; myOfficeDT = (officeDB.OfficeDataTable)myDT; this.myOfficeDT.HourlyRateColumn.ExtendedProperties.Add("format", "C"); if (!myA.AtMng.AppMan.UseService && myODAL == null) { myODAL = myA.AtMng.DALMngr.GetOffice(); } }
internal OfficerPrefsBE(OfficeManager pBEMng) : base(pBEMng, pBEMng.DB.OfficerPrefs) { myA = pBEMng; //if (myA != myA.AtMng.OfficeMng) // throw new AtriumException("Class can only be used for logged on officer"); myOfficerPrefsDT = (officeDB.OfficerPrefsDataTable)myDT; if (!myA.AtMng.AppMan.UseService && myODAL == null) { myODAL = myA.AtMng.DALMngr.GetOfficerPrefs(); } }
public void bindSRPData(atriumDB.SRPDataTable a) { label2.Visible = false; myOfficeMan = FM.AtMng.GetOffice(FM.CurrentFile.LeadOfficeId); officeIDucOfficeSelectBox.AtMng = FM.AtMng; sRPBindingSource.DataSource = a.DataSet; sRPBindingSource.DataMember = a.TableName; a.ColumnChanged += new DataColumnChangeEventHandler(a_ColumnChanged); FM.GetSRP().OnUpdate += new atLogic.UpdateEventHandler(ucSRP_OnUpdate); //ApplySecurity(CurrentRow()); if (!myOfficeMan.CurrentOffice.UploadsDisb) { tsImport.Enabled = Janus.Windows.UI.InheritableBoolean.False; } if (!myOfficeMan.CurrentOffice.UsesBilling) { tsSubmitSRP.Enabled = Janus.Windows.UI.InheritableBoolean.False; tsGenSRP.Enabled = Janus.Windows.UI.InheritableBoolean.False; } if (FM.AtMng.SecurityManager.CanExecute(0, atSecurity.SecurityManager.Features.SysAdmin) == atSecurity.SecurityManager.ExPermissions.Yes) { cmdRollbackSRP.Visible = Janus.Windows.UI.InheritableBoolean.True; } else { cmdRollbackSRP.Visible = Janus.Windows.UI.InheritableBoolean.False; } if (a.Count == 0) // no SRPs { NoData(); } FileTreeView.BuildMenu(FM, tsActions, "SRP"); }
public void bindIRPData(atriumDB.IRPDataTable a) { myOfficeMan = FM.AtMng.GetOffice(FM.CurrentFile.LeadOfficeId); officeIDucOfficeSelectBox.AtMng = FM.AtMng; fileIDucFileSelectBox.AtMng = FM.AtMng; UIHelper.ComboBoxInit("vCLASList", mccTaxingOfficer, FM); iRPBindingSource.DataSource = a.DataSet; iRPBindingSource.DataMember = a.TableName; a.ColumnChanged += new DataColumnChangeEventHandler(a_ColumnChanged); FM.GetIRP().OnUpdate += new atLogic.UpdateEventHandler(ucIRP_OnUpdate); btnValidateSIN.Visible = false; // we can show it on Add() if (a.Count == 0) { NoData(); } }
private void AddSecFileRuleOnAssignment(CLAS.FileHistoryRow fhr) { OfficeManager om = myA.FM.AtMng.GetOffice(fhr.OfficeId); if (!om.CurrentOffice.IsDefaultGroupNull()) { atriumDB.secFileRuleRow secRule = (atriumDB.secFileRuleRow)myA.FM.GetsecFileRule().Add(myA.FM.CurrentFile); secRule.StartDate = DateTime.Today; secRule.Inherited = false; secRule.GroupId = om.CurrentOffice.DefaultGroup; try { secRule.RuleId = myA.AtMng.GetSetting(AppIntSetting.LeadOfficeSecFileRule); } catch (Exception x) { throw new AtriumException("ATTEMPT TO SET RULEID ON SECURITY FILE RULE HAS FAILED. RETRIEVAL OF LEAD OFFICE APPSETTING CAUSED AN ERROR"); } } else { throw new AtriumException("SELECTED OFFICE'S DEFAULT SECURITY GROUP IS NOT DEFINED."); } }
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."; } } } }
public override bool CanEdit(DataRow ddr) { atriumDB.ActivityTimeRow dr = (atriumDB.ActivityTimeRow)ddr; if (!myA.IsVirtualFM && dr.FileId != myA.CurrentFile.FileId) { return(false); } //2017-08-21 JLL: On refresh, ActivityRow is null, return false; if (dr.ActivityRow == null) { return(false); } if (dr.ActivityRow.EFileRow.RowState == DataRowState.Added) { return(true); } bool doCheck = false; if (dr.RowState != DataRowState.Modified) { doCheck = true; } else { //if only fileid or audit values was changed then return true foreach (DataColumn dc in dr.Table.Columns) { switch (dc.ColumnName.ToLower()) { case "fileid": case "updatedate": case "updateuser": break; default: if (myA.IsFieldChanged(dc, dr)) { doCheck = true; } break; } } } if (doCheck) { bool ok = false;// myA.AtMng.SecurityManager.CanUpdate(dr.FileId, atSecurity.SecurityManager.Features.ActivityTime) > atSecurity.SecurityManager.LevelPermissions.No; atSecurity.SecurityManager.LevelPermissions perm = myA.AtMng.SecurityManager.CanUpdate(dr.FileId, atSecurity.SecurityManager.Features.ActivityTime); switch (perm) { case atSecurity.SecurityManager.LevelPermissions.All: ok = true; break; case atSecurity.SecurityManager.LevelPermissions.Mine: if (dr.OfficerId == myA.AtMng.OfficerLoggedOn.OfficerId) { ok = true; } else { OfficeManager myOfficeMng = myA.AtMng.GetOffice(myA.AtMng.OfficeLoggedOn.OfficeId); foreach (lmDatasets.officeDB.OfficerDelegateRow odr in myOfficeMng.GetOfficerDelegate().DelegatesForOfficer(myA.AtMng.OfficerLoggedOn.OfficerId)) { if (dr.OfficerId == odr.OfficerId) { ok = true; } } } //else if (dr.OfficerId == myA.AtMng.WorkingAsOfficer.OfficerId) // ok = true; break; case atSecurity.SecurityManager.LevelPermissions.MyOffice: if (dr.OfficeId == myA.AtMng.OfficerLoggedOn.OfficeId) { ok = true; } break; case atSecurity.SecurityManager.LevelPermissions.No: ok = false; break; default: ok = false; break; } bool canOverride = myA.AtMng.SecurityManager.CanOverride(dr.FileId, atSecurity.SecurityManager.Features.ActivityTime) == atSecurity.SecurityManager.ExPermissions.Yes; if (dr.Final && !dr.IsIRPIdNull() && !canOverride) { ok = false; } return(ok | AllowEdit); } else { return(true); } }