Exemplo n.º 1
0
        /// <summary>
        /// Converts this instance of <see cref="ChiTietHDNH"/> to an instance of <see cref="ChiTietHDNHDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="ChiTietHDNH"/> to convert.</param>
        public static ChiTietHDNHDTO ToDTO(this ChiTietHDNH entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new ChiTietHDNHDTO();

            dto.MaCTHDNH = entity.MaCTHDNH;
            dto.MaHDNH   = entity.MaHDNH;
            dto.MaSP     = entity.MaSP;
            dto.Gia      = entity.Gia;
            dto.SoLuong  = entity.SoLuong;

            entity.OnDTO(dto);

            return(dto);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Converts this instance of <see cref="ChiTietHDNHDTO"/> to an instance of <see cref="ChiTietHDNH"/>.
        /// </summary>
        /// <param name="dto"><see cref="ChiTietHDNHDTO"/> to convert.</param>
        public static ChiTietHDNH ToEntity(this ChiTietHDNHDTO dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new ChiTietHDNH();

            entity.MaCTHDNH = dto.MaCTHDNH;
            entity.MaHDNH   = dto.MaHDNH;
            entity.MaSP     = dto.MaSP;
            entity.Gia      = dto.Gia;
            entity.SoLuong  = dto.SoLuong;

            dto.OnEntity(entity);

            return(entity);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Invoked when <see cref="ToEntity"/> operation is about to return.
 /// </summary>
 /// <param name="entity"><see cref="ChiTietHDNH"/> converted from <see cref="ChiTietHDNHDTO"/>.</param>
 static partial void OnEntity(this ChiTietHDNHDTO dto, ChiTietHDNH entity);
Exemplo n.º 4
0
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="ChiTietHDNHDTO"/> converted from <see cref="ChiTietHDNH"/>.</param>
 static partial void OnDTO(this ChiTietHDNH entity, ChiTietHDNHDTO dto);