This commit is contained in:
Илья Федотов 2024-06-01 06:49:45 +04:00
commit 80f101fd23
6 changed files with 16 additions and 8 deletions

View File

@ -29,7 +29,7 @@ namespace ElectronicsShopBusinessLogic.BusinessLogic
var record = new ReportPaymeantsViewModel
{
PaymeantID=paymeant.ID,
//ProductID=paymeant.ProductID,
ClientID=paymeant.ClientID,
OrderID=paymeant.OrderID,
PayOption=paymeant.PayOption,
SumPayment=paymeant.SumPayment,

View File

@ -11,7 +11,7 @@ namespace ElectronicsShopContracts.ViewModels
{
public int PaymeantID { get; set; }
public int ProductID { get; set; }
public int ClientID { get; set; }
public int OrderID { get; set; }
public double SumPayment { get; set; }

View File

@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ElectronicsShopDataBaseImplement.Migrations
{
[DbContext(typeof(Database))]
[Migration("20240601012156_InitMigration")]
partial class InitMigration
[Migration("20240601013228_Init")]
partial class Init
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)

View File

@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace ElectronicsShopDataBaseImplement.Migrations
{
/// <inheritdoc />
public partial class InitMigration : Migration
public partial class Init : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)

View File

@ -66,5 +66,15 @@ namespace ElectronicsShopRestAPI.Controllers {
_logger.LogError(ex, "Ошибка создания оплаты");
}
}
[HttpGet]
public List<PaymeantViewModel>? GetPaymeants(int _clientID) {
try {
return _payLogic?.ReadList(new PaymeantSearchModel { ClientID = _clientID });
}
catch (Exception ex) {
_logger.LogError(ex, $"Ошибка получения списка оплат клиента id = {_clientID}");
throw;
}
}
}
}

View File

@ -30,9 +30,7 @@ namespace ElectronicsShopUserApp.Controllers {
if (APIClient.Client == null) {
return Redirect("~/Home/Enter");
}
var view = APIClient.GetRequset<List<PaymeantViewModel>>($"api/main/getpaymeants?_clientid={APIClient.Client.ID}");
return View(view);
return View(APIClient.GetRequset<List<PaymeantViewModel>>($"api/client/getpaymeants?_clientid={APIClient.Client.ID}"));
}
[HttpGet]