Example #1
0
        public bool InactivateSurveyDetail(BirdSurveyDetails item)
        {
            bool result = false;

            try
            {
                using (RCID_DWHEntities context = new RCID_DWHEntities())
                {
                    Bird_SurveyDetail efItem = context.Bird_SurveyDetail.Where(b => b.SurveyID == item.SurveyID && b.SpeciesID == item.SpeciesID).FirstOrDefault();

                    if (efItem == null)
                    {
                        return(result);
                    }

                    efItem.SurveyDetailActive = false;

                    if (context.SaveChanges() > 0)
                    {
                        result = true;
                    }
                }
            }
            catch (Exception) { }
            return(result);
        }
Example #2
0
        public bool CreateSurveyDetail(BirdSurveyDetails item)
        {
            bool result = false;

            try
            {
                using (RCID_DWHEntities context = new RCID_DWHEntities())
                {
                    Bird_SurveyDetail efItem = new Bird_SurveyDetail()
                    {
                        SurveyID          = item.SurveyID,
                        SpeciesID         = item.SpeciesID,
                        SurveyDetailCount = item.SurveyDetailCount
                    };

                    context.Bird_SurveyDetail.Add(efItem);

                    if (context.SaveChanges() > 0)
                    {
                        return(true);
                    }
                }
            }
            catch (Exception e) { throw e; }
            return(result);
        }