Ejemplo n.º 1
0
        public async Task CreateEventTypeAsync(CreateEventTypeDto eventType)
        {
            await ValidateEventTypeNameAsync(eventType.Name, eventType.OrganizationId);

            var entity = MapNewEventType(eventType);

            _eventTypesDbSet.Add(entity);
            await _uow.SaveChangesAsync(eventType.UserId);
        }
Ejemplo n.º 2
0
        private static EventType MapNewEventType(CreateEventTypeDto eventTypeDto)
        {
            var eventType = new EventType
            {
                Created             = DateTime.UtcNow,
                Modified            = DateTime.UtcNow,
                CreatedBy           = eventTypeDto.UserId,
                OrganizationId      = eventTypeDto.OrganizationId,
                IsSingleJoin        = eventTypeDto.IsSingleJoin,
                SendWeeklyReminders = eventTypeDto.SendWeeklyReminders,
                Name = eventTypeDto.Name,
                SingleJoinGroupName   = SetSingleJoinGroupName(eventTypeDto.IsSingleJoin, eventTypeDto.SingleJoinGroupName),
                IsShownWithMainEvents = eventTypeDto.IsShownWithMainEvents,
                SendEmailToManager    = eventTypeDto.SendEmailToManager
            };

            return(eventType);
        }