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

            var dto = new HoaDonNhapHangDTO();

            dto.MaHDNH     = entity.MaHDNH;
            dto.MaNCC      = entity.MaNCC;
            dto.CKPhanTram = entity.CKPhanTram;
            dto.CKTienMat  = entity.CKTienMat;
            dto.ThanhTien  = entity.ThanhTien;
            dto.NgayLap    = entity.NgayLap;

            entity.OnDTO(dto);

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

            var entity = new HoaDonNhapHang();

            entity.MaHDNH     = dto.MaHDNH;
            entity.MaNCC      = dto.MaNCC;
            entity.CKPhanTram = dto.CKPhanTram;
            entity.CKTienMat  = dto.CKTienMat;
            entity.ThanhTien  = dto.ThanhTien;
            entity.NgayLap    = dto.NgayLap;

            dto.OnEntity(entity);

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