Exemple #1
0
        // TODO: Insert code to perform custom authentication using the provided username and password
        // (See http://go.microsoft.com/fwlink/?LinkId=35339).
        // The custom principal can then be attached to the current thread's principal as follows:
        //     My.User.CurrentPrincipal = CustomPrincipal
        // where CustomPrincipal is the IPrincipal implementation used to perform authentication.
        // Subsequently, My.User will return identity information encapsulated in the CustomPrincipal object
        // such as the username, display name, etc.


        private void loginButton_Click(System.Object sender, System.EventArgs e)
        {
            FixtureBuilder fb = new FixtureBuilder();

            Dictionary <string, int> userDictionary = new Dictionary <string, int>();

            userDictionary = fb.getUsersAndIds();

            string username = usernameTextBox.Text.ToLower();

            userId = -1;

            if (string.IsNullOrEmpty(username))
            {
                Interaction.MsgBox("Please enter your username");
            }
            else
            {
                if (userDictionary.ContainsKey(username))
                {
                    userDictionary.TryGetValue(username, out userId);
                    My.MyProject.Forms.FixturesForm.currentUser = userId;
                    My.MyProject.Forms.MenuForm.Show();
                    this.Close();
                }
                else
                {
                    Interaction.MsgBox("Username not recognised");
                    usernameTextBox.Clear();
                }
            }
        }
