Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert "Revert "added update user""
This reverts commit 892b6e6.
  • Loading branch information
sec11008 committed Dec 2, 2015
1 parent 892b6e6 commit f3316ec
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
@@ -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;
}
}
}
1 change: 1 addition & 0 deletions TeamDBAwesome/TeamDBAwesome/TeamDBAwesome.csproj
Expand Up @@ -169,6 +169,7 @@
<Compile Include="Controllers\NewCustomerController.cs" />
<Compile Include="Controllers\SearchController.cs" />
<Compile Include="Controllers\TestController.cs" />
<Compile Include="Controllers\UpdateCustomerController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
Expand Down

0 comments on commit f3316ec

Please sign in to comment.