Exemple #1
0
        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);
        }
Exemple #2
0
 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);
     }
 }