поправила везде методы создания и чтобы комментарии могли быть null

This commit is contained in:
Елена Бакальская 2024-05-28 19:59:22 +04:00
parent 4f3243bb1c
commit 7eb6e50cd6
20 changed files with 25 additions and 25 deletions

View File

@ -6,7 +6,7 @@ namespace PolyclinicContracts.BindingModels
{
public int DaysCount { get; set; }
public int PillsPerDay { get; set; }
public string Comment { get; set; } = string.Empty;
public string? Comment { get; set; } = string.Empty;
public Dictionary<int, IDiagnoseModel> CourseDiagnoses { get; set; } = new();
public int Id { get; set; }
}

View File

@ -8,6 +8,6 @@ namespace PolyclinicContracts.BindingModels
public int? SymptomId { get; set; }
public int ProcedureId { get; set; }
public string Name { get; set; } = string.Empty;
public string Comment { get; set; } = string.Empty;
public string? Comment { get; set; } = string.Empty;
}
}

View File

@ -7,7 +7,7 @@ namespace PolyclinicContracts.BindingModels
public int Id { get; set; }
public int UserId { get; set; }
public string Name { get; set; } = string.Empty;
public string Comment { get; set; } = string.Empty;
public string? Comment { get; set; } = string.Empty;
public DateTime DateStartProcedure { get; set; } = DateTime.Now;
public DateTime? DateStopProcedure { get; set; }

View File

@ -7,7 +7,7 @@ namespace PolyclinicContracts.BindingModels
public int Id { get; set; }
public int? CourseId { get; set; }
public int ProceduresCount { get; set; }
public string Comment { get; set; } = string.Empty;
public string? Comment { get; set; } = string.Empty;
public Dictionary<int, IProcedureModel> RecipeProcedures { get; set; } = new();
}
}

View File

@ -5,7 +5,7 @@ namespace PolyclinicContracts.BindingModels
public class SymptomBindingModel : ISymptomModel
{
public string Name { get; set; } = string.Empty;
public string Comment { get; set; } = string.Empty;
public string? Comment { get; set; } = string.Empty;
public Dictionary<int, IDiagnoseModel> SymptomDiagnoses { get; set; } = new();
public int Id { get; set; }
}

View File

@ -10,7 +10,7 @@ namespace PolyclinicContracts.ViewModels
[DisplayName("Препарата в день")]
public int PillsPerDay { get; set; }
[DisplayName("Комментарий")]
public string Comment { get; set; } = string.Empty;
public string? Comment { get; set; } = string.Empty;
public Dictionary<int, IDiagnoseModel> CourseDiagnoses { get; set; } = new();
public int Id { get; set; }
}

View File

@ -14,7 +14,7 @@ namespace PolyclinicContracts.ViewModels
[DisplayName("Комментарий")]
public string Comment { get; set; } = string.Empty;
public string? Comment { get; set; } = string.Empty;
[DisplayName("Название симптома")]

View File

@ -12,7 +12,7 @@ namespace PolyclinicContracts.ViewModels
public string Name { get; set; } = string.Empty;
[DisplayName("Комментарий")]
public string Comment { get; set; } = string.Empty;
public string? Comment { get; set; } = string.Empty;
[DisplayName("Дата 'от'")]
public DateTime DateStartProcedure { get; set; } = DateTime.Now;

View File

@ -11,7 +11,7 @@ namespace PolyclinicContracts.ViewModels
public int ProceduresCount { get; set; }
[DisplayName("Комментарий")]
public string Comment { get; set; } = string.Empty;
public string? Comment { get; set; } = string.Empty;
[DisplayName("Номер курса")]
public int? CourseId { get; set; }

View File

@ -8,7 +8,7 @@ namespace PolyclinicContracts.ViewModels
[DisplayName("Название")]
public string Name { get; set; } = string.Empty;
[DisplayName("Комментарий")]
public string Comment { get; set; } = string.Empty;
public string? Comment { get; set; } = string.Empty;
public Dictionary<int, IDiagnoseModel> SymptomDiagnoses { get; set; } = new();
public int Id { get; set; }
}

View File

@ -4,7 +4,7 @@
{
int DaysCount { get; }
int PillsPerDay { get; }
string Comment { get; }
string? Comment { get; }
Dictionary<int, IDiagnoseModel> CourseDiagnoses { get; }
}
}

