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

            var dto = new medicationDto();

            dto.v_MedicationId     = entity.v_MedicationId;
            dto.v_ServiceId        = entity.v_ServiceId;
            dto.v_ProductId        = entity.v_ProductId;
            dto.v_ProductName      = entity.v_ProductName;
            dto.v_PresentationName = entity.v_PresentationName;
            dto.r_Quantity         = entity.r_Quantity;
            dto.r_QuantityVendida  = entity.r_QuantityVendida;
            dto.v_Doses            = entity.v_Doses;
            dto.i_ViaId            = entity.i_ViaId;
            dto.i_SeVendio         = entity.i_SeVendio;
            dto.i_SeCreoAca        = entity.i_SeCreoAca;
            dto.i_IsDeleted        = entity.i_IsDeleted;
            dto.i_InsertUserId     = entity.i_InsertUserId;
            dto.d_InsertDate       = entity.d_InsertDate;
            dto.i_UpdateUserId     = entity.i_UpdateUserId;
            dto.d_UpdateDate       = entity.d_UpdateDate;

            entity.OnDTO(dto);

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

            var entity = new medication();

            entity.v_MedicationId     = dto.v_MedicationId;
            entity.v_ServiceId        = dto.v_ServiceId;
            entity.v_ProductId        = dto.v_ProductId;
            entity.v_ProductName      = dto.v_ProductName;
            entity.v_PresentationName = dto.v_PresentationName;
            entity.r_Quantity         = dto.r_Quantity;
            entity.r_QuantityVendida  = dto.r_QuantityVendida;
            entity.v_Doses            = dto.v_Doses;
            entity.i_ViaId            = dto.i_ViaId;
            entity.i_SeVendio         = dto.i_SeVendio;
            entity.i_SeCreoAca        = dto.i_SeCreoAca;
            entity.i_IsDeleted        = dto.i_IsDeleted;
            entity.i_InsertUserId     = dto.i_InsertUserId;
            entity.d_InsertDate       = dto.d_InsertDate;
            entity.i_UpdateUserId     = dto.i_UpdateUserId;
            entity.d_UpdateDate       = dto.d_UpdateDate;

            dto.OnEntity(entity);

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