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

            var dto = new SoBanHangDTO();

            dto.MaSBH      = entity.MaSBH;
            dto.NgayLap    = entity.NgayLap;
            dto.MaKH       = entity.MaKH;
            dto.TongDuNo   = entity.TongDuNo;
            dto.NgayDongSo = entity.NgayDongSo;

            entity.OnDTO(dto);

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

            var entity = new SoBanHang();

            entity.MaSBH      = dto.MaSBH;
            entity.NgayLap    = dto.NgayLap;
            entity.MaKH       = dto.MaKH;
            entity.TongDuNo   = dto.TongDuNo;
            entity.NgayDongSo = dto.NgayDongSo;

            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="SoBanHang"/> converted from <see cref="SoBanHangDTO"/>.</param>
 static partial void OnEntity(this SoBanHangDTO dto, SoBanHang entity);
Exemplo n.º 4
0
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="SoBanHangDTO"/> converted from <see cref="SoBanHang"/>.</param>
 static partial void OnDTO(this SoBanHang entity, SoBanHangDTO dto);