Пример #1
0
        /// <summary>
        /// Converts this instance of <see cref="ChiTietHDBH"/> to an instance of <see cref="ChiTietHDBHDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="ChiTietHDBH"/> to convert.</param>
        public static ChiTietHDBHDTO ToDTO(this ChiTietHDBH entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new ChiTietHDBHDTO();

            dto.MaCTHDBH = entity.MaCTHDBH;
            dto.MaHDBH   = entity.MaHDBH;
            dto.MaSP     = entity.MaSP;
            dto.SoLuong  = entity.SoLuong;
            dto.GiaBan   = entity.GiaBan;

            entity.OnDTO(dto);

            return(dto);
        }
Пример #2
0
        /// <summary>
        /// Converts this instance of <see cref="ChiTietHDBHDTO"/> to an instance of <see cref="ChiTietHDBH"/>.
        /// </summary>
        /// <param name="dto"><see cref="ChiTietHDBHDTO"/> to convert.</param>
        public static ChiTietHDBH ToEntity(this ChiTietHDBHDTO dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new ChiTietHDBH();

            entity.MaCTHDBH = dto.MaCTHDBH;
            entity.MaHDBH   = dto.MaHDBH;
            entity.MaSP     = dto.MaSP;
            entity.SoLuong  = dto.SoLuong;
            entity.GiaBan   = dto.GiaBan;

            dto.OnEntity(entity);

            return(entity);
        }
Пример #3
0
 /// <summary>
 /// Invoked when <see cref="ToEntity"/> operation is about to return.
 /// </summary>
 /// <param name="entity"><see cref="ChiTietHDBH"/> converted from <see cref="ChiTietHDBHDTO"/>.</param>
 static partial void OnEntity(this ChiTietHDBHDTO dto, ChiTietHDBH entity);
Пример #4
0
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="ChiTietHDBHDTO"/> converted from <see cref="ChiTietHDBH"/>.</param>
 static partial void OnDTO(this ChiTietHDBH entity, ChiTietHDBHDTO dto);