This commit is contained in:
shadowik 2023-05-14 15:47:08 +04:00
parent 0d96bd546e
commit b7e7f0d909
2 changed files with 18 additions and 4 deletions

View File

@ -16,7 +16,7 @@ namespace BankYouBankruptDatabaseImplement
if (!optionsBuilder.IsConfigured)
{
//optionsBuilder.UseSqlServer(@"Data Source=SHADOWIK\SHADOWIK;Initial Catalog=BankYouBankrupt;Integrated Security=True;TrustServerCertificate=True");
optionsBuilder.UseSqlServer(@"Data Source=LAPTOP-CFLH20EE\SQLEXPRESS;Initial Catalog=BankYouBankrupt;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
optionsBuilder.UseSqlServer(@"Data Source=LAPTOP-CFLH20EE\SQLEXPRESS;Initial Catalog=BankYouBankrupt;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}

View File

@ -18,11 +18,14 @@ namespace BankYouBankruptRestApi.Controllers
private readonly IDebitingLogic _debitingLogic;
public CardController(ICardLogic cardLogic, IDebitingLogic debitingLogic, ILogger<ClientController> logger)
private readonly ICreditingLogic _creditingLogic;
public CardController(ICardLogic cardLogic, IDebitingLogic debitingLogic, ICreditingLogic creditingLogic, ILogger<ClientController> logger)
{
_logger = logger;
_cardLogic = cardLogic;
_debitingLogic = debitingLogic;
_creditingLogic = creditingLogic;
}
[HttpGet]
@ -61,7 +64,18 @@ namespace BankYouBankruptRestApi.Controllers
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка создания на снятие наличных");
_logger.LogError(ex, "Ошибка создания запроса на снятие наличных");
Response.StatusCode = (int)HttpStatusCode.NotAcceptable;
}
}
[HttpPost]
public void CreateCreditingOperation(CreditingBindingModel model) {
try {
_creditingLogic.Create(model);
}
catch (Exception ex) {
_logger.LogError(ex, "Ошибка создания операции на пополнение");
Response.StatusCode = (int)HttpStatusCode.NotAcceptable;
}
}