Example #1
0
        /// <summary>
        /// Map the basic fields for the CloseoutReason table to the DiaryNote model object
        /// </summary>
        /// <param name="record">The SqlDataReader with the executed query result</param>
        /// <param name="prefix">a prefix used to identify fields for the CloseoutReason model  in the resultset if required</param>        
        /// <returns>An instance of Model.Booking.CloseoutReason</returns>
        internal static CloseoutReason MapRecord(IDataRecord record, string prefix = "")
        {
            var closeoutReason = new CloseoutReason
            {
                Id = DbHelper.ConvertValue<int>(record[prefix + Parameters.Id]),
                Name = DbHelper.ConvertValue<string>(record[prefix + Parameters.Name]),
                Description = DbHelper.ConvertValue<string>(record[prefix + Parameters.Description])
            };

            return AuditFieldsHelper.MapRecord(closeoutReason, record, prefix);
        }
        /// <summary>
        /// converts a closeout reason to the data transfer version of a closeout reason
        /// </summary>
        /// <param name="reason">closeout reason to change</param>
        /// <returns>a CloseoutReasonDto</returns>
        public static CloseoutReasonDto ConvertCloseoutReasonToDto(CloseoutReason reason)
        {
            var reasonDto = new CloseoutReasonDto
            {
                Id = reason.Id,
                Name = reason.Name,
                Description = reason.Description
            };

            return reasonDto;
        }