Exemple #1
0
        public ActionResult DeleteCustomer(int id)
        {
            Customers    customer = customerBLL.GetCustomer(id);
            List <Notes> notes    = notesBLL.GetNotes(id);

            foreach (Notes item in notes)
            {
                notesBLL.DeleteNote(item.NoteID);
            }
            List <Leads> leads = leadsBLL.GetLeads(id);

            foreach (Leads item in leads)
            {
                leadsBLL.DeleteLead(item.LeadID);
            }
            customerBLL.DeleteCustomers(customer);

            return(RedirectToAction("Index"));
        }