public void DeleteFromDatabase(MainDataContext db, Models.Admin AdminUser)
        {
            foreach (CRM_CalendarVenue venue in this.CRM_CalendarVenues)
            {
                venue.DeleteFromDatabase(db, AdminUser);
            }

            foreach (CRM_CalendarInvite invite in this.CRM_CalendarInvites)
            {
                db.CRM_CalendarInvites.DeleteOnSubmit(invite);
            }

            foreach (CRM_CalendarAdmin admin in this.CRM_CalendarAdmins)
            {
                db.CRM_CalendarAdmins.DeleteOnSubmit(admin);
            }

            foreach (CRM_CalendarAttendance admin in this.CRM_CalendarAttendances)
            {
                db.CRM_CalendarAttendances.DeleteOnSubmit(admin);
            }

            db.CRM_CalendarCPDs.DeleteAllOnSubmit(this.CRM_CalendarCPDs);
            db.CRM_CalendarGroupBookings.DeleteAllOnSubmit(this.CRM_CalendarGroupBookings);
            db.CRM_CalendarOutreaches.DeleteAllOnSubmit(this.CRM_CalendarOutreaches);
            db.CRM_CalendarParties.DeleteAllOnSubmit(this.CRM_CalendarParties);
            db.CRM_CalendarPerHeads.DeleteAllOnSubmit(this.CRM_CalendarPerHeads);
            db.CRM_Tasks.DeleteAllOnSubmit(this.CRM_Tasks);
            db.CRM_CalendarAdmins.DeleteAllOnSubmit(this.CRM_CalendarAdmins);


            History.History.RecordLinqDelete(AdminUser, this);
            db.CRM_Calendars.DeleteOnSubmit(this);
            db.SubmitChanges();
        }
Exemplo n.º 2
0
 public void DeleteFromDatabase(MainDataContext db, Models.Admin AdminUser)
 {
     CRM.Code.History.History.RecordLinqDelete(AdminUser, this);
     db.CRM_CalendarVenues.DeleteOnSubmit(this);
     db.SubmitChanges();
 }