Exemplo n.º 1
0
        //If login is valid go to either voting or main station screen
        protected void OnLoginButtonClicked(object sender, EventArgs e)
        {
            userType = userSelectionCombo.ActiveText;

            //First check the login details is correct
            if (loginIsValid(userEntry.Text, passwordEntry.Text, userType))
            {
                db.login(userEntry.Text, userType);

                if (userType.Equals(VOTER))
                {
                    //Voter voter = new Voter (userEntry.Text, passwordEntry.Text);
                    //db.login (voter.getName());


                    VotingMultiChain.VotingWindow win = new VotingMultiChain.VotingWindow(client, sshClient, db);
                    win.Show();
                    this.Destroy();
                }
                else if (userType.Equals(ADMIN))
                {
                    //Administrator admin = new Administrator(userEntry.Text, passwordEntry.Text);
                    //db.login (admin.getName ());

                    VotingMultiChain.MainStationWindow win = new VotingMultiChain.MainStationWindow(client, sshClient, db);
                    win.Show();
                    this.Destroy();
                }
            }
        }
Exemplo n.º 2
0
        //If login is valid go to either voting or main station screen
        protected void OnLoginButtonClicked(object sender, EventArgs e)
        {
            if (loginIsValid(userEntry.Text, passwordEntry.Text))
            {
                string userType = "voter";
                //string userType = "admin";

                if (userType.Equals("voter"))
                {
                    VotingMultiChain.VotingWindow win = new VotingMultiChain.VotingWindow(client);
                    win.Show();
                    this.Destroy();
                }
                else if (userType.Equals("admin"))
                {
                    VotingMultiChain.MainStationWindow win = new VotingMultiChain.MainStationWindow(client);
                    win.Show();
                    this.Destroy();
                }
            }
        }