public ActionResult Delete(DeleteConfirmInput input) { var items = ITranslation.GetTranslationByTextID(input.TextId).ToList(); ITranslationArchive.InsertDeletedRecords(input.TextId); //Delete the corresponding range in db ITranslation.DeleteRange(input.TextId); foreach (var item in items) { var vote = IVotes.GetVoteByTranslationID(item.Id); if (vote != null) { IVotes.Delete(int.Parse(vote.Id.ToString())); } } ITranslation_Log.DeleteRange(input.TextId); return(Json(new { Id = input.TextId })); }