Files
BeWoPlaner/Report/ReportObjects/CustomerListRO.cs
2023-09-13 01:39:27 +02:00

36 lines
963 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BS.Shared.Core;
using BS.Shared.DataContracts.Compact;
namespace BeWo.Report.ReportObjects
{
public class CustomerListRO : AbstractBeWoReportObject<CustomerListRO>
{
public List<CustomerDataRO> CustomerList { get; set; }
public static CustomerListRO Create(List<long> oids)
{
var ro = new CustomerListRO();
ro.CustomerList = new List<CustomerDataRO>();
var customers = DAOFactory.GenericDAO.LoadByIDs<Customer>(oids);
var dclist = MapperFactory.CustomerDC_Customer.MapToNewDCs(customers);
foreach (var item in dclist)
{
var customerRO = CustomerDataRO.Create(item);
ro.CustomerList.Add(customerRO);
}
return ro;
}
}
}