예제 #1
0
        /// <summary>
        /// Maps <see cref="NoteDisplay"/> to <see cref="INote"/>.
        /// </summary>
        /// <param name="noteDisplay">
        /// The note display.
        /// </param>
        /// <returns>
        /// The <see cref="INote"/>.
        /// </returns>
        public static INote ToNote(this NoteDisplay noteDisplay)
        {
            var note = new Note(noteDisplay.EntityKey, noteDisplay.EntityTfKey)
            {
                Message    = noteDisplay.Message,
                CreateDate = noteDisplay.RecordDate == DateTime.MinValue ? DateTime.Now : noteDisplay.RecordDate
            };

            if (!noteDisplay.Key.Equals(Guid.Empty))
            {
                note.Key = noteDisplay.Key;
            }

            return(note);
        }
예제 #2
0
        /// <summary>
        /// Adds an <see cref="NoteDisplay"/> to extended data.  This is intended for a note against the sale (delivery instructions, etc)
        /// </summary>
        /// <param name="extendedData">
        /// The extended Data.
        /// </param>
        /// <param name="note">
        /// The note.
        /// </param>
        public static void AddNote(this ExtendedDataCollection extendedData, NoteDisplay note)
        {
            var noteXml = SerializationHelper.SerializeToXml(note as NoteDisplay);

            extendedData.SetValue(Constants.ExtendedDataKeys.Note, noteXml);
        }
        /// <summary>
        /// Adds an <see cref="NoteDisplay"/> to extended data.  This is intended for a note against the sale (delivery instructions, etc)
        /// </summary>
        /// <param name="extendedData">
        /// The extended Data.
        /// </param>
        /// <param name="note">
        /// The note.
        /// </param>
        public static void AddNote(this ExtendedDataCollection extendedData, NoteDisplay note)
        {
            var noteXml = SerializationHelper.SerializeToXml(note as NoteDisplay);

            extendedData.SetValue(Constants.ExtendedDataKeys.Note, noteXml);
        }