public void Create(ShooterCollection shooter)
 {
   t_shootercollection entity = new t_shootercollection();
   entity.UpdateEntity(shooter);
   _sqlRepository.Insert(entity);
   shooter.ShooterCollectionId = entity.ShooterCollectionId;
 }
    private void ExecuteAddCommand(string obj)
    {
      ShooterCollection sc = new ShooterCollection
      {
        CollectionName = obj
      };
      _shooterCollectionDataStore.Create(sc);

      UiEventsDelegate<UiParticipation> handler = _uiEvents.FetchSelectedParticipation;
      if (handler != null)
      {
        UiParticipation p = handler();
        if (p != null)
        {
          ShooterCollectionParticipation scp = new ShooterCollectionParticipation
          {
            ParticipationId = p.ParticipationId,
            ShooterCollectionId = sc.ShooterCollectionId
          };
          _shooterCollectionParticipationDataStore.Create(scp);
        }
      }

      _windowService.CloseTextBoxInputDialog();
    }
 public void Add(Person person, decimal score, ShooterCollection shooterCollection)
 {
     if (!_shooterCollectionNames.ContainsKey(shooterCollection.ShooterCollectionId))
         _shooterCollectionNames.Add(shooterCollection.ShooterCollectionId, shooterCollection.CollectionName);
     _rankItems.Add(new Tuple<Person, decimal, int>(person, score, shooterCollection.ShooterCollectionId));
 }
 public static t_shootercollection UpdateEntity(this t_shootercollection entity, ShooterCollection shooterCollection)
 {
     entity.CollectionName = shooterCollection.CollectionName;
     entity.ProgramNumber = shooterCollection.ProgramNumber;
     return entity;
 }
示例#5
0
        private void RegisterCreateGroupingDialog(IShooterCollectionDataStore shooterCollectionDataStore, ServiceDeskConfiguration serviceDeskConfiguration)
        {
            _messenger.Register<CreateGroupingDialogMessage>(this,
                x =>
                {
                    var m = new CreateGroupingViewModel(serviceDeskConfiguration)
                    {
                        Title = "Gruppierung erstellen"
                    };

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

                    ShooterCollection sc = new ShooterCollection
                    {
                        CollectionName = m.GroupingName,
                        ProgramNumber = int.Parse(m.SelectedParticipation.ProgramNumber)
                    };

                    shooterCollectionDataStore.Create(sc);
                    _messenger.Send(new RefreshDataFromRepositoriesMessage());
                });
        }
 public void Delete(ShooterCollection shooterCollection)
 {
   t_shootercollection entity = _sqlRepository.Find(_ => _.ShooterCollectionId == shooterCollection.ShooterCollectionId).Single();
   _sqlRepository.Delete(entity);
 }
 public void Update(ShooterCollection shooterCollection)
 {
   t_shootercollection entity = _sqlRepository.Find(_ => _.ShooterCollectionId == shooterCollection.ShooterCollectionId).Single();
   entity.UpdateEntity(shooterCollection);
   _sqlRepository.Commit();
 }
    private void ExecuteCreateParticipationCommand(ParticipationDraft participationDraft)
    {
      ShooterCollection shooterCollection = new ShooterCollection
      {
        CollectionName = participationDraft.ParticipationName
      };
      _shooterCollectionDataStore.Create(shooterCollection);

      ShooterCollectionParticipation collectionParticipation = new ShooterCollectionParticipation
      {
        ParticipationId = participationDraft.ParticipationType.ParticipationTypeId,
        ShooterCollectionId = shooterCollection.ShooterCollectionId
      };

      _shooterCollectionParticipationDataStore.Create(collectionParticipation);
      _windowService.CloseCreateParticipationWindow();
    }