public static string deletegroup(int cpId) { try { using (var db = new hoccattocEntities()) { var cp = new group() { id = cpId }; db.Entry(cp).State = EntityState.Deleted; db.SaveChanges(); } return(string.Empty); } catch (Exception ex) { return("Thất bại: " + ex.Message); } }