38 lines
982 B
C#
38 lines
982 B
C#
using Step.Model.DatabaseModels;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Step.Model.DTOModels.AlarmModels
|
|
{
|
|
public class DTONewAlarmNoteModel
|
|
{
|
|
[Required]
|
|
public string Message { get; set; }
|
|
}
|
|
|
|
public class DTOAlarmNoteModel : DTONewAlarmNoteModel
|
|
{
|
|
public int Id { get; set; }
|
|
|
|
public DateTime DateTime { get; set; }
|
|
|
|
public DTOMessageUserModel User { get; set; }
|
|
|
|
public static explicit operator DTOAlarmNoteModel(AlarmNoteModel note)
|
|
{
|
|
DTOMessageUserModel user = note.User != null ? (DTOMessageUserModel)note.User : null;
|
|
return new DTOAlarmNoteModel()
|
|
{
|
|
Id = note.NoteId,
|
|
DateTime = note.DateTime,
|
|
Message = note.Message,
|
|
User = user
|
|
};
|
|
}
|
|
}
|
|
}
|