Exemple #1
0
 public void SetNation()
 {
     Belligerent.NationId = Int32.Parse(Belligerent.NationIdString);
     Belligerent.Nation   = _nations.FirstOrDefault(n => n.NationId == Belligerent.NationId);
     EventParticipantDataService.Update(Belligerent.EventParticipantId, Belligerent);
     StateHasChanged();
 }
Exemple #2
0
 private void DeleteAsset(int id)
 {
     Belligerent.Assets.Remove(Belligerent.Assets.FirstOrDefault(b => b.AssetId == id));
     EventParticipantDataService.Update(Belligerent.EventParticipantId, Belligerent);
     AssetDataService.Delete(id);
     StateHasChanged();
 }
Exemple #3
0
        public async void AddUnitAssetDialog_OnAssetAdded(Asset asset)
        {
            asset.EventParticipantId = Belligerent.EventParticipantId;
            var entry = await AssetDataService.Add(asset);

            Belligerent.Assets.Add(entry);
            await EventParticipantDataService.Update(Belligerent.EventParticipantId, Belligerent);

            StateHasChanged();
        }
        protected async void AddParticipant()
        {
            var newParticipant = await EventParticipantDataService.Add(new EventParticipant()
            {
                EventId = Event.EventId
            });

            Event.Participants.Add(newParticipant);

            await EventDataService.Update(Event.EventId, Event);

            StateHasChanged();
        }