예제 #1
0
파일: Items.cs 프로젝트: OSRS/Oncor_Base
 internal static bool Verify(IEnumerable <Tuple <CompoundIdentity, string, string> > items, BundleDataType type, UserSecurityContext ctx)
 {
     if (type == BundleDataType.TaxaUnit)
     {
         ITaxaUnitProvider tprov = TaxonomyManager.Instance.GetTaxaUnitProvider(ctx);
         if (tprov != null)
         {
             foreach (Tuple <CompoundIdentity, string, string> cur in items)
             {
                 if (!tprov.Exists(cur.Item1))
                 {
                     return(false);
                 }
             }
             return(true);
         }
     }
     else if (type == BundleDataType.Site)
     {
         ISiteProvider sprov = SiteManager.Instance.GetSiteProvider(ctx);
         if (sprov != null)
         {
             foreach (Tuple <CompoundIdentity, string, string> cur in items)
             {
                 if (!sprov.Exists(cur.Item1))
                 {
                     return(false);
                 }
             }
             return(true);
         }
     }
     else if (type == BundleDataType.Instrument)
     {
         IInstrumentProvider iprov = InstrumentManager.Instance.GetInstrumentProvider(ctx);
         if (iprov != null)
         {
             foreach (Tuple <CompoundIdentity, string, string> cur in items)
             {
                 if (!iprov.Exists(cur.Item1))
                 {
                     return(false);
                 }
             }
             return(true);
         }
     }
     return(false);
 }