private void DeleteCampaign_Click(object sender, RoutedEventArgs e)
        {
            CampaignRepo campaignRepo = new CampaignRepo();

            campaignRepo.delete(((CampaignCardViewModel)this.DataContext).campaign);
            CampaignDataStore.instance.data.Remove(((CampaignCardViewModel)this.DataContext).campaign);
        }
 public CampaignsController(DnDEasyContext context, UserRepo urepo, CampaignRepo crepo, CharacterRepo repo)
 {
     _context = context;
     URepo    = urepo;
     CRepo    = crepo;
     Repo     = repo;
 }
Ejemplo n.º 3
0
 public CharacterCampaignController(CharacterRepo repo, UserRepo urepo, CampaignRepo crepo)
 {
     // _context = context;
     Repo  = repo;
     URepo = urepo;
     CRepo = crepo;
 }
Ejemplo n.º 4
0
        private void addCampaign(object sender, RoutedEventArgs e)
        {
            CampaignRepo campaign    = new CampaignRepo();
            Campaign     newCampaign = new Campaign()
            {
                name = nameTextBox.Text, startDate = CampaignStartDatePicker.SelectedDate.Value.Date, endDate = CampaignEndDatePicker.SelectedDate.Value.Date, description = CampaignDescriptionTextBox.Text, goal = CampaignGoalTextBox.Text
            };

            campaign.save(newCampaign);
            CampaignDataStore.instance.data.Add(newCampaign);
        }
        private void UpdateCampaign_Click(object sender, RoutedEventArgs e)
        {
            CampaignRepo campaignRepo = new CampaignRepo();
            Campaign     campaign     = ((CampaignCardViewModel)this.DataContext).campaign;

            campaign.name        = nameTextBox.Text;
            campaign.description = descriptionTextBox.Text;
            campaign.goal        = goalTextBox.Text;
            campaign.startDate   = startDate.SelectedDate.Value.Date;
            campaign.endDate     = endDate.SelectedDate.Value.Date;

            campaignRepo.update(campaign);
        }
Ejemplo n.º 6
0
 public CampaignRepoTests()
 {
     this.repo = new CampaignRepo(GetDbOptions());
 }
Ejemplo n.º 7
0
 public CampaignList(CampaignRepo repo)
 {
     this.repo = repo;
 }