Compare commits

...

3 Commits

4 changed files with 11 additions and 0 deletions

View File

@ -10,5 +10,6 @@ namespace LawFimDataModels.Models
string CaseType { get; } string CaseType { get; }
DateTime DateCreate { get; } DateTime DateCreate { get; }
DateTime? DateImplement { get; } DateTime? DateImplement { get; }
public int ExecutorId { get; }
} }
} }

View File

@ -5,5 +5,6 @@
string FIO { get; } string FIO { get; }
string Phone { get; } string Phone { get; }
string Email { get; } string Email { get; }
public int ExecutorId { get; }
} }
} }

View File

@ -5,5 +5,6 @@
Dictionary<int, IClientModel> VisitClients { get; } Dictionary<int, IClientModel> VisitClients { get; }
DateTime VisitDate { get; } DateTime VisitDate { get; }
int HearingId { get; } int HearingId { get; }
public int ExecutorId { get; }
} }
} }

View File

@ -2,6 +2,7 @@
using LawFirmContracts.BindingModels; using LawFirmContracts.BindingModels;
using LawFirmContracts.ViewModels; using LawFirmContracts.ViewModels;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace LawFirmDatabaseImplement.Models namespace LawFirmDatabaseImplement.Models
{ {
@ -15,6 +16,13 @@ namespace LawFirmDatabaseImplement.Models
[Required] [Required]
public string Password { get; private set; } = string.Empty; public string Password { get; private set; } = string.Empty;
[ForeignKey("ExecutorId")]
public virtual List<Case> Cases { get; set; } = new();
[ForeignKey("ExecutorId")]
public virtual List<Client> Clients { get; set; } = new();
[ForeignKey("ExecutorId")]
public virtual List<Visit> Visits { get; set; } = new();
public static Executor? Create(ExecutorBindingModel? model) public static Executor? Create(ExecutorBindingModel? model)
{ {
if (model == null) if (model == null)