Update to new namespace Entities

This commit is contained in:
2025-06-20 17:41:23 -07:00
parent dfbd2223cb
commit 3d4c9d8cd9
11 changed files with 82 additions and 105 deletions
@@ -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;