case 4015
This commit is contained in:
@@ -875,10 +875,10 @@ namespace AyaNova.Biz
|
||||
|
||||
//Alert notes
|
||||
//Customer notes first then others below
|
||||
var custInfo = await ct.Customer.AsNoTracking().Where(x => x.Id == o.CustomerId).Select(x => new { AlertViz = x.AlertNotes, x.TechNotes, CustomerViz = x.Name }).FirstOrDefaultAsync();
|
||||
if (!string.IsNullOrWhiteSpace(custInfo.AlertViz))
|
||||
var custInfo = await ct.Customer.AsNoTracking().Where(x => x.Id == o.CustomerId).Select(x => new { x.AlertNotes, x.TechNotes, x.Name, x.Phone1, x.Phone2, x.Phone3, x.Phone4, x.Phone5, x.EmailAddress }).FirstOrDefaultAsync();
|
||||
if (!string.IsNullOrWhiteSpace(custInfo.AlertNotes))
|
||||
{
|
||||
o.AlertViz = $"{await Translate("Customer")} - {await Translate("AlertNotes")}\n{custInfo.AlertViz}\n\n";
|
||||
o.AlertViz = $"{await Translate("Customer")} - {await Translate("AlertNotes")}\n{custInfo.AlertNotes}\n\n";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(custInfo.TechNotes))
|
||||
@@ -886,7 +886,13 @@ namespace AyaNova.Biz
|
||||
o.CustomerTechNotesViz = $"{await Translate("CustomerTechNotes")}\n{custInfo.TechNotes}\n\n";
|
||||
}
|
||||
|
||||
o.CustomerViz = custInfo.CustomerViz;
|
||||
o.CustomerViz = custInfo.Name;
|
||||
o.CustomerPhone1Viz = custInfo.Phone1;
|
||||
o.CustomerPhone2Viz = custInfo.Phone2;
|
||||
o.CustomerPhone3Viz = custInfo.Phone3;
|
||||
o.CustomerPhone4Viz = custInfo.Phone4;
|
||||
o.CustomerPhone5Viz = custInfo.Phone5;
|
||||
o.CustomerEmailAddressViz = custInfo.EmailAddress;
|
||||
|
||||
if (o.ProjectId != null)
|
||||
o.ProjectViz = await ct.Project.AsNoTracking().Where(x => x.Id == o.ProjectId).Select(x => x.Name).FirstOrDefaultAsync();
|
||||
@@ -4339,7 +4345,7 @@ namespace AyaNova.Biz
|
||||
{
|
||||
var unitModelInfo = await ct.UnitModel.AsNoTracking().Where(x => x.Id == unitInfo.UnitModelId).Select(x => new { x.Name, x.VendorId }).FirstOrDefaultAsync();
|
||||
o.UnitModelNameViz = unitModelInfo.Name;
|
||||
|
||||
|
||||
|
||||
if (unitModelInfo.VendorId != null)
|
||||
o.UnitModelVendorViz = await ct.Vendor.AsNoTracking().Where(x => x.Id == unitModelInfo.VendorId).Select(x => x.Name).FirstOrDefaultAsync();
|
||||
@@ -4491,7 +4497,7 @@ namespace AyaNova.Biz
|
||||
if (o is PM)
|
||||
{
|
||||
PM dto = new PM();
|
||||
CopyObject.Copy(o, dto,"Name");
|
||||
CopyObject.Copy(o, dto, "Name");
|
||||
return await PMPutAsync((PM)dto);
|
||||
}
|
||||
return await PMPutAsync((PM)o) as ICoreBizObjectModel;
|
||||
|
||||
@@ -854,10 +854,10 @@ namespace AyaNova.Biz
|
||||
|
||||
//Alert notes
|
||||
//Customer notes first then others below
|
||||
var custInfo = await ct.Customer.AsNoTracking().Where(x => x.Id == o.CustomerId).Select(x => new { AlertViz = x.AlertNotes, x.TechNotes, CustomerViz = x.Name }).FirstOrDefaultAsync();
|
||||
if (!string.IsNullOrWhiteSpace(custInfo.AlertViz))
|
||||
var custInfo = await ct.Customer.AsNoTracking().Where(x => x.Id == o.CustomerId).Select(x => new { x.AlertNotes, x.TechNotes, x.Name, x.Phone1, x.Phone2, x.Phone3, x.Phone4, x.Phone5, x.EmailAddress }).FirstOrDefaultAsync();
|
||||
if (!string.IsNullOrWhiteSpace(custInfo.AlertNotes))
|
||||
{
|
||||
o.AlertViz = $"{await Translate("Customer")} - {await Translate("AlertNotes")}\n{custInfo.AlertViz}\n\n";
|
||||
o.AlertViz = $"{await Translate("Customer")} - {await Translate("AlertNotes")}\n{custInfo.AlertNotes}\n\n";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(custInfo.TechNotes))
|
||||
@@ -865,7 +865,13 @@ namespace AyaNova.Biz
|
||||
o.CustomerTechNotesViz = $"{await Translate("CustomerTechNotes")}\n{custInfo.TechNotes}\n\n";
|
||||
}
|
||||
|
||||
o.CustomerViz = custInfo.CustomerViz;
|
||||
o.CustomerViz = custInfo.Name;
|
||||
o.CustomerPhone1Viz = custInfo.Phone1;
|
||||
o.CustomerPhone2Viz = custInfo.Phone2;
|
||||
o.CustomerPhone3Viz = custInfo.Phone3;
|
||||
o.CustomerPhone4Viz = custInfo.Phone4;
|
||||
o.CustomerPhone5Viz = custInfo.Phone5;
|
||||
o.CustomerEmailAddressViz = custInfo.EmailAddress;
|
||||
|
||||
if (o.ProjectId != null)
|
||||
o.ProjectViz = await ct.Project.AsNoTracking().Where(x => x.Id == o.ProjectId).Select(x => x.Name).FirstOrDefaultAsync();
|
||||
@@ -4654,7 +4660,7 @@ namespace AyaNova.Biz
|
||||
{
|
||||
var unitModelInfo = await ct.UnitModel.AsNoTracking().Where(x => x.Id == unitInfo.UnitModelId).Select(x => new { x.Name, x.VendorId }).FirstOrDefaultAsync();
|
||||
o.UnitModelNameViz = unitModelInfo.Name;
|
||||
|
||||
|
||||
|
||||
if (unitModelInfo.VendorId != null)
|
||||
o.UnitModelVendorViz = await ct.Vendor.AsNoTracking().Where(x => x.Id == unitModelInfo.VendorId).Select(x => x.Name).FirstOrDefaultAsync();
|
||||
@@ -4814,7 +4820,7 @@ namespace AyaNova.Biz
|
||||
if (o is Quote)
|
||||
{
|
||||
Quote dto = new Quote();
|
||||
CopyObject.Copy(o, dto,"Name");
|
||||
CopyObject.Copy(o, dto, "Name");
|
||||
return await QuotePutAsync((Quote)dto);
|
||||
}
|
||||
return await QuotePutAsync((Quote)o) as ICoreBizObjectModel;
|
||||
|
||||
@@ -968,10 +968,10 @@ namespace AyaNova.Biz
|
||||
|
||||
//Alert notes
|
||||
//Customer notes first then others below
|
||||
var custInfo = await ct.Customer.AsNoTracking().Where(x => x.Id == o.CustomerId).Select(x => new { AlertViz = x.AlertNotes, x.TechNotes, CustomerViz = x.Name }).FirstOrDefaultAsync();
|
||||
if (!string.IsNullOrWhiteSpace(custInfo.AlertViz))
|
||||
var custInfo = await ct.Customer.AsNoTracking().Where(x => x.Id == o.CustomerId).Select(x => new { x.AlertNotes, x.TechNotes, x.Name, x.Phone1, x.Phone2, x.Phone3, x.Phone4, x.Phone5, x.EmailAddress }).FirstOrDefaultAsync();
|
||||
if (!string.IsNullOrWhiteSpace(custInfo.AlertNotes))
|
||||
{
|
||||
o.AlertViz = $"{await Translate("Customer")} - {await Translate("AlertNotes")}\n{custInfo.AlertViz}\n\n";
|
||||
o.AlertViz = $"{await Translate("Customer")} - {await Translate("AlertNotes")}\n{custInfo.AlertNotes}\n\n";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(custInfo.TechNotes))
|
||||
@@ -979,7 +979,13 @@ namespace AyaNova.Biz
|
||||
o.CustomerTechNotesViz = $"{await Translate("CustomerTechNotes")}\n{custInfo.TechNotes}\n\n";
|
||||
}
|
||||
|
||||
o.CustomerViz = custInfo.CustomerViz;
|
||||
o.CustomerViz = custInfo.Name;
|
||||
o.CustomerPhone1Viz = custInfo.Phone1;
|
||||
o.CustomerPhone2Viz = custInfo.Phone2;
|
||||
o.CustomerPhone3Viz = custInfo.Phone3;
|
||||
o.CustomerPhone4Viz = custInfo.Phone4;
|
||||
o.CustomerPhone5Viz = custInfo.Phone5;
|
||||
o.CustomerEmailAddressViz = custInfo.EmailAddress;
|
||||
|
||||
if (o.ProjectId != null)
|
||||
o.ProjectViz = await ct.Project.AsNoTracking().Where(x => x.Id == o.ProjectId).Select(x => x.Name).FirstOrDefaultAsync();
|
||||
@@ -6064,7 +6070,7 @@ namespace AyaNova.Biz
|
||||
if (unitInfo.UnitModelId != null)
|
||||
{
|
||||
var unitModelInfo = await ct.UnitModel.AsNoTracking().Where(x => x.Id == unitInfo.UnitModelId).Select(x => new { x.Name, x.VendorId }).FirstOrDefaultAsync();
|
||||
o.UnitModelNameViz = unitModelInfo.Name;
|
||||
o.UnitModelNameViz = unitModelInfo.Name;
|
||||
|
||||
if (unitModelInfo.VendorId != null)
|
||||
o.UnitModelVendorViz = await ct.Vendor.AsNoTracking().Where(x => x.Id == unitModelInfo.VendorId).Select(x => x.Name).FirstOrDefaultAsync();
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace AyaNova.Models
|
||||
public DateTime? StopGeneratingDate { get; set; }
|
||||
[Required]
|
||||
public AyaDaysOfWeek ExcludeDaysOfWeek { get; set; }//bit field flags set
|
||||
[Required]
|
||||
[Required]
|
||||
public bool Active { get; set; }
|
||||
[Required]
|
||||
public DateTime NextServiceDate { get; set; }
|
||||
@@ -49,9 +49,20 @@ namespace AyaNova.Models
|
||||
public long CustomerId { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerViz { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string CustomerTechNotesViz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerPhone1Viz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerPhone2Viz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerPhone3Viz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerPhone4Viz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerPhone5Viz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerEmailAddressViz { get; set; }
|
||||
|
||||
public long? ProjectId { get; set; }
|
||||
[NotMapped]
|
||||
@@ -116,7 +127,7 @@ namespace AyaNova.Models
|
||||
[NotMapped, JsonIgnore]
|
||||
public AyaType AyaType { get => AyaType.PM; }
|
||||
|
||||
//workaround for notification
|
||||
//workaround for notification
|
||||
[NotMapped, JsonIgnore]
|
||||
public string Name
|
||||
{
|
||||
|
||||
@@ -40,6 +40,18 @@ namespace AyaNova.Models
|
||||
|
||||
[NotMapped]
|
||||
public string CustomerTechNotesViz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerPhone1Viz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerPhone2Viz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerPhone3Viz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerPhone4Viz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerPhone5Viz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerEmailAddressViz { get; set; }
|
||||
|
||||
public long? ProjectId { get; set; }
|
||||
[NotMapped]
|
||||
@@ -110,7 +122,7 @@ namespace AyaNova.Models
|
||||
[NotMapped, JsonIgnore]
|
||||
public AyaType AyaType { get => AyaType.Quote; }
|
||||
|
||||
//workaround for notification
|
||||
//workaround for notification
|
||||
[NotMapped, JsonIgnore]
|
||||
public string Name
|
||||
{
|
||||
|
||||
@@ -27,6 +27,18 @@ namespace AyaNova.Models
|
||||
|
||||
[NotMapped]
|
||||
public string CustomerTechNotesViz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerPhone1Viz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerPhone2Viz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerPhone3Viz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerPhone4Viz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerPhone5Viz { get; set; }
|
||||
[NotMapped]
|
||||
public string CustomerEmailAddressViz { get; set; }
|
||||
|
||||
public long? ProjectId { get; set; }
|
||||
[NotMapped]
|
||||
|
||||
Reference in New Issue
Block a user