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; } } }
private void EditReschedule(int NawACSeriesId) { try { //check to see if appt has a hearing if (CurrentRow() != null) { atriumBE.FileManager contextFM = FM.AtMng.GetFile(CurrentRow().FileId); atriumDB.FileContactRow FCR = contextFM.GetFileContact().GetByRole("FTM"); bool isTM = false; if (FCR != null) { isTM = (FCR.ContactId == FM.AtMng.WorkingAsOfficer.ContactId); } if (ApptIsHearing() && isTM) { UIHelper.CannotEditAppointment(); } else { //Create Step to handle editing Appointment fACWizard facwr; //Launch AcWizard Constructor to Edit Appointment if (!IsOfficerCal) { this.FileForm().ReadOnly = true; GetOriginalRecurrenceAppointment(FM); facwr = new fACWizard(FM, NawACSeriesId, CurrentRow().ApptId); this.FileForm().HookupWizClose(facwr); facwr.Show(); } else { atriumBE.FileManager fmCurrent = FM.AtMng.GetFile(CurrentRow().FileId); GetOriginalRecurrenceAppointment(fmCurrent); facwr = new fACWizard(fmCurrent, NawACSeriesId, CurrentRow().ApptId); facwr.ShowDialog(); facwr.Close(); } } } else { AddNewAppointment(NawACSeriesId); } } catch (Exception x) { if (this.FileForm() != null) { this.FileForm().ReadOnly = false; } UIHelper.HandleUIException(x); } }
public atriumDB.FileContactRow AddRecipToFile(docDB.RecipientRow r, bool save, string contactType) { FileManager fm = myA.FM; atriumDB.FileContactRow fcr = fm.GetFileContact().Add(r, contactType);; if (save) { BusinessProcess bp = fm.GetBP(); bp.AddForUpdate(fm.GetFileOffice()); bp.AddForUpdate(fm.GetPerson()); bp.AddForUpdate(fm.GetFileContact()); bp.AddForUpdate(fm.EFile); bp.Update(); } return(fcr); }
private void ImportNode(appDB.IssueDataTable tempIssues, appDB.IssueRow ir, appDB.IssueRow parentIssue, int rootFileId) { //this will recreate the issue structure //it does not try to synchronize it //only to be used to setup test data appDB.IssueRow newIR = (appDB.IssueRow)Add(null); newIR.ParentIssueId = parentIssue.IssueId; newIR.IssueNameEng = ir.IssueNameEng; newIR.IssueNameFre = ir.IssueNameFre; newIR.SortByFileNumber = ir.SortByFileNumber; //create file FileManager myFile = myA.CreateFile(myA.GetFile(rootFileId)); myFile.CurrentFile.NameE = newIR.IssueNameEng; myFile.CurrentFile.NameF = newIR.IssueNameFre; BusinessProcess bp = myA.GetBP(); bp.AddForUpdate(myFile.EFile); bp.AddForUpdate(myFile.GetFileXRef()); bp.AddForUpdate(myFile.GetFileOffice()); bp.AddForUpdate(myFile.GetFileContact()); bp.AddForUpdate(myFile.EFile); bp.Update(); if (!ir.IsFileIdNull()) { newIR.FileId = myFile.CurrentFile.FileId; } foreach (appDB.IssueRow cir in ir.GetIssueRows()) { ImportNode(tempIssues, cir, newIR, myFile.CurrentFileId); } }
public bool CanEditBF(DataRow ddr) { atriumDB.ActivityBFRow dr = (atriumDB.ActivityBFRow)ddr; if (!myA.IsVirtualFM && dr.FileId != myA.CurrentFile.FileId) { return(false); } if (dr.ActivityRow != null && dr.ActivityRow.EFileRow.RowState == DataRowState.Added) { return(true); } bool ok = myA.AtMng.SecurityManager.CanUpdate(dr.FileId, atSecurity.SecurityManager.Features.ActivityBF) > atSecurity.SecurityManager.LevelPermissions.No; if (!ok) { return(ok); } //fixed!!!! if (!dr.IsRoleCodeNull()) { if (myA.IsVirtualFM) { ok = true; } else { ok = false; if ((myA.AtMng.OfficeMng.GetOfficer().IsInRole(dr.RoleCode) || myA.GetFileContact().IsInRole(dr.RoleCode))) { //ok to keep ok = true; } else { //check buddies foreach (lmDatasets.officeDB.OfficerDelegateRow odr in myA.AtMng.OfficerLoggedOn.GetOfficerDelegateRowsByOfficerWorkAs()) { if (odr.AccessLevel == 1 & (myA.AtMng.OfficeMng.GetOfficer().IsInRole(dr.RoleCode, odr.OfficerId) || myA.GetFileContact().IsInRole(dr.RoleCode, odr.OfficerId))) { ok = true; } } } } } else if (!dr.IsBFOfficerIDNull()) { ok = false; //ok to keep if (dr.BFOfficerID == myA.AtMng.WorkingAsOfficer.OfficerId) { ok = true; } else { //check buddies foreach (lmDatasets.officeDB.OfficerDelegateRow odr in myA.AtMng.OfficerLoggedOn.GetOfficerDelegateRowsByOfficerWorkAs()) { if (odr.AccessLevel == 1 & odr.OfficerId == dr.BFOfficerID) { ok = true; } } } } else { ok = false; } //if they have override permission let them edit //override is used to override manual completes as well bool canOverride = myA.AtMng.SecurityManager.CanOverride(dr.FileId, atSecurity.SecurityManager.Features.ActivityBF) == atSecurity.SecurityManager.ExPermissions.Yes; return(ok | AllowEdit | canOverride); //old incomplete code follows //kept in case there is a bug above //if (myA.AtMng.OfficeLoggedOn.OfficeId == dr.ForOfficeId) //{ } //else if (!dr.IsRoleCodeNull() && (myA.AtMng.OfficeMng.GetOfficer().IsInRole(dr.RoleCode) | myA.GetFileContact().IsInRole(dr.RoleCode))) { } else if (dr.HasVersion(DataRowVersion.Original) && this.myA.AtMng.WorkingAsOfficer.OfficerId.ToString() == dr["BFOfficerID", DataRowVersion.Original].ToString()) { } else { DataColumn dc = dr.Table.Columns["BFOfficerID"]; if (dr.HasVersion(DataRowVersion.Original) && !dr.IsNull(dc, DataRowVersion.Original)) { if (this.myA.AtMng.OfficeMng.DB.Officer.FindByOfficerId(dr.BFOfficerID) != null) { } else { ok = false; //this.myA.RaiseError((int)AtriumEnum.AppErrorCodes.CACannotEditAnotherOffice); } } else { ok = false; //this.myA.RaiseError((int)AtriumEnum.AppErrorCodes.CACannotEditAnotherOffice); } } return(ok | AllowEdit); }
private bool IsEnabled(ActivityConfig.ACSeriesRow nextStep) { bool enable = true; //JLL 2018-04-23 //if (myFM.AtMng.SecurityManager.CanOverride(0, atSecurity.SecurityManager.Features.SysAdmin) == atSecurity.SecurityManager.ExPermissions.Yes) // return enable; if (!nextStep.IsRoleCodeNull()) { if (!myFM.AtMng.OfficeMng.GetOfficer().IsInRole(nextStep.RoleCode) & !myFM.GetFileContact().IsInRole(nextStep.RoleCode)) { enable = false; } ; } if (enable & (nextStep.ForAgent | nextStep.ForClient | nextStep.ForLead | nextStep.ForOwner)) { //get fileoffice row lmDatasets.atriumDB.FileOfficeRow[] fos = (lmDatasets.atriumDB.FileOfficeRow[])myFM.DB.FileOffice.Select("Fileid=" + myFM.CurrentFile.FileId.ToString() + " and OfficeId=" + myFM.AtMng.WorkingAsOfficer.OfficeId.ToString()); if (fos.Length != 1) { enable = false; } else { lmDatasets.atriumDB.FileOfficeRow fo = fos[0]; //check isowner etc. enable = false; if (nextStep.ForOwner & fo.IsOwner) { enable = true; } if (nextStep.ForLead & fo.IsLead) { enable = true; } if (nextStep.ForClient & fo.IsClient) { enable = true; } if (nextStep.ForAgent & fo.IsAgent) { enable = true; } } } return(enable); }
public static bool AllowedForRole(ActivityConfig.ACSeriesRow acsr, atriumManager atmng, FileManager fm) { if (!acsr.IsRoleCodeNull()) { if (atmng.OfficeMng.GetOfficer().IsInRole(acsr.RoleCode) || (fm != null && fm.GetFileContact().IsInRole(acsr.RoleCode))) { return(true); } else { return(false); } } else { return(true); } }
public void CreatePersonalFiles(int parentFileId, officeDB.OfficerRow or, bool useSeparatePersonalFiles) { //JLL: 2009/07/27 Note about CONVERSION // when creating personal files in Personnel Management file, structure should be: // Personnel Management // Officers // Role-Based Accounts //check to make sure myfileid is null //if (!or.IsMyFileIdNull()) // throw new AtriumException("File already created."); //check to make sure the officer has an account SecurityDB.secUserRow sur = myA.AtMng.SecurityManager.GetsecUser().GetSecUserForOfficer(or); try { //create my file FileManager myFile = myA.AtMng.CreateFile(myA.AtMng.GetFile(parentFileId)); myFile.CurrentFile.NameE = string.Format("{0}, {1} [{2}]", or.LastName, or.FirstName, or.OfficerCode); myFile.CurrentFile.FileType = "PR"; BusinessProcess bp = myA.GetBP(); bp.AddForUpdate(myFile.EFile); bp.AddForUpdate(myFile.GetFileXRef()); bp.AddForUpdate(myFile.GetFileOffice()); bp.AddForUpdate(myFile.GetFileContact()); bp.AddForUpdate(myFile.EFile); bp.Update(); //myFile.AtMng.AppMan.Commit(); or.MyFileId = myFile.CurrentFile.FileId; //break security inheritance myFile.EFile.BreakInherit(); //set new perms to this user and sysadmin? AddUserFileRule(sur.UserId, myFile.CurrentFile, (int)atSecurity.SpecialRules.MyPersonalFile); AddUserFileRule((int)atSecurity.SpecialGroups.Everyone, myFile.CurrentFile, (int)atSecurity.SpecialRules.ReadMail); //Create Setting For Below if (!useSeparatePersonalFiles) { or.InboxId = or.MyFileId; or.SentItemsId = or.MyFileId; } else { //create inbox FileManager inbox = myA.AtMng.CreateFile(myFile); inbox.CurrentFile.NameE = "Inbox"; inbox.CurrentFile.NameF = "Dossier corbeille arrivée"; BusinessProcess bpi = myA.GetBP(); bpi.AddForUpdate(inbox.EFile); bpi.AddForUpdate(inbox.GetFileXRef()); bpi.AddForUpdate(inbox.GetFileOffice()); bpi.AddForUpdate(inbox.GetFileContact()); bpi.AddForUpdate(inbox.EFile); bpi.Update(); or.InboxId = inbox.CurrentFile.FileId; //create sentitems FileManager sentItems = myA.AtMng.CreateFile(myFile); sentItems.CurrentFile.NameE = "Sent Items"; sentItems.CurrentFile.NameF = "Dossier corbeille envoyée"; BusinessProcess bpsi = myA.GetBP(); bpsi.AddForUpdate(sentItems.EFile); bpsi.AddForUpdate(sentItems.GetFileXRef()); bpsi.AddForUpdate(sentItems.GetFileOffice()); bpsi.AddForUpdate(sentItems.GetFileContact()); bpsi.AddForUpdate(sentItems.EFile); bpsi.Update(); or.SentItemsId = sentItems.CurrentFile.FileId; } //create shortcuts FileManager shortcuts = myA.AtMng.CreateFile(myFile); shortcuts.CurrentFile.NameE = "My Shortcuts"; shortcuts.CurrentFile.NameF = "Dossier de raccourcis"; shortcuts.CurrentFile.MetaType = "SC"; BusinessProcess bpsc = myA.GetBP(); bpsc.AddForUpdate(shortcuts.EFile); bpsc.AddForUpdate(shortcuts.GetFileXRef()); bpsc.AddForUpdate(shortcuts.GetFileOffice()); bpsc.AddForUpdate(shortcuts.GetFileContact()); bpsc.AddForUpdate(shortcuts.EFile); bpsc.Update(); or.ShortcutsId = shortcuts.CurrentFile.FileId; } catch (Exception x) { //myA.AtMng.AppMan.Rollback(); throw x; } }