Добавил Dictionary к моделям

This commit is contained in:
maxnes3 2023-04-08 19:01:51 +04:00
parent 1f7c4e5d15
commit e7ae669c08
14 changed files with 92 additions and 4 deletions

View File

@ -0,0 +1,70 @@
using CaseAccountingContracts.BindingModels;
using CaseAccountingContracts.BusinessLogicContracts;
using CaseAccountingContracts.StoragesContracts;
using CaseAccountingContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CaseAccountingBusinessLogic.BusinessLogics
{
public class ReportProviderLogic : IReportProviderLogic
{
private readonly ICaseStorage _caseStorage;
private readonly ISpecializationStorage _specializationStorage;
private readonly IHearingStorage _hearingStorage;
private readonly ILawyerStorage _lawyerStorage;
public ReportProviderLogic(ICaseStorage caseStorage, ISpecializationStorage specializationStorage, IHearingStorage hearingStorage, ILawyerStorage lawyerStorage)
{
_caseStorage = caseStorage ?? throw new ArgumentNullException(nameof(caseStorage));
_specializationStorage = specializationStorage ?? throw new ArgumentNullException(nameof(specializationStorage));
_hearingStorage = hearingStorage ?? throw new ArgumentNullException(nameof(hearingStorage));
_lawyerStorage = lawyerStorage ?? throw new ArgumentNullException(nameof(lawyerStorage));
}
public List<ReportCaseSpecializationViewModel> GetCaseSpecialization()
{
var сases = _caseStorage.GetFullList();
var list = new List<ReportCaseSpecializationViewModel>();
foreach (var c in сases)
{
var report = new ReportCaseSpecializationViewModel
{
CaseName = c.Name,
Applicant = c.Applicant,
Defendant = c.Defendant,
Date = c.Date,
Specialization = c.Specialization,
};
list.Add(report);
}
return list;
}
public List<ReportHearingLawyerViewModel> GetHearingLawyer(ReportBindingModel model)
{
var hearings = _hearingStorage.GetFullList();
var lawyers = _lawyerStorage.GetFullList();
var list = new List<ReportHearingLawyerViewModel>();
return list;
}
public void SaveCaseSpecializationToExcelFile(ReportBindingModel model)
{
throw new NotImplementedException();
}
public void SaveCaseSpecializationToWordFile(ReportBindingModel model)
{
throw new NotImplementedException();
}
public void SaveHearingLawyerToPdfFile(ReportBindingModel model)
{
throw new NotImplementedException();
}
}
}

View File

@ -24,5 +24,7 @@ namespace CaseAccountingContracts.BindingModels
public int SpecializationId { get; set; }
public int UserId { get; set; }
public Dictionary<int, ILawyerModel> Lawyers { get; set; } = new();
}
}

View File

@ -18,5 +18,7 @@ namespace CaseAccountingContracts.BindingModels
public int UserId { get; set; }
public int Id { get; set; }
public Dictionary<int, IDealModel> Deals { get; set; } = new();
}
}

View File

@ -18,5 +18,7 @@ namespace CaseAccountingContracts.BindingModels
public int UserId { get; set; }
public int Id { get; set; }
public Dictionary<int, ICaseModel> Cases { get; set; } = new();
}
}

View File

@ -22,5 +22,7 @@ namespace CaseAccountingContracts.BindingModels
public int UserId { get; set; }
public int Id { get; set; }
public Dictionary<int, IContractModel> Contracts { get; set; } = new();
}
}

View File

@ -26,5 +26,6 @@ namespace CaseAccountingContracts.ViewModels
public int UserId { get; set; }
[DisplayName("Номер")]
public int Id { get; set; }
}
public Dictionary<int, ILawyerModel> Lawyers { get; set; } = new();
}
}

View File

@ -18,5 +18,6 @@ namespace CaseAccountingContracts.ViewModels
public DateTime Date { get; set; }
public int UserId { get; set; }
public int Id { get; set; }
}
public Dictionary<int, IDealModel> Deals { get; set; } = new();
}
}

View File

@ -18,5 +18,6 @@ namespace CaseAccountingContracts.ViewModels
public DateTime Date { get; set; }
public int UserId { get; set; }
public int Id { get; set; }
}
public Dictionary<int, ICaseModel> Cases { get; set; } = new();
}
}

View File

@ -23,5 +23,6 @@ namespace CaseAccountingContracts.ViewModels
public string Specialization { get; set; } = string.Empty;
public int UserId { get; set; }
public int Id { get; set; }
}
public Dictionary<int, IContractModel> Contracts { get; set; } = new();
}
}

View File

@ -91,5 +91,7 @@ namespace CaseAccountingDataBaseImplement.Models
SpecializationId = SpecializationId,
UserId = UserId
};
Dictionary<int, ILawyerModel> ICaseModel.Lawyers => throw new NotImplementedException();
}
}

View File

@ -15,5 +15,6 @@ namespace CaseAccountingDataModels.Models
DateTime Date { get; }
int SpecializationId { get; }
int UserId { get; }
Dictionary<int, ILawyerModel> Lawyers { get; }
}
}

View File

@ -12,5 +12,6 @@ namespace CaseAccountingDataModels.Models
decimal Coast { get; }
DateTime Date { get; }
int UserId { get; }
Dictionary<int, IDealModel> Deals { get; }
}
}

View File

@ -12,5 +12,6 @@ namespace CaseAccountingDataModels.Models
string Responsibilities { get; }
DateTime Date { get; }
int UserId { get; }
Dictionary<int, ICaseModel> Cases { get; }
}
}

View File

@ -14,5 +14,6 @@ namespace CaseAccountingDataModels.Models
int Experience { get; }
int SpecializationId { get; }
int UserId { get; }
Dictionary<int, IContractModel> Contracts { get; }
}
}