This commit is contained in:
2021-05-22 00:15:26 +00:00
parent a318137900
commit d229642fa2
2 changed files with 7 additions and 3 deletions

View File

@@ -789,12 +789,14 @@ namespace AyaNova.Biz
//popup Alert notes //popup Alert notes
//Customer notes first then others below //Customer notes first then others below
var customerAlert = await ct.Customer.AsNoTracking().Where(x => x.Id == o.CustomerId).Select(x => x.PopUpNotes).FirstOrDefaultAsync(); var custInfo = await ct.Customer.AsNoTracking().Where(x => x.Id == o.CustomerId).Select(x => new { AlertViz = x.PopUpNotes, CustomerViz = x.Name }).FirstOrDefaultAsync();
if (!string.IsNullOrWhiteSpace(customerAlert)) if (!string.IsNullOrWhiteSpace(custInfo.AlertViz))
{ {
o.AlertViz = $"{await Translate("Customer")}\n{customerAlert}\n\n"; o.AlertViz = $"{await Translate("Customer")}\n{custInfo.AlertViz}\n\n";
} }
o.CustomerViz = custInfo.CustomerViz;
if (o.ProjectId != null) if (o.ProjectId != null)
o.ProjectViz = await ct.Project.AsNoTracking().Where(x => x.Id == o.ProjectId).Select(x => x.Name).FirstOrDefaultAsync(); o.ProjectViz = await ct.Project.AsNoTracking().Where(x => x.Id == o.ProjectId).Select(x => x.Name).FirstOrDefaultAsync();

View File

@@ -30,6 +30,8 @@ namespace AyaNova.Models
[Required] [Required]
public long CustomerId { get; set; } public long CustomerId { get; set; }
[NotMapped]
public string CustomerViz { get; set; }
public long? ProjectId { get; set; } public long? ProjectId { get; set; }
[NotMapped] [NotMapped]
public string ProjectViz { get; set; } public string ProjectViz { get; set; }