Exemple #1
0
        /// <summary>
        /// Removes the inspection.  Note: this does not delete the inspection from a checklist in memory.
        /// That has to be handled by the calling code.
        /// </summary>
        /// <param name="inspection"></param>
        public static void DeleteInspection(Inspection inspection)
        {
            //Before calling: warn them that this is permanent.

            //delete all inspector linkages from memory (not the inspectors themselves)
            foreach (Inspector inspector in inspection.inspectors)
            {
                if (inspector.inspections.Contains(inspection))
                {
                    inspector.inspections.Remove(inspection);
                }
            }
            //delete inspection and children from DB.
            App.database.DeleteInspection(inspection);


            //After calling: Call reset inspections on the checklist page
        }