Исправления: рецепт, документы
This commit is contained in:
parent
246d1cc97d
commit
6d28d04af6
@ -89,7 +89,7 @@ namespace HospitalBusinessLogic.OfficePackage
|
|||||||
{
|
{
|
||||||
ColumnName = "E",
|
ColumnName = "E",
|
||||||
RowIndex = rowIndex,
|
RowIndex = rowIndex,
|
||||||
Text = patient.Item4.ToString(),
|
Text = patient.Item4.ToShortDateString(),
|
||||||
StyleInfo = ExcelStyleInfoType.TextWithBroder
|
StyleInfo = ExcelStyleInfoType.TextWithBroder
|
||||||
});
|
});
|
||||||
rowIndex++;
|
rowIndex++;
|
||||||
|
@ -35,7 +35,7 @@ namespace HospitalBusinessLogic.OfficePackage
|
|||||||
Texts = new List<(string, WordTextProperties)> {
|
Texts = new List<(string, WordTextProperties)> {
|
||||||
(patient.Item1, new WordTextProperties { Size = "24"}),
|
(patient.Item1, new WordTextProperties { Size = "24"}),
|
||||||
(" " + patient.Item2, 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
|
TextProperties = new WordTextProperties
|
||||||
{
|
{
|
||||||
Size = "24",
|
Size = "24",
|
||||||
|
@ -131,13 +131,18 @@ namespace HospitalDatabaseImplement.Models
|
|||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
}
|
}
|
||||||
var recipe = context.Recipes.First(x => x.Id == Id);
|
var recipe = context.Recipes.First(x => x.Id == Id);
|
||||||
|
var existingTreatmentsIds = recipeTreatments?.Select(x => x.TreatmentId).ToList();
|
||||||
foreach (var rec in model.RecipeTreatments)
|
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,
|
Recipe = recipe,
|
||||||
Treatment = context.Treatments.First(x => x.Id == rec.Key),
|
Treatment = context.Treatments.First(x => x.Id == rec.Key),
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
}
|
}
|
||||||
_recipeTreatments = null;
|
_recipeTreatments = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user