|
|
@@ -29,6 +29,8 @@ namespace GreenTree.Nachtragsmanagement.Web.Models.Deviation
|
|
|
public string SiteDescription { get; set; }
|
|
|
public string SiteCustomNumber { get; set; }
|
|
|
public int? SiteId { get; set; }
|
|
|
+ public ICollection<string> UserDescriptions { get; set; }
|
|
|
+ public string UserDescription { get; set; }
|
|
|
public string AppendixDescription { get; set; }
|
|
|
public int? AppendixId { get; set; }
|
|
|
public int? DaysReceiptToAppendixOffering { get; set; }
|
|
|
@@ -89,9 +91,11 @@ namespace GreenTree.Nachtragsmanagement.Web.Models.Deviation
|
|
|
Percentage = deviationEntity.Percentage.HasValue
|
|
|
? deviationEntity.Percentage.Value
|
|
|
: (decimal)1.0,
|
|
|
- PercentageValue = deviationEntity.Value.HasValue && deviationEntity.Percentage.HasValue
|
|
|
- ? deviationEntity.Value.Value * deviationEntity.Percentage.Value
|
|
|
- : 0,
|
|
|
+ PercentageValue = deviationEntity.Status != null && deviationEntity.Status.IsZeroValue
|
|
|
+ ? 0
|
|
|
+ : (deviationEntity.Value.HasValue && deviationEntity.Percentage.HasValue
|
|
|
+ ? deviationEntity.Value.Value * deviationEntity.Percentage.Value
|
|
|
+ : 0),
|
|
|
SiteId = deviationEntity.SiteId,
|
|
|
SiteDescription = deviationEntity.Site == null
|
|
|
? deviationEntity.Appendix == null
|
|
|
@@ -107,6 +111,46 @@ namespace GreenTree.Nachtragsmanagement.Web.Models.Deviation
|
|
|
? String.Empty
|
|
|
: deviationEntity.Appendix.Site.CustomNumber
|
|
|
: deviationEntity.Site.CustomNumber,
|
|
|
+ UserDescriptions = deviationEntity.Site == null
|
|
|
+ ? deviationEntity.Appendix == null || (deviationEntity.Appendix != null && deviationEntity.Appendix.Site == null)
|
|
|
+ ? null
|
|
|
+ : deviationEntity.Appendix.Site.Users
|
|
|
+ .Select(r => new
|
|
|
+ {
|
|
|
+ LastName = r.Lastname,
|
|
|
+ Roles = String.Join(", ", r.Roles.Select(u => u.Description))
|
|
|
+ })
|
|
|
+ .OrderBy(r => r.Roles)
|
|
|
+ .Select(r => String.Format("{0}|({1})", r.LastName, r.Roles))
|
|
|
+ .ToList()
|
|
|
+ : deviationEntity.Site.Users
|
|
|
+ .Select(r => new
|
|
|
+ {
|
|
|
+ LastName = r.Lastname,
|
|
|
+ Roles = String.Join(", ", r.Roles.Select(u => u.Description))
|
|
|
+ })
|
|
|
+ .OrderBy(r => r.Roles)
|
|
|
+ .Select(r => String.Format("{0}|({1})", r.LastName, r.Roles))
|
|
|
+ .ToList(),
|
|
|
+ UserDescription = deviationEntity.Site == null
|
|
|
+ ? deviationEntity.Appendix == null || (deviationEntity.Appendix != null && deviationEntity.Appendix.Site == null)
|
|
|
+ ? String.Empty
|
|
|
+ : String.Join(", ",
|
|
|
+ deviationEntity.Appendix.Site.Users
|
|
|
+ .Select(r => new
|
|
|
+ {
|
|
|
+ LastName = r.Lastname,
|
|
|
+ Roles = String.Join(", ", r.Roles.Select(u => u.Description))
|
|
|
+ })
|
|
|
+ .Select(u => String.Format("{0} ({1})", u.LastName, u.Roles)))
|
|
|
+ : String.Join(", ",
|
|
|
+ deviationEntity.Site.Users
|
|
|
+ .Select(r => new
|
|
|
+ {
|
|
|
+ LastName = r.Lastname,
|
|
|
+ Roles = String.Join(", ", r.Roles.Select(u => u.Description))
|
|
|
+ })
|
|
|
+ .Select(u => String.Format("{0} ({1})", u.LastName, u.Roles))),
|
|
|
AppendixId = deviationEntity.AppendixId,
|
|
|
AppendixDescription = deviationEntity.Appendix == null
|
|
|
? "Offen"
|