Update to new namespace Entities
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using MistoxWebsite.Shared;
|
||||
using MistoxWebsite.Server.Entities;
|
||||
using MySql.Data.MySqlClient;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using MistoxWebsite.Shared;
|
||||
using MistoxWebsite.Server.Entities;
|
||||
using MySql.Data.MySqlClient;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using MistoxWebsite.Shared;
|
||||
using MistoxWebsite.Server.Entities;
|
||||
using MySql.Data.MySqlClient;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using MistoxWebsite.Shared;
|
||||
using MistoxWebsite.Server.Entities;
|
||||
using MySql.Data.MySqlClient;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace MistoxWebsite.Server.Services.DatabaseService {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using MistoxWebsite.Shared;
|
||||
using MistoxWebsite.Server.Entities;
|
||||
using MySql.Data.MySqlClient;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using MistoxWebsite.Shared;
|
||||
using MistoxWebsite.Server.Entities;
|
||||
using MySql.Data.MySqlClient;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using MistoxWebsite.Shared;
|
||||
using MistoxWebsite.Server.Entities;
|
||||
using MySql.Data.MySqlClient;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
@@ -46,8 +46,8 @@ namespace MistoxWebsite.Server.Services.DatabaseService {
|
||||
return receipts;
|
||||
}
|
||||
|
||||
public async Task<List<ReceiptProduct>> GetAllReceiptsJoinedToProduct( Account account ) {
|
||||
List<ReceiptProduct> join = new List<ReceiptProduct> ();
|
||||
public async Task<List<( Receipt, Product )>> GetAllReceiptsJoinedToProduct( Account account ) {
|
||||
List<( Receipt, Product )> join = new();
|
||||
using( MySqlConnection connection = GetConnection() ) {
|
||||
connection.Open();
|
||||
string command = @"
|
||||
@@ -78,24 +78,25 @@ namespace MistoxWebsite.Server.Services.DatabaseService {
|
||||
int _cost = !reader.IsDBNull( "Cost" ) ? reader.GetInt32("Cost") : 0;
|
||||
string _url = !reader.IsDBNull( "URL" ) ? reader.GetString("URL") : "Something Random That Wont Ever Be In A URL";
|
||||
|
||||
join.Add( new ReceiptProduct() {
|
||||
receipt = new Receipt {
|
||||
AccountID = _accountid,
|
||||
ProductID = _gameid,
|
||||
ReceiptID = _receiptid,
|
||||
Time = _receiptdate,
|
||||
TotalCost = _totalcost,
|
||||
TaxAmount = _taxamount,
|
||||
LineItem = _lineitem
|
||||
},
|
||||
product = new Product() {
|
||||
ID = _id,
|
||||
Cost = _cost,
|
||||
Description = _desc,
|
||||
Name = _name,
|
||||
URL = _url
|
||||
}
|
||||
} );
|
||||
Receipt r = new() {
|
||||
AccountID = _accountid,
|
||||
ProductID = _gameid,
|
||||
ReceiptID = _receiptid,
|
||||
Time = _receiptdate,
|
||||
TotalCost = _totalcost,
|
||||
TaxAmount = _taxamount,
|
||||
LineItem = _lineitem
|
||||
};
|
||||
|
||||
Product p = new() {
|
||||
ID = _id,
|
||||
Cost = _cost,
|
||||
Description = _desc,
|
||||
Name = _name,
|
||||
URL = _url
|
||||
};
|
||||
|
||||
join.Add( (r, p) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using MistoxWebsite.Shared;
|
||||
using MistoxWebsite.Server.Entities;
|
||||
using MySql.Data.MySqlClient;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
|
||||
Reference in New Issue
Block a user