26 lines
636 B
C#
26 lines
636 B
C#
using System.Linq;
|
|
using Pcm.Db.Entities;
|
|
|
|
namespace Drab.Logic.Dtos;
|
|
|
|
public class PozDokDto
|
|
{
|
|
public long DokId { get; set; }
|
|
public TowarDto Towar { get; set; }
|
|
public decimal Ilosc { get; set; }
|
|
public string Komentarz { get; set; }
|
|
}
|
|
|
|
internal static class PozDokExtensions
|
|
{
|
|
internal static PozDokDto ToPozDokDto(this PozDok pozDok)
|
|
{
|
|
return new PozDokDto
|
|
{
|
|
DokId = (long)pozDok.DokId,
|
|
Ilosc = pozDok.IloscPlus,
|
|
Towar = pozDok.Tow.ToTowarDto(),
|
|
Komentarz = string.Join("; ", pozDok.TekstPozs.Select(x => x.Tekst.Trim()))
|
|
};
|
|
}
|
|
} |