Exemple #2
0
        // TODO: Insert code to perform custom authentication using the provided username and password
        // (See http://go.microsoft.com/fwlink/?LinkId=35339).
        // The custom principal can then be attached to the current thread's principal as follows:
        //     My.User.CurrentPrincipal = CustomPrincipal
        // where CustomPrincipal is the IPrincipal implementation used to perform authentication.
        // Subsequently, My.User will return identity information encapsulated in the CustomPrincipal object
        // such as the username, display name, etc.
        private void loginButton_Click(System.Object sender, System.EventArgs e)
        {
            FixtureBuilder fb = new FixtureBuilder();

            Dictionary<string, int> userDictionary = new Dictionary<string, int>();
            userDictionary = fb.getUsersAndIds();

            string username = usernameTextBox.Text.ToLower();
            userId = -1;

            if (string.IsNullOrEmpty(username)) {
                Interaction.MsgBox("Please enter your username");

            } else {
                if (userDictionary.ContainsKey(username)) {
                    userDictionary.TryGetValue(username, out userId);
                    My.MyProject.Forms.FixturesForm.currentUser = userId;
                    My.MyProject.Forms.MenuForm.Show();
                    this.Close();
                } else {
                    Interaction.MsgBox("Username not recognised");
                    usernameTextBox.Clear();
                }

            }
        }
        // TODO: Insert code to perform custom authentication using the provided username and password
        // (See http://go.microsoft.com/fwlink/?LinkId=35339).
        // The custom principal can then be attached to the current thread's principal as follows:
        //     My.User.CurrentPrincipal = CustomPrincipal
        // where CustomPrincipal is the IPrincipal implementation used to perform authentication.
        // Subsequently, My.User will return identity information encapsulated in the CustomPrincipal object
        // such as the username, display name, etc.


        private void loginButton_Click(System.Object sender, System.EventArgs e)
        {
            FixtureBuilder fb = new FixtureBuilder();

            Dictionary <string, int> userDictionary = new Dictionary <string, int>();

            userDictionary = fb.getUsersAndIds();

            string username = usernameTextBox.Text.ToLower();

            userId = -1;

            if (string.IsNullOrEmpty(username))
            {
                Interaction.MsgBox("Please enter your username");
            }
            else
            {
                if (userDictionary.ContainsKey(username))
                {
                    userDictionary.TryGetValue(username, out userId);
                    My.MyProject.Forms.ContainerForm.currentUser = userId;
                    My.MyProject.Forms.ContainerForm.enterPredictionsButton.Text = "Enter Predictions";
                    My.MyProject.Forms.ContainerForm.betSlipButton.Text          = "Bet Slip";
                    My.MyProject.Forms.ContainerForm.whoBetButton.Text           = "Who's Bet";
                    My.MyProject.Forms.ContainerForm.predictionLeagueButton.Text = "Prediction League";
                    My.MyProject.Forms.ContainerForm.myAccountButton.Text        = "My Account";
                    My.MyProject.Forms.ContainerForm.logOutButton.Text           = "Log Off";

                    My.MyProject.Forms.ContainerForm.logOutButton.Visible           = true;
                    My.MyProject.Forms.ContainerForm.enterPredictionsButton.Enabled = true;
                    My.MyProject.Forms.ContainerForm.betSlipButton.Enabled          = true;
                    My.MyProject.Forms.ContainerForm.whoBetButton.Enabled           = true;
                    My.MyProject.Forms.ContainerForm.predictionLeagueButton.Enabled = true;
                    My.MyProject.Forms.ContainerForm.myAccountButton.Enabled        = true;
                    My.MyProject.Forms.ContainerForm.logOutButton.Enabled           = true;
                    My.MyProject.Forms.ContainerForm.coverTitleLabel.Visible        = true;
                    this.Visible = false;
                }
                else
                {
                    Interaction.MsgBox("Username not recognised");
                    usernameTextBox.Clear();
                }
            }
        }
        // TODO: Insert code to perform custom authentication using the provided username and password
        // (See http://go.microsoft.com/fwlink/?LinkId=35339).
        // The custom principal can then be attached to the current thread's principal as follows:
        //     My.User.CurrentPrincipal = CustomPrincipal
        // where CustomPrincipal is the IPrincipal implementation used to perform authentication.
        // Subsequently, My.User will return identity information encapsulated in the CustomPrincipal object
        // such as the username, display name, etc.
        private void loginButton_Click(System.Object sender, System.EventArgs e)
        {
            FixtureBuilder fb = new FixtureBuilder();

            Dictionary<string, int> userDictionary = new Dictionary<string, int>();
            userDictionary = fb.getUsersAndIds();

            string username = usernameTextBox.Text.ToLower();
            userId = -1;

            if (string.IsNullOrEmpty(username)) {
                Interaction.MsgBox("Please enter your username");

            } else {
                if (userDictionary.ContainsKey(username)) {
                    userDictionary.TryGetValue(username, out userId);
                    My.MyProject.Forms.ContainerForm.currentUser = userId;
                    My.MyProject.Forms.ContainerForm.enterPredictionsButton.Text = "Enter Predictions";
                    My.MyProject.Forms.ContainerForm.betSlipButton.Text = "Bet Slip";
                    My.MyProject.Forms.ContainerForm.whoBetButton.Text = "Who's Bet";
                    My.MyProject.Forms.ContainerForm.predictionLeagueButton.Text = "Prediction League";
                    My.MyProject.Forms.ContainerForm.myAccountButton.Text = "My Account";
                    My.MyProject.Forms.ContainerForm.logOutButton.Text = "Log Off";

                    My.MyProject.Forms.ContainerForm.logOutButton.Visible = true;
                    My.MyProject.Forms.ContainerForm.enterPredictionsButton.Enabled = true;
                    My.MyProject.Forms.ContainerForm.betSlipButton.Enabled = true;
                    My.MyProject.Forms.ContainerForm.whoBetButton.Enabled = true;
                    My.MyProject.Forms.ContainerForm.predictionLeagueButton.Enabled = true;
                    My.MyProject.Forms.ContainerForm.myAccountButton.Enabled = true;
                    My.MyProject.Forms.ContainerForm.logOutButton.Enabled = true;
                    My.MyProject.Forms.ContainerForm.coverTitleLabel.Visible = true;
                    this.Visible = false;

                } else {
                    Interaction.MsgBox("Username not recognised");
                    usernameTextBox.Clear();
                }

            }
        }