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
added update user
- Loading branch information
Jeremy Mill
committed
Nov 30, 2015
1 parent
bcc30ef
commit 25c5fc9
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
TeamDBAwesome/TeamDBAwesome/Controllers/UpdateCustomerController.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,31 @@ | ||
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 UpdateCustomerController : ApiController | ||
{ | ||
// GET api/NewCustomer/a JSON object rep of a customer | ||
/// <summary> | ||
/// Adds new customer to the Database | ||
/// </summary> | ||
/// <param name="customer">an instance of the customer data model</param> | ||
/// <returns>a response with OK and the body is the new customer ID</returns> | ||
public HttpResponseMessage Post([FromBody] Customer customer) | ||
{ | ||
MySqlService dbService = new MySqlService(); | ||
|
||
|
||
dbService.UpdateCustomer(customer); | ||
HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); | ||
response.Content = new StringContent("0"); | ||
return response; | ||
} | ||
} | ||
} |
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