예제 #1
0
        public async Task <IActionResult> AddEvent(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var room = await _dataContext.Rooms.FindAsync(id.Value);

            if (room == null)
            {
                return(NotFound());
            }

            var model = new EventViewModel
            {
                Date       = DateTime.Now,
                RoomId     = room.Id,
                EventTypes = _combosHelper.GetComboEventTypes(),
            };

            return(View(model));
        }
예제 #2
0
 public EventViewModel ToEventViewModel(Event Event)
 {
     return(new EventViewModel
     {
         Id = Event.Id,
         Date = Event.Agenda.Date,
         RoomId = Event.Room.Id,
         Room = Event.Room,
         EventType = Event.EventType,
         Agenda = Event.Agenda,
         Inviteds = Event.Inviteds,
         Organizer = Event.Organizer,
         EventTypeId = Event.EventType.Id,
         InvitesNumber = Event.InvitesNumber,
         Name = Event.Name,
         Remarks = Event.Remarks,
         EventTypes = _combosHelper.GetComboEventTypes()
     });
 }