public ActionResult Delete(int ID) { List <Ledger> LedgerList = Ledger.GetAll(); LedgerList = LedgerList.FindAll(x => x.OrgId == ID); List <BalanceStatement> BList = BalanceStatement.GetByOrgId(ID); BList = BList.FindAll(x => x.OrgId == ID); List <Commission> CommissionList = Commission.GetAllCommissions(); CommissionList = CommissionList.FindAll(x => x.OrgId == ID); List <Sale> SList = Sale.GetAllSales(); SList = SList.FindAll(x => x.OrgId == ID); List <Accounts> AccountList = Accounts.GetAll(); AccountList = AccountList.FindAll(x => x.AOrgId == ID); List <Accounts> AccountDetailsList = Accounts.GetAllDetails(); AccountList = AccountList.FindAll(x => x.ADOrgId == ID); // List<Receipt> ReceiptList = Receipt.GetAllList(ID,0); if (LedgerList != null) { int i = Ledger.Dell(ID); } if (BList != null) { int i = BalanceStatement.Dell(ID); } if (CommissionList != null) { int i = Commission.Dell(ID); } if (SList != null) { int i = Sale.Dell(ID); } if (AccountList != null) { int i = Accounts.Dell(ID); } if (AccountDetailsList != null) { int i = Accounts.DellAccountDetails(ID); } //if(ReceiptList!=null) //{ // int i = Receipt.Dell(ID); //} return(Json(new { data = "1" }, JsonRequestBehavior.AllowGet)); }