Simple merge.

This commit is contained in:
Programmist73 2023-05-18 00:10:14 +04:00
parent 076b27ba7d
commit 48f0dcb771

View File

@ -10,8 +10,8 @@ using System.Xml.Linq;
namespace BankYouBankruptClientApp.Controllers namespace BankYouBankruptClientApp.Controllers
{ {
public class HomeController : Controller public class HomeController : Controller
{ {
private readonly ILogger<HomeController> _logger; private readonly ILogger<HomeController> _logger;
public HomeController(ILogger<HomeController> logger) public HomeController(ILogger<HomeController> logger)
@ -213,7 +213,7 @@ namespace BankYouBankruptClientApp.Controllers
ViewBag.Cards = APIClient.GetRequest<List<CardViewModel>>($"api/Card/GetAllCards").Select(x => new ClientSelectViewModel ViewBag.Cards = APIClient.GetRequest<List<CardViewModel>>($"api/Card/GetAllCards").Select(x => new ClientSelectViewModel
{ {
Id = x.Id, Id = x.Id,
FullName = x.ClientSurname + " " +x.Number.ToString() FullName = x.ClientSurname + " " + x.Number.ToString()
}).ToList(); }).ToList();
return View(); return View();
} }
@ -239,11 +239,22 @@ namespace BankYouBankruptClientApp.Controllers
#endregion #endregion
#region Получение отчёта #region Получение отчёта
[HttpGet] [HttpGet]
public IActionResult CreateReport() public IActionResult CreateReport()
{ {
return View();
}
[HttpPost]
public void CreateReport(DateTime DateFrom, DateTime DateTo)
{
}
#endregion
[HttpGet] [HttpGet]
public IActionResult ReportWithCards() public IActionResult ReportWithCards()
@ -260,7 +271,7 @@ namespace BankYouBankruptClientApp.Controllers
LabelName = x.Number, LabelName = x.Number,
IsChecked = false IsChecked = false
}).ToList() }).ToList()
}) ; });
} }
[HttpPost] [HttpPost]
@ -274,11 +285,11 @@ namespace BankYouBankruptClientApp.Controllers
List<int> cardList = cards.Where(x => x.IsChecked).Select(x => x.Id).ToList(); List<int> cardList = cards.Where(x => x.IsChecked).Select(x => x.Id).ToList();
List<ReportViewModel> creditings = APIClient.GetRequest<List<CreditingViewModel>>($"api/Client/getUsersCreditings?userId={APIClient.Client.Id}") List<ReportViewModel> creditings = APIClient.GetRequest<List<CreditingViewModel>>($"api/Client/getUsersCreditings?userId={APIClient.Client.Id}")
.Where(x => cardList.Contains(x.CardId)).Select(x => new ReportViewModel() { .Where(x => cardList.Contains(x.CardId)).Select(x => new ReportViewModel() {
Id=x.Id, Id = x.Id,
CardId=x.CardId, CardId = x.CardId,
DateOpen=x.DateOpen, DateOpen = x.DateOpen,
DateClose=x.DateClose, DateClose = x.DateClose,
CardNumber=x.CardNumber, CardNumber = x.CardNumber,
Status = x.Status, Status = x.Status,
Sum = x.Sum, Sum = x.Sum,
TypeOperation = TypeOperationEnum.Пополнение TypeOperation = TypeOperationEnum.Пополнение
@ -302,23 +313,7 @@ namespace BankYouBankruptClientApp.Controllers
Cards = cards, Cards = cards,
Operations = result, Operations = result,
}) ; });
}
#region Получение отчёта
[HttpGet]
public IActionResult CreateReport()
{
return View();
}
[HttpPost]
public void CreateReport(DateTime DateFrom, DateTime DateTo)
{
}
#endregion
} }
} }
}