заФИКСировали

This commit is contained in:
Софья Якобчук 2024-05-03 04:48:06 +04:00
parent 013070b909
commit 4e5b73188d
3 changed files with 10 additions and 3 deletions

View File

@ -95,6 +95,10 @@ namespace LawCompanyBusinessLogic.BusinessLogics
{ {
return false; return false;
} }
if (element.HearingLawyers.ContainsKey(lawyer.Id))
{
return false;
}
element.HearingLawyers[lawyer.Id] = lawyer; element.HearingLawyers[lawyer.Id] = lawyer;
_hearingStorage.Update(new() _hearingStorage.Update(new()
@ -118,6 +122,10 @@ namespace LawCompanyBusinessLogic.BusinessLogics
{ {
return; return;
} }
if (string.IsNullOrEmpty(model.Judge))
{
throw new ArgumentNullException("Не указан суд", nameof(model.Judge));
}
if (string.IsNullOrEmpty((model.HearingDate).ToString())) if (string.IsNullOrEmpty((model.HearingDate).ToString()))
{ {
throw new ArgumentNullException("Не поставлено время", nameof(model.HearingDate)); throw new ArgumentNullException("Не поставлено время", nameof(model.HearingDate));

View File

@ -142,7 +142,6 @@ namespace LawCompanyBusinessLogic.BusinessLogics
FIO = model.FIO, FIO = model.FIO,
Phone = model.Phone, Phone = model.Phone,
Email = model.Email, Email = model.Email,
GuarantorId = model.GuarantorId,
}); });
if (element != null && element.Id != model.Id) if (element != null && element.Id != model.Id)

View File

@ -26,7 +26,7 @@ namespace LawCompanyDatabaseImplement.Implements
{ {
return new(); 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 LawCompanyDatabase(); using var context = new LawCompanyDatabase();
return context.Hearings return context.Hearings
@ -37,7 +37,7 @@ namespace LawCompanyDatabaseImplement.Implements
.Select(x => x.GetViewModel) .Select(x => x.GetViewModel)
.ToList(); .ToList();
} }
if (!model.GuarantorId.HasValue) else if (model.GuarantorId.HasValue)
{ {
using var context = new LawCompanyDatabase(); using var context = new LawCompanyDatabase();
return context.Hearings return context.Hearings