Esempio n. 1
0
        public static Notice From(PendingNoticeViewModel vm)
        {
            Notice n = new Notice
            {
                NoticeId         = vm.Id,
                Title            = vm.Title,
                NoticeBoardId    = vm.NoticeBoardId,
                Description      = vm.Description,
                DateCreated      = vm.DateCreated,
                HighPriority     = vm.IsHighPriority,
                ModeratorComment = vm.Comment,
                Status           = vm.Status,
                DateReviewed     = vm.DateReviewed
            };

            return(n);
        }
Esempio n. 2
0
        public static PendingNoticeViewModel ToPendingNoticeViewModel(Notice notice)
        {
            PendingNoticeViewModel vm = new PendingNoticeViewModel
            {
                Id              = notice.NoticeId,
                Title           = notice.Title,
                NoticeBoardId   = notice.NoticeBoardId,
                Description     = notice.Description,
                DateCreated     = notice.DateCreated,
                IsHighPriority  = notice.HighPriority,
                Comment         = notice.ModeratorComment,
                Status          = notice.Status,
                DateReviewed    = notice.DateReviewed,
                NoticeBoardName = notice.NoticeBoard.Title
            };

            return(vm);
        }