Example #1
0
        public override bool Delete(SampleEventMap map, bool fileOnly)
        {
            if (map != null)
            {
                SampleEventMapItem id = map.Get(KnownDetType.Fish);
                if (id != null)
                {
                    IFileStoreProvider p = FileStore;
                    if (p != null)
                    {
                        ICatchEffortProvider wqProv = FishManager.Instance.GetCatchEffortProvider(this.Context);
                        if (wqProv != null && wqProv.CanDelete())
                        {
                            if (p.Delete(id.DetId))
                            {
                                if (fileOnly)
                                {
                                    return(true);
                                }
                                return(DeleteData(map));
                            }
                        }
                    }
                }
            }

            return(false);
        }
Example #2
0
        private bool DeleteData(SampleEventMap map)
        {
            ICatchEffortProvider wqProv = FishManager.Instance.GetCatchEffortProvider(this.Context);

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