Прикол

This commit is contained in:
Programmist73 2023-05-18 21:58:16 +04:00
commit b8554342d2
51 changed files with 308 additions and 109 deletions

View File

@ -3,12 +3,15 @@ using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.BusinessLogicsContracts;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.StoragesContracts;
using BankYouBankruptContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptContracts.ViewModels.Client.Diagram;
using BankYouBankruptDataModels.Enums;
using DocumentFormat.OpenXml.Drawing;
namespace BankYouBankruptBusinessLogic.BusinessLogics
{
@ -17,11 +20,16 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics
private readonly ILogger _logger;
private readonly ICardStorage _cardStorage;
private readonly IAccountStorage _accountStorage;
private readonly IDebitingLogic _debitingLogic;
private readonly ICreditingLogic _creditingLogic;
public CardLogic(ILogger<CardLogic> logger, ICardStorage cardStorage, IAccountStorage accountStorage) {
public CardLogic(ILogger<CardLogic> logger, ICardStorage cardStorage, IAccountStorage accountStorage,
IDebitingLogic debitingLogic, ICreditingLogic creditingLogic) {
_logger = logger;
_cardStorage = cardStorage;
_accountStorage = accountStorage;
_debitingLogic = debitingLogic;
_creditingLogic = creditingLogic;
}
public bool Create(CardBindingModel model)
@ -88,6 +96,31 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics
return true;
}
public List<ClientDiagramElementsViewModel> GetMonthInfo(int CardId) {
Dictionary<(int?, int?), int> debitings = _debitingLogic.ReadList(new DebitingSearchModel()
{
CardId = CardId,
Status = StatusEnum.Закрыта
}).GroupBy(x => new { x.DateClose?.Month, x.DateClose?.Year })
.Select(x => new { x.Key.Month, x.Key.Year, Sum = x.Select(y => y.Sum).Sum()}).ToDictionary(x => (x.Month, x.Year), x => (x.Sum));
Dictionary<(int?, int?), int> creditings = _creditingLogic.ReadList(new CreditingSearchModel()
{
CardId = CardId,
Status = StatusEnum.Закрыта
}).GroupBy(x => new { x.DateClose?.Month, x.DateClose?.Year })
.Select(x => new { x.Key.Month, x.Key.Year, Sum = x.Select(y => y.Sum).Sum() }).ToDictionary(x => (x.Month, x.Year), x => (x.Sum));
List<ClientDiagramElementsViewModel> result = new();
foreach (var key in debitings.Keys.Union(creditings.Keys)) {
int sum = 0;
if (debitings.ContainsKey(key)) sum -= debitings.GetValueOrDefault(key);
if (creditings.ContainsKey(key)) sum += creditings.GetValueOrDefault(key);
result.Add(new ClientDiagramElementsViewModel() { Name = Enum.GetName(typeof(Months), key.Item1) + " " + key.Item2.ToString(), Value = sum});
}
return result;
}
private void CheckModel(CardBindingModel model, bool withParams = true)
{
if (model == null)

View File

@ -3,12 +3,12 @@ using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.BusinessLogicsContracts;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.StoragesContracts;
using BankYouBankruptContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BankYouBankruptContracts.ViewModels.Client.Default;
namespace BankYouBankruptBusinessLogic.BusinessLogics
{

View File

@ -3,12 +3,12 @@ using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.BusinessLogicsContracts;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.StoragesContracts;
using BankYouBankruptContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BankYouBankruptContracts.ViewModels.Client.Default;
namespace BankYouBankruptBusinessLogic.BusinessLogics
{
@ -16,14 +16,10 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics
{
private readonly ILogger _logger;
private readonly ICreditingStorage _creditingStorage;
private readonly ICardLogic _cardLogic;
private readonly IAccountLogic _accountLogic;
public CreditingLogic(ILogger<CreditingLogic> logger, ICreditingStorage creditingStorage, ICardLogic cardLogic, IAccountLogic accountLogic) {
public CreditingLogic(ILogger<CreditingLogic> logger, ICreditingStorage creditingStorage) {
_logger = logger;
_creditingStorage = creditingStorage;
_cardLogic = cardLogic;
_accountLogic = accountLogic;
}
public bool Create(CreditingBindingModel model)

View File

@ -3,12 +3,12 @@ using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.BusinessLogicsContracts;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.StoragesContracts;
using BankYouBankruptContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BankYouBankruptContracts.ViewModels.Client.Default;
namespace BankYouBankruptBusinessLogic.BusinessLogics
{

View File

@ -4,12 +4,12 @@ using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.BusinessLogicsContracts;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.StoragesContracts;
using BankYouBankruptContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BankYouBankruptContracts.ViewModels.Client.Reports;
namespace BankYouBankruptBusinessLogic.BusinessLogics
{

View File

@ -1,4 +1,5 @@
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Reports;
using System;
using System.Collections.Generic;
using System.Linq;

View File

@ -1,4 +1,5 @@
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using Newtonsoft.Json;
using System.Net.Http.Headers;
using System.Text;

View File

@ -1,6 +1,7 @@
using BankYouBankruptCashierApp.Models;
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptDataModels.Enums;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;

View File

@ -1,4 +1,4 @@
@using BankYouBankruptContracts.ViewModels
@using BankYouBankruptContracts.ViewModels.Client.Default
@model List<CreditingViewModel>

View File

@ -1,4 +1,5 @@
@using BankYouBankruptContracts.ViewModels
@using BankYouBankruptContracts.ViewModels.Client.Default
@model List<DebitingViewModel>

View File

@ -1,4 +1,4 @@
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using Newtonsoft.Json;
using System.Net.Http.Headers;
using System.Text;

View File

@ -1,6 +1,9 @@
using BankYouBankruptClientApp.Models;
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptContracts.ViewModels.Client.Reports;
using BankYouBankruptContracts.ViewModels.Client.Diagram;
using BankYouBankruptDataModels.Enums;
using BankYouBankruptСlientApp;
using Microsoft.AspNetCore.Mvc;
@ -24,7 +27,7 @@ namespace BankYouBankruptClientApp.Controllers
_logger = logger;
}
#region Профиль, вход и регистрация
[HttpGet]
public IActionResult Profile()
{
@ -103,6 +106,7 @@ namespace BankYouBankruptClientApp.Controllers
return;
}
#endregion
#region Карты
[HttpGet]
@ -244,7 +248,6 @@ namespace BankYouBankruptClientApp.Controllers
#endregion
#region Получение отчёта PDF
[HttpGet]
@ -335,6 +338,7 @@ namespace BankYouBankruptClientApp.Controllers
#endregion
#region Получение отчета по картам
[HttpGet]
public IActionResult ReportWithCards()
{
@ -396,5 +400,36 @@ namespace BankYouBankruptClientApp.Controllers
Operations = result,
});
}
#endregion
[HttpGet]
public IActionResult Diagram() {
if (APIClient.Client == null)
{
return Redirect("~/Home/Enter");
}
ViewBag.Cards = APIClient.GetRequest<List<CardViewModel>>($"api/Card/GetUsersCardsList?id={APIClient.Client.Id}");
return View();
}
[HttpPost]
public IActionResult Diagram(int cardId)
{
if (APIClient.Client == null)
{
return Redirect("~/Home/Enter");
}
ViewBag.Cards = APIClient.GetRequest<List<CardViewModel>>($"api/Card/GetUsersCardsList?id={APIClient.Client.Id}");
return View(new ClientDiagramViewModel() {
DiagramName = "Hello World",
Elements = APIClient.GetRequest<List<ClientDiagramElementsViewModel>>($"api/Card/getCardMonthResult?cardId={cardId}")
});
}
}
}

View File

@ -1,4 +1,4 @@
@using BankYouBankruptContracts.ViewModels
@using BankYouBankruptContracts.ViewModels.Client.Default
@model List<CardViewModel>

View File

@ -1,4 +1,4 @@
@using BankYouBankruptContracts.ViewModels
@using BankYouBankruptContracts.ViewModels.Client.Default
@model List<CreditingViewModel>

View File

@ -1,4 +1,4 @@
@using BankYouBankruptContracts.ViewModels
@using BankYouBankruptContracts.ViewModels.Client.Default
@model List<DebitingViewModel>

View File

@ -0,0 +1,78 @@
@using BankYouBankruptContracts.ViewModels.Client.Diagram
@model ClientDiagramViewModel
@{
ViewData["Title"] = "Диаграмма";
}
<div class="text-center">
<h1 class="display-4">Диаграмма по месяцам</h1>
</div>
<form method="post">
<div class="row">
<div class="row">Номер счета:</div>
<div class="col-8">
<select id="cardId" name="cardId" class="form-control" asp-items="@(new SelectList( @ViewBag.Cards, "Id", "Number"))"></select>
</div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Выбрать" class="btn btn-primary"/>
</div>
</div>
</form>
@if (Model == null) return;
<div id="Diagrams" class="text-center">
<div id="@Model.DiagramName Diagram">
<canvas id="Chart"></canvas>
<div id="params">
@foreach (var info in Model.Elements) {
<input type="hidden" id="@info.Name" value="@info.Value" />
}
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
const diagrams = document.getElementById('Diagrams').childNodes;
let diagram_name = diagrams[1].id;
console.log(diagram_name);
let diagram = document.getElementById(diagram_name).childNodes;
console.log(diagram);
let labels = [];
let data = [];
document.getElementById('params').childNodes.forEach(element => {
if (element.id != undefined) {
labels.push(element.id);
}
});
document.getElementById('params').childNodes.forEach(element => {
if (element.id != undefined) {
data.push(Number(element.value));
}
});
new Chart(diagram.item(1), {
type: 'bar',
data: {
labels: labels,
datasets: [{
label: 'Денег в этом месяце',
data: data,
borderWidth: 1
}]
},
options: {
}
});
</script>

View File

@ -1,4 +1,4 @@
@using BankYouBankruptContracts.ViewModels
@using BankYouBankruptContracts.ViewModels.Client.Default
@model ClientViewModel

View File

@ -1,4 +1,4 @@
@using BankYouBankruptContracts.ViewModels
@using BankYouBankruptContracts.ViewModels.Client.Reports;
@model ReportClientCardsViewModel

View File

@ -40,6 +40,9 @@
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="CreateReport">Отчёт за период</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Diagram">Диаграмма</a>
</li>
</ul>
}
}

View File

@ -1,6 +1,7 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptContracts.ViewModels.Client.Diagram;
using System;
using System.Collections.Generic;
using System.Linq;
@ -20,5 +21,7 @@ namespace BankYouBankruptContracts.BusinessLogicsContracts
bool Update(CardBindingModel model);
bool Delete(CardBindingModel model);
public List<ClientDiagramElementsViewModel> GetMonthInfo(int CardId);
}
}

