Beispiel #1
0
 public static OutMaterialTransactionDTO Map(string name, MaterialTransaction materialTransaction)
 {
     return(new OutMaterialTransactionDTO
     {
         Id = materialTransaction.Id,
         MaterialId = materialTransaction.MaterialId,
         Name = name,
         AvailableAmount = materialTransaction.AvailableAmount,
         User = UserMapper.Map(materialTransaction.User),
         Car = materialTransaction?.Car == null ? null :
               CarMapper.Map(materialTransaction.Car),
         Type = materialTransaction.Type,
         Amount = materialTransaction.Amount,
         CreatedAt = materialTransaction.CreatedAt
     });
 }
Beispiel #2
0
 public static OutCompleteReportDTO CompleteMap(Report report)
 {
     return(new OutCompleteReportDTO
     {
         Id = report.Id,
         User = UserMapper.Map(report.User),
         Car = CarMapper.Map(report.Car),
         Created = report.Created,
         Comment = report.Comment,
         ReportItems = report.ReportItems.Select(reportItem => new OutReportItemDTO
         {
             Id = reportItem.Id,
             Tool = reportItem.Tool == null ? null : ToolMapper.Map(reportItem.Tool),
             Material = reportItem.Material == null ? null : MaterialMapper.Map(reportItem.Material),
             Amount = reportItem.Amount,
             Comment = reportItem.Comment
         })
     });
 }