сваггер чиню

This commit is contained in:
a.puchkina 2024-05-01 17:50:10 +04:00
parent e772c3bf7d
commit bf7b75cc1e
2 changed files with 11 additions and 4 deletions

View File

@ -95,7 +95,10 @@ namespace LawFirmBusinessLogic.BusinessLogics
{
return false;
}
if (element.HearingLawyers.ContainsKey(lawyer.Id))
{
return false;
}
element.HearingLawyers[lawyer.Id] = lawyer;
_hearingStorage.Update(new()
@ -119,11 +122,15 @@ namespace LawFirmBusinessLogic.BusinessLogics
{
return;
}
if (string.IsNullOrEmpty(model.Judge))
{
throw new ArgumentNullException("Не указан суд",
nameof(model.Judge));
}
if (string.IsNullOrEmpty((model.HearingDate).ToString()))
{
throw new ArgumentNullException("Не поставлено время", nameof(model.HearingDate));
}
_logger.LogInformation("Hearing. HearingDate:{HearingDate}. Id: {Id} ", model.HearingDate, model.Id);
var element = _hearingStorage.GetElement(new HearingSearchModel
{

View File

@ -26,7 +26,7 @@ namespace LawFirmDatabaseImplement.Implements
{
return new();
}
if (!model.GuarantorId.HasValue && model.DateFrom.HasValue && model.DateTo.HasValue)
if (model.GuarantorId.HasValue && model.DateFrom.HasValue && model.DateTo.HasValue)
{
using var context = new LawFirmDatabase();
return context.Hearings
@ -37,7 +37,7 @@ namespace LawFirmDatabaseImplement.Implements
.Select(x => x.GetViewModel)
.ToList();
}
if (!model.GuarantorId.HasValue)
else if (model.GuarantorId.HasValue)
{
using var context = new LawFirmDatabase();
return context.Hearings