public void Create(CollectionShooter shooter)
 {
   t_collectionshooter entity = new t_collectionshooter();
   entity.UpdateEntity(shooter);
   _sqlRepository.Insert(entity);
   shooter.CollectionShooterId = entity.CollectionShooterId;
 }
    private void ExecuteAssignShooterCommand(UiShooterCollection obj)
    {
      CollectionShooter collectionShooter = new CollectionShooter
      {
        ShooterId = UiShooter.ShooterId,
        ShooterCollectionId = UiShooterCollection.ShooterCollectionId
      };

      _collectionShooterDataStore.Create(collectionShooter);
      _windowService.CloseEditShooterWindow();
    }
 public static t_collectionshooter UpdateEntity(this t_collectionshooter entity, CollectionShooter shooter)
 {
   entity.ShooterId = shooter.ShooterId;
   entity.ShooterCollectionId = shooter.ShooterCollectionId;
   return entity;
 }
Example #4
0
        private void RegisterAddGroupingToShooterDialog(ICollectionShooterDataStore collectionShooterDataStore)
        {
            _messenger.Register<AddGroupingToShooterDialogMessage>(this,
                x =>
                {
                    SelectGroupingViewModel vm = new SelectGroupingViewModel
                    {
                        Title = "Gruppe auswählen"
                    };

                    vm.Initialize(x.ShooterId);

                    IWindow w = _vs.ExecuteFunction<SelectGroupingViewModel, IWindow>((IWindow) Current.MainWindow, vm);
                    bool? result = w.ShowDialog();
                    if (!result.HasValue || !result.Value) return;

                    CollectionShooter cs = new CollectionShooter
                    {
                        ShooterId = x.ShooterId,
                        ShooterCollectionId = vm.SelectedGrouping.ShooterCollectionId
                    };
                    collectionShooterDataStore.Create(cs);

                    _messenger.Send(new RefreshDataFromRepositoriesMessage());
                });
        }
 public void Delete(CollectionShooter collectionShooter)
 {
   t_collectionshooter entity = _sqlRepository.Find(_ => _.CollectionShooterId == collectionShooter.CollectionShooterId).Single();
   _sqlRepository.Delete(entity);
 }
 public void Update(CollectionShooter collectionShooter)
 {
   t_collectionshooter entity = _sqlRepository.Find(_ => _.CollectionShooterId == collectionShooter.CollectionShooterId).Single();
   entity.UpdateEntity(collectionShooter);
   _sqlRepository.Commit();
 }
    private void ExecuteAssignCommand(UiShooter obj)
    {
      CollectionShooter collectionShooter = new CollectionShooter
      {
        ShooterCollectionId = SelectedUiShooterCollection.ShooterCollectionId,
        ShooterId = obj.ShooterId
      };

      _collectionShooterDataStore.Create(collectionShooter);
      LoadData();
    }