private void DoConsolidation()
        {
            try
            {
                var    selectedIndex = ConsolidateSelectedIndex.Value;
                string selectedKey;
                string unselectedKey;
                switch (selectedIndex)
                {
                case "1":
                    selectedKey   = ConsolidateKey1.Value;
                    unselectedKey = ConsolidateKey2.Value;
                    break;

                case "2":
                    selectedKey   = ConsolidateKey2.Value;
                    unselectedKey = ConsolidateKey1.Value;
                    break;

                default:
                    throw new VoteException("Index not 1 or 2");
                }

                //throw new VoteException("An error");

                // Politicians
                var selectedPolitician   = Politicians.GetData(selectedKey);
                var unselectedPolitician = Politicians.GetData(unselectedKey);
                if (selectedPolitician.Count != 1)
                {
                    throw new VoteException("Politician " + selectedPolitician + " not found");
                }
                if (unselectedPolitician.Count != 1)
                {
                    throw new VoteException("Politician " + unselectedKey + " not found");
                }
                var selectedData = UpdatePoliticians(selectedIndex, selectedPolitician, unselectedPolitician);

                // PoliticiansImagesData and PoliticiansImagesBlobs
                var selectedImagesData    = PoliticiansImagesData.GetData(selectedKey);
                var unselectedImagesData  = PoliticiansImagesData.GetData(unselectedKey);
                var selectedImagesBlobs   = PoliticiansImagesBlobs.GetData(selectedKey);
                var unselectedImagesBlobs = PoliticiansImagesBlobs.GetData(unselectedKey);
                UpdateImages(selectedIndex, selectedData, selectedKey, selectedImagesData,
                             selectedImagesBlobs, unselectedImagesData, unselectedImagesBlobs);

                // Answers
                var selectedAnswers   = Answers.GetActiveDataByPoliticianKey(selectedKey);
                var unselectedAnswers = Answers.GetDataByPoliticianKey(unselectedKey);
                UpdateAnswers(selectedKey, selectedAnswers, unselectedAnswers);

                // ElectionsIncumbentsRemoved
                var selectedIncumbentsRemoved =
                    ElectionsIncumbentsRemoved.GetDataByPoliticianKey(selectedKey);
                var unselectedIncumbentsRemoved =
                    ElectionsIncumbentsRemoved.GetDataByPoliticianKey(unselectedKey);
                UpdateIncumbentsRemoved(selectedKey, unselectedIncumbentsRemoved, selectedIncumbentsRemoved);

                // ElectionsPoliticians
                var selectedElectionsPoliticians   = ElectionsPoliticians.GetDataByPoliticianKey(selectedKey);
                var unselectedElectionsPoliticians =
                    ElectionsPoliticians.GetDataByPoliticianKey(unselectedKey);
                UpdateElectionsPoliticians(selectedKey, unselectedElectionsPoliticians,
                                           selectedElectionsPoliticians);

                // OfficesOfficials
                var selectedOfficesOfficials   = OfficesOfficials.GetDataByPoliticianKey(selectedKey);
                var unselectedOfficesOfficials = OfficesOfficials.GetDataByPoliticianKey(unselectedKey);
                UpdateOfficesOfficials(selectedKey, unselectedOfficesOfficials, selectedOfficesOfficials);

                // Update everything as one transaction, politicians last
                PoliticiansImagesData.UpdateTable(selectedImagesData);
                PoliticiansImagesData.UpdateTable(unselectedImagesData);
                PoliticiansImagesBlobs.UpdateTable(selectedImagesBlobs);
                PoliticiansImagesBlobs.UpdateTable(unselectedImagesBlobs);
                Answers.UpdateTable(selectedAnswers);
                Answers.UpdateTable(unselectedAnswers);
                ElectionsIncumbentsRemoved.UpdateTable(unselectedIncumbentsRemoved);
                ElectionsPoliticians.UpdateTable(unselectedElectionsPoliticians);
                OfficesOfficials.UpdateTable(unselectedOfficesOfficials);
                Politicians.UpdateTable(selectedPolitician);
                Politicians.UpdateTable(unselectedPolitician);

                // Log
                LogDataChange.LogUpdate("*ConsolidatePoliticians", "*Various", unselectedKey, selectedKey,
                                        VotePage.UserName, SecurePage.UserSecurityClass, DateTime.UtcNow, selectedKey);

                // After the main update, refresh the LiveOfficeKey, LiveOfficeStatus and LiveElectionKey
                var view = PoliticiansLiveOfficeKeyView.GetData(selectedKey);
                if (view.Count == 1)
                {
                    var keyAndStatus =
                        PoliticianOfficeStatus.FromLiveOfficeKeyAndStatus(
                            view[0].LiveOfficeKeyAndStatus);
                    selectedPolitician[0].LiveOfficeKey    = keyAndStatus.OfficeKey;
                    selectedPolitician[0].LiveOfficeStatus = keyAndStatus.PoliticianStatus.ToString();
                    selectedPolitician[0].LiveElectionKey  = keyAndStatus.ElectionKey;
                    Politicians.UpdateTable(selectedPolitician);
                }
                ConsolidateReloaded.Value = "ok";
            }
            catch (Exception ex)
            {
                FeedbackConsolidate.AddError("There was an unexpected error: " + ex.Message);
            }
        }