View File

@ -1,6 +1,6 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using System;
using System.Collections.Generic;
using System.Linq;
@ -20,5 +20,6 @@ namespace BankYouBankruptContracts.BusinessLogicsContracts
bool Update(ClientBindingModel model);
bool Delete(ClientBindingModel model);
}
}

View File

@ -1,6 +1,6 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using System;
using System.Collections.Generic;
using System.Linq;

View File

@ -1,6 +1,6 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using System;
using System.Collections.Generic;
using System.Linq;

View File

@ -1,6 +1,6 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Reports;
using System;
using System.Collections.Generic;
using System.Linq;

View File

@ -1,6 +1,6 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using System;
using System.Collections.Generic;
using System.Linq;

View File

@ -1,6 +1,6 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using System;
using System.Collections.Generic;
using System.Linq;

View File

@ -1,6 +1,6 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using System;
using System.Collections.Generic;
using System.Linq;

View File

@ -1,6 +1,6 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using System;
using System.Collections.Generic;
using System.Linq;

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankYouBankruptContracts.ViewModels
namespace BankYouBankruptContracts.ViewModels.Client.Default
{
public class CardViewModel : ICardModel
{

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankYouBankruptContracts.ViewModels
namespace BankYouBankruptContracts.ViewModels.Client.Default
{
public class ClientViewModel : IClientModel
{

View File

@ -7,7 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankYouBankruptContracts.ViewModels
namespace BankYouBankruptContracts.ViewModels.Client.Default
{
public class CreditingViewModel : ICreditingModel
{

View File

@ -7,7 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankYouBankruptContracts.ViewModels
namespace BankYouBankruptContracts.ViewModels.Client.Default
{
public class DebitingViewModel : IDebitingModel
{

View File

@ -0,0 +1,17 @@
using BankYouBankruptDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankYouBankruptContracts.ViewModels.Client.Diagram
{
public class ClientDiagramElementsViewModel
{
public string Name { get; set; } = "Column";
public int Value { get; set; } = 0;
}
}

View File

@ -0,0 +1,17 @@
using BankYouBankruptDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankYouBankruptContracts.ViewModels.Client.Diagram
{
public class ClientDiagramViewModel
{
public string DiagramName { get; set; } = "Diagram Name";
public List<ClientDiagramElementsViewModel> Elements { get; set; } = new();
}
}

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankYouBankruptContracts.ViewModels
namespace BankYouBankruptContracts.ViewModels.Client.Reports
{
public class CheckboxViewModel
{

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankYouBankruptContracts.ViewModels
namespace BankYouBankruptContracts.ViewModels.Client.Reports
{
internal class ReportCardViewModel
{

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankYouBankruptContracts.ViewModels
namespace BankYouBankruptContracts.ViewModels.Client.Reports
{
public class ReportClientCardsViewModel
{

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankYouBankruptContracts.ViewModels
namespace BankYouBankruptContracts.ViewModels.Client.Reports
{
public class ReportClientViewModel
{

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankYouBankruptDataModels.Enums
{
public enum Months
{
Январь = 1,
Февраль, Март, Апрель, Май, Июнь,
Июль, Август, Сентябрь, Октябрь, Ноябрь, Декабрь
};
}

View File

@ -1,7 +1,7 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.StoragesContracts;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System;

View File

@ -1,7 +1,7 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.StoragesContracts;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptDatabaseImplement.Models;
using System;
using System.Collections.Generic;

View File

@ -1,7 +1,7 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.StoragesContracts;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System;
@ -28,35 +28,22 @@ namespace BankYouBankruptDatabaseImplement.Implements
public List<CreditingViewModel> GetFilteredList(CreditingSearchModel model)
{
using var context = new BankYouBancruptDatabase();
var result = context.Creditings.Include(x => x.Card).ToList();
if (model.Status.HasValue)
{
return context.Creditings
.Include(x => x.Card)
.Where(x => x.Status == model.Status)
.Select(x => x.GetViewModel)
.ToList();
}
if (model.Status.HasValue) result = result.Where(x => x.Status == model.Status).ToList();
if (model.UserId.HasValue)
{
List<int> cards = context.Cards.Where(x => x.ClientID == model.UserId).Select(x => x.Id).ToList();
return context.Creditings.Include(x => x.Card).Where(x => cards.Contains(x.CardId)).Select(x => x.GetViewModel).ToList();
result = result.Where(x => cards.Contains(x.CardId)).ToList();
}
if(model.DateFrom.HasValue && model.DateTo.HasValue)
if (model.DateFrom.HasValue && model.DateTo.HasValue)
{
return context.Creditings
.Include(x => x.Card)
.Where(x => x.DateOpen >= model.DateFrom && x.DateClose <= model.DateTo)
.Select(x => x.GetViewModel)
.ToList();
result = result.Where(x => x.DateOpen >= model.DateFrom && x.DateClose <= model.DateTo).ToList();
}
return context.Creditings
.Include(x => x.Card)
.Select(x => x.GetViewModel)
.ToList();
return result.Select(x => x.GetViewModel).ToList();
}
public CreditingViewModel? GetElement(CreditingSearchModel model)

View File

@ -1,7 +1,7 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.StoragesContracts;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptDatabaseImplement.Models;
using BankYouBankruptDataModels.Enums;
using Microsoft.EntityFrameworkCore;
@ -30,34 +30,23 @@ namespace BankYouBankruptDatabaseImplement.Implements
{
using var context = new BankYouBancruptDatabase();
var result = context.Debitings.Include(x => x.Card).ToList();
//для получения всех заявок на стнятие со статусом "Открыта"
if(model.Status == StatusEnum.Открыта)
{
return context.Debitings
.Include(x => x.Card)
.Where(x => x.Status == StatusEnum.Открыта)
.Select(x => x.GetViewModel)
.ToList();
}
if (model.Status.HasValue) result = result.Where(x => x.Status == model.Status).ToList();
if (model.UserId.HasValue) {
List<int> cards = context.Cards.Where(x => x.ClientID == model.UserId).Select(x => x.Id).ToList();
return context.Debitings.Include(x => x.Card).Where(x => cards.Contains(x.CardId)).Select(x => x.GetViewModel).ToList();
result = result.Where(x => cards.Contains(x.CardId)).ToList();
}
if (model.DateFrom.HasValue && model.DateTo.HasValue)
{
return context.Debitings
.Include(x => x.Card)
.Where(x => x.DateOpen <= model.DateFrom && x.DateClose >= model.DateTo && x.Status != StatusEnum.Отклонено)
.Select(x => x.GetViewModel)
.ToList();
result = result.Where(x => x.DateOpen <= model.DateFrom && x.DateClose >= model.DateTo && x.Status != StatusEnum.Отклонено).ToList();
}
return context.Debitings
.Include(x => x.Card)
.Select(x => x.GetViewModel)
.ToList();
return result.Select(x => x.GetViewModel).ToList();
}
public DebitingViewModel? GetElement(DebitingSearchModel model)

View File

@ -1,5 +1,5 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptDataModels.Models;
using Microsoft.EntityFrameworkCore;
using System;

View File

@ -1,5 +1,4 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptDataModels.Models;
using System;
using System.Collections.Generic;
@ -8,6 +7,7 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BankYouBankruptContracts.ViewModels.Client.Default;
namespace BankYouBankruptDatabaseImplement.Models
{

View File

@ -1,5 +1,5 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptDataModels.Enums;
using BankYouBankruptDataModels.Models;
using System;

View File

@ -1,5 +1,5 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptDataModels.Enums;
using BankYouBankruptDataModels.Models;
using System;

View File

@ -3,6 +3,7 @@ using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.BusinessLogicsContracts;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptDatabaseImplement.Models;
using BankYouBankruptDataModels.Enums;
using Microsoft.AspNetCore.Mvc;

View File

@ -1,7 +1,9 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptBusinessLogic.BusinessLogics;
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.BusinessLogicsContracts;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptContracts.ViewModels.Client.Diagram;
using Microsoft.AspNetCore.Mvc;
using System.Linq.Expressions;
using System.Net;
@ -100,7 +102,7 @@ namespace BankYouBankruptRestApi.Controllers
}
[HttpGet]
public CardViewModel FindCard(int id)
public CardViewModel? FindCard(int id)
{
try
{
@ -115,5 +117,19 @@ namespace BankYouBankruptRestApi.Controllers
throw;
}
}
[HttpGet]
public List<ClientDiagramElementsViewModel> getCardMonthResult(int cardId)
{
try
{
return _cardLogic.GetMonthInfo(cardId);
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка получения пользователей");
throw;
}
}
}
}

View File

@ -2,8 +2,10 @@
using BankYouBankruptContracts.BindingModels;
using BankYouBankruptContracts.BusinessLogicsContracts;
using BankYouBankruptContracts.SearchModels;
using BankYouBankruptContracts.ViewModels;
using BankYouBankruptContracts.ViewModels.Client.Default;
using BankYouBankruptContracts.ViewModels.Client.Diagram;
using DocumentFormat.OpenXml.Office2010.Excel;
using DocumentFormat.OpenXml.Spreadsheet;
using Microsoft.AspNetCore.Mvc;
namespace BankYouBankruptRestApi.Controllers
@ -137,5 +139,7 @@ namespace BankYouBankruptRestApi.Controllers
throw;
}
}
}
}