Exemplo n.º 1
0
        public override bool Delete(SampleEventMap map, bool fileOnly)
        {
            if (map != null)
            {
                SampleEventMapItem id = map.Get(KnownDetType.Veg);
                if (id != null)
                {
                    IFileStoreProvider p = FileStore;
                    if (p != null)
                    {
                        IVegSurveyProvider srvProv = VegetationManager.Instance.GetSurveyProvider(this.Context);
                        if (srvProv != null && srvProv.CanDelete())
                        {
                            if (p.Delete(id.DetId))
                            {
                                if (fileOnly)
                                {
                                    return(true);
                                }
                                return(DeleteData(map));
                            }
                        }
                    }
                }
            }

            return(false);
        }
Exemplo n.º 2
0
        private bool DeleteData(SampleEventMap map)
        {
            IVegSurveyProvider srvProv = VegetationManager.Instance.GetSurveyProvider(this.Context);

            if (srvProv != null && srvProv.CanDelete())
            {
                IEnumerable <VegSurvey> deploys = srvProv.GetForSampleEvent(map.SampleEventId);
                foreach (VegSurvey cur in deploys)
                {
                    srvProv.Delete(cur);
                }
                return(true);
            }
            return(false);
        }