コード例 #1
0
        public bool GetProposalsFromManager()
        {
            using (var cli = new PersistServiceClient())
            {
                cli.Open();
                bool saveOk;
                proposalsList = cli.LoadProposals();

                cli.Close();
            }

            return(true);
        }
コード例 #2
0
        public bool GetPoliticiansFromManager()
        {
            using (var cli = new PersistServiceClient())
            {
                cli.Open();
                bool saveOk;
                politiciansList = cli.LoadPoliticians();

                cli.Close();
            }

            return(true);
        }
コード例 #3
0
        public bool PersistData()
        {
            using (var cli = new PersistServiceClient())
            {
                cli.Open();
                bool saveOk;
                saveOk = cli.SaveElectors(electorsQueue);
                saveOk = cli.SaveElectorProposals(electorProposalsQueue);

                cli.Close();
            }

            return(true);
        }
コード例 #4
0
        public bool VerifyAndPersist(string userName, string password)
        {
            using (var cli = new PersistServiceClient())
            {
                cli.Open();
                bool saveOk;
                try
                {
                    saveOk = cli.SaveProposals(proposalsQueue, userName, password);
                    saveOk = cli.SavePoliticians(politiciansQueue, userName, password);
                    saveOk = cli.SavePoliticianProposals(politicianProposalsQueue, userName, password);
                }
                catch (FaultException <AutenticationException> ex)
                {
                    cli.Close();
                    return(false);
                }

                cli.Close();
                return(true);
            }
        }