Исправления: рецепт, документы

This commit is contained in:
prodigygirl 2023-05-20 07:57:40 +04:00
parent 246d1cc97d
commit 6d28d04af6
3 changed files with 9 additions and 4 deletions

View File

@ -89,7 +89,7 @@ namespace HospitalBusinessLogic.OfficePackage
{
ColumnName = "E",
RowIndex = rowIndex,
Text = patient.Item4.ToString(),
Text = patient.Item4.ToShortDateString(),
StyleInfo = ExcelStyleInfoType.TextWithBroder
});
rowIndex++;

View File

@ -35,7 +35,7 @@ namespace HospitalBusinessLogic.OfficePackage
Texts = new List<(string, WordTextProperties)> {
(patient.Item1, new WordTextProperties { Size = "24"}),
(" " + patient.Item2, new WordTextProperties { Size = "24", }),
(" " + patient.Item3, new WordTextProperties { Size = "24", }), (", " + patient.Item4, new WordTextProperties { Size = "24", }) },
(" " + patient.Item3, new WordTextProperties { Size = "24", }), (", " + patient.Item4.ToShortDateString(), new WordTextProperties { Size = "24", }) },
TextProperties = new WordTextProperties
{
Size = "24",

View File

@ -131,13 +131,18 @@ namespace HospitalDatabaseImplement.Models
context.SaveChanges();
}
var recipe = context.Recipes.First(x => x.Id == Id);
var existingTreatmentsIds = recipeTreatments?.Select(x => x.TreatmentId).ToList();
foreach (var rec in model.RecipeTreatments)
{
context.RecipeTreatments.Add(new RecipeTreatment
if (existingTreatmentsIds != null && !existingTreatmentsIds.Contains(rec.Key))
{
context.RecipeTreatments.Add(new RecipeTreatment
{
Recipe = recipe,
Treatment = context.Treatments.First(x => x.Id == rec.Key),
});
}
context.SaveChanges();
}
_recipeTreatments = null;