public ActionResult Del(IEnumerable <long> ids) { WorkV3.ViewModels.AjaxResponseViewModel response = new WorkV3.ViewModels.AjaxResponseViewModel(); try { List <long> CardIDList = new List <long>(); foreach (long ZoneID in ids) { var zoneModel = WorkV3.Areas.Backend.Models.DataAccess.ZonesDAO.GetByNo(ZoneID); if (zoneModel != null) { var cardModels = WorkV3.Areas.Backend.Models.DataAccess.CardsDAO.GetZoneData(zoneModel.SiteID, zoneModel.No); if (cardModels != null && cardModels.Count > 0) { CardIDList.AddRange(cardModels.Select(c => c.No)); } } } CommonDA.Delete("Cards", "No", CardIDList); CommonDA.Delete("Zones", "No", ids); } catch (Exception ex) { response.Success = false; } return(Json(response)); }
public static void Delete(IEnumerable <long> IDs) { CommonDA.Delete(TableName, IDs); }