protected override async Task Handle(MasterVenueLayoutSectionsUpdateCommand command)
        {
            var masterVenueLayoutSection = _masterVenueLayoutSectionRepository.GetByAltId(new Guid(command.AltId));

            if (masterVenueLayoutSection != null)
            {
                masterVenueLayoutSection.SectionName = command.SectionName;
                masterVenueLayoutSection.Capacity    = command.Capacity;
                masterVenueLayoutSection.EntryGateId = command.EntryGateId;
                masterVenueLayoutSection.ModifiedBy  = command.ModifiedBy;
                _masterVenueLayoutSectionRepository.Save(masterVenueLayoutSection);
            }
        }
Example #2
0
        protected override async Task Handle(MasterVenueLayoutSectionsCommand command)
        {
            var masterVenueLayout = new MasterVenueLayoutSection
            {
                AltId                      = Guid.NewGuid(),
                SectionName                = command.SectionName,
                Capacity                   = command.Capacity,
                MasterVenueLayoutId        = command.MasterVenueLayoutId,
                MasterVenueLayoutSectionId = command.MasterVenueLayoutSectionId,
                VenueLayoutAreaId          = command.VenueLayoutAreaId,
                EntryGateId                = command.EntryGateId,
                ModifiedBy                 = command.ModifiedBy,
                IsEnabled                  = true
            };

            _masterVenueLayoutSectionRepository.Save(masterVenueLayout);
            return;
        }
        protected override async Task <ICommandResult> Handle(CreateSeatLayoutCommand command)
        {
            var masterVenueLayoutSectionInfo = _masterVenueLayoutSectionRepository.Get(command.MasterVenueLayoutSectionSeatDetails[0].MasterVenueLayoutSectionId);

            if (masterVenueLayoutSectionInfo.IsSeatExists == true)
            {
                return(new CreateSeatLayoutCommandResult
                {
                    IsExisting = true,
                    Success = false,
                    Id = 0,
                });
            }
            else
            {
                foreach (var item in command.MasterVenueLayoutSectionSeatDetails)
                {
                    var MasterVenueLayoutSectionSeatDetails = new MasterVenueLayoutSectionSeat
                    {
                        AltId        = Guid.NewGuid(),
                        SeatTag      = item.SeatTag,
                        SeatTypeId   = item.SeatTypeId,
                        RowNumber    = item.RowNumber,
                        RowOrder     = item.RowOrder,
                        ColumnNumber = item.ColumnNumber,
                        ColumnOrder  = item.ColumnOrder,
                        MasterVenueLayoutSectionId = item.MasterVenueLayoutSectionId,
                        ModifiedBy = command.ModifiedBy,
                        IsEnabled  = true,
                        CreatedUtc = DateTime.UtcNow,
                        CreatedBy  = command.ModifiedBy
                    };
                    _masterVenueLayoutSectionSeatRepository.Save(MasterVenueLayoutSectionSeatDetails);
                }

                masterVenueLayoutSectionInfo.IsSeatExists = true;
                _masterVenueLayoutSectionRepository.Save(masterVenueLayoutSectionInfo);
                return(new CreateSeatLayoutCommandResult
                {
                    IsExisting = false,
                    Success = true,
                });
            }
        }