View File

@ -3,7 +3,7 @@
public interface IMedicamentModel : IId
{
string Name { get; }
string Comment { get; }
string? Comment { get; }
int ProcedureId { get; }
int? SymptomId { get; }
}

View File

@ -3,7 +3,7 @@
public interface IProcedureModel : IId
{
string Name { get; }
string Comment { get; }
string? Comment { get; }
int UserId { get; }
DateTime DateStartProcedure { get; }
DateTime? DateStopProcedure { get; }

View File

@ -3,7 +3,7 @@
public interface IRecipeModel : IId
{
int ProceduresCount { get; set; }
string Comment { get; set; }
string? Comment { get; set; }
int? CourseId { get; set; }
Dictionary<int, IProcedureModel> RecipeProcedures { get; }
}

View File

@ -3,7 +3,7 @@
public interface ISymptomModel : IId
{
string Name { get; }
string Comment { get; }
string? Comment { get; }
Dictionary<int, IDiagnoseModel> SymptomDiagnoses { get; }
}
}

View File

@ -14,7 +14,7 @@ namespace PolyclinicDatabaseImplement.Models
public int DaysCount { get; set; }
[Required]
public int PillsPerDay { get; set; }
public string Comment { get; set; } = string.Empty;
public string? Comment { get; set; } = string.Empty;
[ForeignKey("CourseId")]
public virtual List<CourseDiagnose> Diagnoses { get; set; } = new();
private Dictionary<int, IDiagnoseModel>? _courseDiagnoses = null;
@ -34,7 +34,7 @@ namespace PolyclinicDatabaseImplement.Models
}
}
public static Course Create(PolyclinicDatabase context, CourseBindingModel model)
public static Course? Create(PolyclinicDatabase context, CourseBindingModel model)
{
return new Course()
{

View File

@ -13,7 +13,7 @@ namespace PolyclinicDatabaseImplement.Models
[Required]
public string Name { get; set; } = string.Empty;
public string Comment { get; set; } = string.Empty;
public string? Comment { get; set; } = string.Empty;
[Required]
public int ProcedureId { get; set; }
@ -24,7 +24,7 @@ namespace PolyclinicDatabaseImplement.Models
public virtual Symptom? Symptom { get; set; }
public virtual Procedure? Procedure { get; set; }
public static Medicament Create(MedicamentBindingModel bindingModel)
public static Medicament? Create(MedicamentBindingModel bindingModel)
{
return new Medicament()
{

View File

@ -21,9 +21,9 @@ namespace PolyclinicDatabaseImplement.Models
public DateTime? DateStopProcedure { get; set; }
public virtual User User { get; set; } = new();
public string Comment { get; set; } = string.Empty;
public string? Comment { get; set; } = string.Empty;
public static Procedure Create(ProcedureBindingModel bindingModel)
public static Procedure? Create(ProcedureBindingModel bindingModel)
{
return new Procedure()
{

View File

@ -14,7 +14,7 @@ namespace PolyclinicDatabaseImplement.Models
[Required]
public int ProceduresCount { get; set; }
public string Comment { get; set; } = string.Empty;
public string? Comment { get; set; } = string.Empty;
public int? CourseId { get; set; }
public virtual Course Course { get; set; } = new();
@ -36,7 +36,7 @@ namespace PolyclinicDatabaseImplement.Models
}
}
public static Recipe Create(PolyclinicDatabase database, RecipeBindingModel bindingModel)
public static Recipe? Create(PolyclinicDatabase database, RecipeBindingModel bindingModel)
{
return new Recipe()
{

View File

@ -11,7 +11,7 @@ namespace PolyclinicDatabaseImplement.Models
{
[Required]
public string Name { get; set; } = string.Empty;
public string Comment { get; set; } = string.Empty;
public string? Comment { get; set; } = string.Empty;
[ForeignKey("SymptomId")]
public virtual List<SymptomDiagnose> Diagnoses { get; set; } = new();
private Dictionary<int, IDiagnoseModel>? _symptomDiagnoses = null;
@ -32,7 +32,7 @@ namespace PolyclinicDatabaseImplement.Models
}
public int Id { get; set; }
public static Symptom Create(PolyclinicDatabase context, SymptomBindingModel model)
public static Symptom? Create(PolyclinicDatabase context, SymptomBindingModel model)
{
return new Symptom()
{