Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
more APIs
- Loading branch information
Jeremy Mill
committed
Dec 6, 2015
1 parent
94b4892
commit 83249db
Showing
4 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
TeamDBAwesome/TeamDBAwesome/Controllers/AddPlaylistController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Net.Http; | ||
using System.Web.Http; | ||
using TeamDBAwesome.Models; | ||
using TeamDBAwesome.SqlService; | ||
|
||
namespace TeamDBAwesome.Controllers | ||
{ | ||
public class AddPlaylistController : ApiController | ||
{ | ||
public HttpResponseMessage Get(string playlistname) | ||
{ | ||
MySqlService dbService = new MySqlService(); | ||
|
||
int newID = dbService.NewPlaylist(playlistname); | ||
|
||
HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); | ||
response.Content = new StringContent(newID.ToString()); | ||
return response; | ||
|
||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
TeamDBAwesome/TeamDBAwesome/Controllers/DropPlaylistController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Net.Http; | ||
using System.Web.Http; | ||
using TeamDBAwesome.Models; | ||
using TeamDBAwesome.SqlService; | ||
|
||
namespace TeamDBAwesome.Controllers | ||
{ | ||
public class DropPlaylistController : ApiController | ||
{ | ||
public HttpResponseMessage Get(int PlaylistID) | ||
{ | ||
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK); | ||
|
||
MySqlService sql = new MySqlService(); | ||
|
||
int succ = sql.DropPlaylist(PlaylistID); | ||
|
||
message.Content = new StringContent(succ.ToString()); | ||
|
||
return message; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters