private void appBarAddFav_Click(object sender, EventArgs e) { if (pvtSorteios.SelectedIndex == 0) { FavMS addFavMs = new FavMS(); if (SorteioMSDoJson != null) { if (MessageBox.Show("Deseja adicionar este sorteio aos favoritos?") == MessageBoxResult.OK) { addFavMs.lerDados(SorteioMSDoJson); FavMSRep.Inserir(addFavMs); } } else { MessageBox.Show("Não foi possível adicionar."); } } else if (pvtSorteios.SelectedIndex == 1) { FavQU addFavQu = new FavQU(); if (SorteioQUDoJson != null) { if (MessageBox.Show("Deseja adicionar este sorteio aos favoritos?") == MessageBoxResult.OK) { addFavQu.lerDados(SorteioQUDoJson); FavQURep.Inserir(addFavQu); } } else { MessageBox.Show("Não foi possível adicionar."); } } else { FavTM addFavTm = new FavTM(); if (SorteioTMDoJson != null) { if (MessageBox.Show("Deseja adicionar este sorteio aos favoritos?") == MessageBoxResult.OK) { addFavTm.lerDados(SorteioTMDoJson); FavTMRep.Inserir(addFavTm); } else { MessageBox.Show("Não foi possível adicionar."); } } } }