예제 #1
0
        internal bool CanDelete(CompoundIdentity catchEffortId)
        {
            if (this.CanDelete())
            {
                if (!catchEffortId.Equals(lastCatchEffortId))
                {
                    this.lastCatchEffortId = catchEffortId;
                    CatchEffort depl = this.Get(catchEffortId);
                    if (depl != null)
                    {
                        this.lastEditPermission = this.CanDelete(depl);
                    }
                    else // can't get the effort, so it will always fail
                    {
                        this.lastEditPermission = false;
                    }

                    return(this.lastEditPermission);
                }
                else
                {
                    return(this.lastEditPermission); //same as last check
                }
            }
            return(false);
        }
예제 #2
0
        internal bool CanDelete(CompoundIdentity vegSurveyId)
        {
            if (this.CanDelete())
            {
                if (!vegSurveyId.Equals(lastVegSurveyId))
                {
                    this.lastVegSurveyId = vegSurveyId;
                    VegSurvey depl = this.GetSurvey(vegSurveyId);
                    if (depl != null)
                    {
                        this.lastEditPermission = this.CanDelete(depl);
                    }
                    else // can't get the effort, so it will always fail
                    {
                        this.lastEditPermission = false;
                    }

                    return(this.lastEditPermission);
                }
                else
                {
                    return(this.lastEditPermission); //same as last check
                }
            }
            return(false);
        }
예제 #3
0
 public string GetArchetypeType(CompoundIdentity archetypeId)
 {
     if (archetypeId != null)
     {
         if (archetypeId.Equals(Archetypes.SimpleTrapDredge.id))
         {
             return("SimpleTrapDredge");
         }
         else if (archetypeId.Equals(Archetypes.StandardMeshNet.id))
         {
             return("StandardMeshNet");
         }
         else if (archetypeId.Equals(Archetypes.StandardPlanktonNet.id))
         {
             return("StandardPlanktonNet");
         }
         else if (archetypeId.Equals(Archetypes.WingedBagNet.id))
         {
             return("WingedBagNet");
         }
     }
     return(null);
 }
예제 #4
0
 //Methods for InstrumentArchetypeInstances
 public IArchetype AddInstrumentArchetype(CompoundIdentity instrumentId, CompoundIdentity archetypeId)
 {
     if (instrumentId != null && archetypeId != null)
     {
         if (archetypeId.Equals(Archetypes.SimpleTrapDredge.id))
         {
             return(this.AddSimpleTrapDredge(instrumentId));
         }
         else if (archetypeId.Equals(Archetypes.StandardMeshNet.id))
         {
             return(this.AddStandardMeshNet(instrumentId));
         }
         else if (archetypeId.Equals(Archetypes.StandardPlanktonNet.id))
         {
             return(this.AddStandardPlanktonNet(instrumentId));
         }
         else if (archetypeId.Equals(Archetypes.WingedBagNet.id))
         {
             return(this.AddWingedBagNet(instrumentId));
         }
     }
     return(null);
 }
예제 #5
0
 private static bool HasAffiliation(UserSecurityContext user, CompoundIdentity prOrgId)
 {
     if (user != null && prOrgId != null)
     {
         UserProvider up = UserAffilationSecurityManager.Instance.GetProvider(user);
         if (up != null)
         {
             IEnumerable <CompoundIdentity> ids = up.UserAffiliations();
             if (ids != null)
             {
                 foreach (CompoundIdentity cur in ids)
                 {
                     if (prOrgId.Equals(cur))
                     {
                         return(true);
                     }
                 }
             }
         }
     }
     return(false);
 }