예제 #1
0
        public bool InkPen(Pen pen, Ink ink)
        {
            Entities.Pen penEntity = DtoToEntityConverter.Convert(pen);
            Entities.Ink inkEntity = DtoToEntityConverter.Convert(ink);

            penEntity.InkUp(inkEntity);

            pen = EntityToDtoConverter.Convert(penEntity);

            return(Storage.UpdatePen(pen));
        }
예제 #2
0
        public static Pen Convert(Entities.Pen penEntity)
        {
            Pen useCasePen = new Pen()
            {
                Id           = penEntity.Id,
                Manufacturer = penEntity.Manufacturer,
                Model        = penEntity.Model,
                Ink          = Convert(penEntity.Ink)
            };

            return(useCasePen);
        }
예제 #3
0
        public static Entities.Pen Convert(Pen pen)
        {
            Entities.Pen penEntity = new Entities.Pen()
            {
                Id           = pen.Id,
                Manufacturer = pen.Manufacturer,
                Model        = pen.Model
            };

            if (pen.Ink != null)
            {
                penEntity.Ink = Convert(pen.Ink);
            }

            return(penEntity);
        }