Skip to content

Commit

Permalink
some more api work
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Mill committed Nov 5, 2015
1 parent 8d4a295 commit 79fa604
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 40 deletions.
Binary file added API_REF.xlsx
Binary file not shown.
29 changes: 29 additions & 0 deletions TeamDBAwesome/TeamDBAwesome/Controllers/GetCustomerController.cs
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;

namespace TeamDBAwesome.Controllers
{
public class GetCustomerController : ApiController
{
// GET: api/GetCustomer
public HttpResponseMessage Get(int PersonID)
{
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK);

MySqlService sql = new MySqlService();

Customer customer = sql.GetCustomer(PersonID);

//next I need to JSON stringify customer and return it in the message

return message;
}

}
}
39 changes: 0 additions & 39 deletions TeamDBAwesome/TeamDBAwesome/Controllers/ValuesController.cs

This file was deleted.

16 changes: 16 additions & 0 deletions TeamDBAwesome/TeamDBAwesome/SqlService/MySqlService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,21 @@ public bool AddNewUser(Customer newCust)


}

public Customer GetCustomer(int PersonID)
{
bool open = this.OpenConnection();
Customer customer = new Customer();

if(open == true)
{
return customer;
}
else
{
return customer;
}

}
}
}
3 changes: 2 additions & 1 deletion TeamDBAwesome/TeamDBAwesome/TeamDBAwesome.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="Views\GetCustomer\" />
</ItemGroup>
<ItemGroup>
<Compile Include="App_Start\BundleConfig.cs" />
Expand Down Expand Up @@ -160,8 +161,8 @@
<Compile Include="Areas\HelpPage\SampleGeneration\SampleDirection.cs" />
<Compile Include="Areas\HelpPage\SampleGeneration\TextSample.cs" />
<Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" />
<Compile Include="Controllers\GetCustomerController.cs" />
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\ValuesController.cs" />
<Compile Include="Controllers\NewCustomerController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
Expand Down
4 changes: 4 additions & 0 deletions TeamDBAwesome/TeamDBAwesome/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,9 @@
<p ng-hide="active">Please click a menu item</p>
<p ng-show="active">You chose <b>{{active}}</b></p>
</div>

<script src="js/HolderService.js"></script>

</body>

</html>

0 comments on commit 79fa604

Please sign in to comment.