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
generate invoice now removes order and ordertracks from that order
- Loading branch information
Jeremy Mill
committed
Dec 7, 2015
1 parent
500f48e
commit bb59370
Showing
4 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
TeamDBAwesome/TeamDBAwesome/Controllers/GetCustomerInvoiceController.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; | ||
|
||
namespace TeamDBAwesome.Controllers | ||
{ | ||
public class GetCustomerInvoiceController : ApiController | ||
{ | ||
public HttpResponseMessage Get(int custId) | ||
{ | ||
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK); | ||
|
||
MySqlService sql = new MySqlService(); | ||
|
||
List<Invoice> invoiceList = new List<Invoice>(); | ||
|
||
int nextInvoice = sql.createInvoice(custId, payId, orderId); | ||
|
||
message.Content = new StringContent(nextInvoice.ToString()); | ||
|
||
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
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.Web; | ||
|
||
namespace TeamDBAwesome.Models | ||
{ | ||
public class Invoice | ||
{ | ||
public int invoiceId { get; set; } | ||
public int customerId { get; set; } | ||
public DateTime invoiceDate { get; set; } | ||
public string address { get; set; } | ||
public string city { get; set; } | ||
public string state { get; set; } | ||
public string country { get; set; } | ||
public string post { get; set; } | ||
public float total { get; set; } | ||
public Payment payment { get; set; } | ||
|
||
public Invoice() | ||
{ | ||
payment = new Payment(); | ||
} | ||
|
||
} | ||
} |
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