示例#1
0
 //deletes a user and all related songs, comments and likes.
 public static bool DeleteUser(int id)
 {
     try
     {
         AudioFiles.DeleteAllFileOfUser(id);
         Comments.DeleteAllCommentsOfUser(id);
         Likes.DeleteAllLikesOfUser(id);
         string sql = string.Format("DELETE FROM USERS WHERE ID={0}", id);
         Dal.ExecuteNonQuery(sql);
     }
     catch (Exception e)
     {
         return(false);
     }
     return(true);
 }