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

            var dto = new HoaDonBanHangDTO();

            dto.MaHDBH     = entity.MaHDBH;
            dto.MaKH       = entity.MaKH;
            dto.NgayLap    = entity.NgayLap;
            dto.CKPhanTram = entity.CKPhanTram;
            dto.CKTienMat  = entity.CKTienMat;
            dto.ThanhTien  = entity.ThanhTien;

            entity.OnDTO(dto);

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

            var entity = new HoaDonBanHang();

            entity.MaHDBH     = dto.MaHDBH;
            entity.MaKH       = dto.MaKH;
            entity.NgayLap    = dto.NgayLap;
            entity.CKPhanTram = dto.CKPhanTram;
            entity.CKTienMat  = dto.CKTienMat;
            entity.ThanhTien  = dto.ThanhTien;

            dto.OnEntity(entity);

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