-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new user isn't working yet, but it will be
- Loading branch information
Jeremy Mill
committed
Nov 8, 2015
1 parent
79fa604
commit 9418def
Showing
3 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
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,51 @@ | ||
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 TestController : ApiController | ||
{ | ||
// GET: api/Test | ||
public HttpResponseMessage Get() | ||
{ | ||
//make a test customer | ||
Customer test = new Customer(); | ||
test.Address = "test"; | ||
test.City = "test"; | ||
test.Company = "test"; | ||
test.Country = "test"; | ||
test.CustomerID = 0; | ||
test.Email = "test@test.com"; | ||
test.Fax = "9109153999"; | ||
test.FName = "test"; | ||
test.LName = "test"; | ||
test.PersonID = 0; | ||
test.Phone = "9109153999"; | ||
test.Post = "06066"; | ||
test.State = "CT"; | ||
test.SupportRepId = 0; | ||
|
||
//make an instance of the sql controller | ||
MySqlService sqlS = new MySqlService(); | ||
//try and add the new user | ||
int ID = sqlS.AddNewUser(test); | ||
|
||
|
||
|
||
//return an OK with the int of the new user | ||
HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); | ||
response.Content = new StringContent(ID.ToString()); | ||
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
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