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

            var entity = new tblMRNote();

            entity.MRId           = dto.MRId;
            entity.MrNo           = dto.MrNo;
            entity.BillId         = dto.BillId;
            entity.MRDate         = dto.MRDate;
            entity.RecievedFrom   = dto.RecievedFrom;
            entity.LocationFrom   = dto.LocationFrom;
            entity.LocationTo     = dto.LocationTo;
            entity.NoofPackages   = dto.NoofPackages;
            entity.Weight         = dto.Weight;
            entity.AmountRecieved = dto.AmountRecieved;
            entity.WayOfRecieve   = dto.WayOfRecieve;
            entity.Fright         = dto.Fright;
            entity.StCharges      = dto.StCharges;
            entity.Hamali         = dto.Hamali;
            entity.Other1         = dto.Other1;
            entity.Other2         = dto.Other2;
            entity.Other3         = dto.Other3;
            entity.Other4         = dto.Other4;
            entity.TotalAmount    = dto.TotalAmount;
            entity.CreationDate   = dto.CreationDate;

            dto.OnEntity(entity);

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

            var dto = new tblMRNoteDTO();

            dto.MRId           = entity.MRId;
            dto.MrNo           = entity.MrNo;
            dto.BillId         = entity.BillId ?? 0;
            dto.MRDate         = entity.MRDate;
            dto.RecievedFrom   = entity.RecievedFrom;
            dto.LocationFrom   = entity.LocationFrom;
            dto.LocationTo     = entity.LocationTo;
            dto.BillNo         = entity.tblBill.BillNo;
            dto.BillDate       = entity.tblBill.BillDate.Value.ToString("dd-MM-yyyy");
            dto.BillAmount     = entity.tblBill.GrandTotal;
            dto.NoofPackages   = entity.NoofPackages;
            dto.Weight         = entity.Weight;
            dto.AmountRecieved = entity.AmountRecieved;
            dto.WayOfRecieve   = entity.WayOfRecieve;
            dto.Fright         = entity.Fright;
            dto.StCharges      = entity.StCharges;
            dto.Hamali         = entity.Hamali;
            dto.Other1         = entity.Other1;
            dto.Other2         = entity.Other2;
            dto.Other3         = entity.Other3;
            dto.Other4         = entity.Other4;
            dto.TotalAmount    = entity.TotalAmount;
            dto.CreationDate   = entity.CreationDate;

            entity.OnDTO(dto);

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