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
gen invoice is in this, but isn't done, others are (or should be)
- Loading branch information
Jeremy Mill
committed
Dec 7, 2015
1 parent
6b4334d
commit 5146755
Showing
6 changed files
with
258 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
TeamDBAwesome/TeamDBAwesome/Controllers/AddTrackOrderController.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,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Net.Http; | ||
using System.Web.Http; | ||
using TeamDBAwesome.SqlService; | ||
|
||
namespace TeamDBAwesome.Controllers | ||
{ | ||
public class AddTrackOrderController : ApiController | ||
{ | ||
public HttpResponseMessage Get(int trackId, int orderId) | ||
{ | ||
MySqlService dbService = new MySqlService(); | ||
|
||
int result = dbService.AddTrackOrer(orderId, trackId); | ||
|
||
HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); | ||
response.Content = new StringContent(result.ToString()); | ||
return response; | ||
|
||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
TeamDBAwesome/TeamDBAwesome/Controllers/GenerateInvoiceController.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 GenerateInvoiceController : ApiController | ||
{ | ||
public HttpResponseMessage Get(int custId, int payId, int orderId) | ||
{ | ||
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK); | ||
|
||
MySqlService sql = new MySqlService(); | ||
|
||
int nextInvoice = sql.createInvoice(custId, payId, orderId); | ||
|
||
message.Content = new StringContent(nextInvoice.ToString()); | ||
|
||
return message; | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
TeamDBAwesome/TeamDBAwesome/Controllers/GetCustomerOrdersController.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,29 @@ | ||
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; | ||
using Newtonsoft.Json; | ||
|
||
namespace TeamDBAwesome.Controllers | ||
{ | ||
public class GetCustomerOrdersController : ApiController | ||
{ | ||
public HttpResponseMessage Get(int customerId) | ||
{ | ||
MySqlService dbService = new MySqlService(); | ||
|
||
List<int> orderList = dbService.customerOrders(customerId); | ||
string serialzed = JsonConvert.SerializeObject(orderList); | ||
|
||
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK); | ||
message.Content = new StringContent(serialzed); | ||
|
||
return message; | ||
|
||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
TeamDBAwesome/TeamDBAwesome/Controllers/GetOrderTracksController.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,29 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Net.Http; | ||
using System.Web.Http; | ||
using TeamDBAwesome.SqlService; | ||
using TeamDBAwesome.Models; | ||
using Newtonsoft.Json; | ||
|
||
namespace TeamDBAwesome.Controllers | ||
{ | ||
public class GetOrderTracksController : ApiController | ||
{ | ||
public HttpResponseMessage Get(int orderId) | ||
{ | ||
MySqlService dbService = new MySqlService(); | ||
|
||
List<Track> trackList = dbService.getOrderTracks(orderId); | ||
string serialzed = JsonConvert.SerializeObject(trackList); | ||
|
||
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK); | ||
message.Content = new StringContent(serialzed); | ||
|
||
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