Пример #1
0
        public async Task<ActionResult> AddCalendarEvent(UserEventViewModel userEventViewModel)
        {
            UserEvent userEvent = new UserEvent()
            {
                Content = userEventViewModel.Comments,
                Creator = _siteUserManager.FindById(User.Identity.GetUserId())
            };
            await _eventsService.CreateAsync(userEvent);

            /*TimeSpanEvent timeSpanEvent = new TimeSpanEvent()
            {
                BeginDate = UserEventViewModel.Date,
                Topic = UserEventViewModel.Topic,
                Comments = UserEventViewModel.Comments,
                OwnerUserId = User.Identity.GetUserId(),
                UserEvent = userEvent,
                EventType = EventType.Calendar
            }; 

            await _timeSpanEventService.CreateAsync(timeSpanEvent);*/

            return PartialView("Calendar");
        }
Пример #2
0
 public async Task<UserEvent> UpdateAsync(UserEvent newUserEvent)
 {
     _userEventRepository.Update(newUserEvent);
     await _unitOfWork.SaveChangesAsync();
     return newUserEvent;
 }
Пример #3
0
 public async Task<UserEvent> CreateAsync(UserEvent userEvent)
 {
     _userEventRepository.Insert(userEvent);
     await _unitOfWork.SaveChangesAsync();
     return userEvent;
 }