public ActionResult DeleteConfirmed(int ListHeaderID) { listheader listheader = ListHeaderRepository.GetListHeaderByID(ListHeaderID); ListHeaderRepository.DeleteRecord(listheader); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int ListTableID) { listtable listtable = ListTableRepository.GetListByID(ListTableID); IEnumerable <listitem> litems = ListItemRepository.GetAllListItemByListTable(ListTableID); ListItemRepository.DeleteAllRecords(litems); listheader header = ListHeaderRepository.GetByListTableID(ListTableID); ListHeaderRepository.DeleteRecord(header); ListTableRepository.DeleteRecord(listtable); //return RedirectToAction("List"); return(Content("Table deleted successfully")); }