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

            var dto = new tblBillEntryDTO();

            dto.BillOrderId      = entity.BillOrderId;
            dto.BillId           = entity.BillId;
            dto.BookingOldBrCode = entity.BookingOldBrCode;
            dto.OldBillNo        = entity.OldBillNo;
            dto.OldBillDate      = entity.OldBillDate;
            dto.DestnCode        = entity.DestnCode;
            dto.Particulars      = entity.Particulars;
            dto.ChargedWeight    = entity.ChargedWeight;
            dto.Rate             = entity.Rate;
            dto.Amount           = entity.Amount ?? 0;

            entity.OnDTO(dto);

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

            var entity = new tblBillEntry();

            entity.BillOrderId      = dto.BillOrderId;
            entity.BillId           = dto.BillId;
            entity.BookingOldBrCode = dto.BookingOldBrCode;
            entity.OldBillNo        = dto.OldBillNo;
            entity.OldBillDate      = dto.OldBillDate;
            entity.DestnCode        = dto.DestnCode;
            entity.Particulars      = dto.Particulars;
            entity.ChargedWeight    = dto.ChargedWeight;
            entity.Rate             = dto.Rate;
            entity.Amount           = dto.Amount;

            dto.OnEntity(entity);

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