Exemple #1
0
        private void validateCredentials()
        {
            loggingOutLabel.SendToBack();
            loggingOutLabel.Visible = false;
            AddTournamentLevel vmc = new AddTournamentLevel();

            vmc.StartPosition = FormStartPosition.CenterParent;
            if (vmc.ShowDialog(this) == DialogResult.Cancel)
            {
                toolStripUsername.Text       = "Not Logged in";
                toolStripLoginButton.Enabled = true;
                loggedIn = false;
            }
            else
            {
                mm = vmc.mm;
                up = new UploadProgress(mm);
                toolStripUsername.Text       = "Logged in as : " + mm.UserName;
                toolStripLoginButton.Enabled = true;
                loggedIn = true;
                loadTournamentLevels();
                loadTournaments();
                loadEvents();
            }
        }
Exemple #2
0
        public AddNewEvent(ManageMasterpoints mm, DataGridView em)
        {
            m_mm = mm;
            InitializeComponent();
            em.Sort(em.Columns["event_code"], ListSortDirection.Descending);
            int    tCodeIndex = em.Columns["event_code"].Index;
            string lastCode   = (string)em.Rows[2].Cells[tCodeIndex].Value;
            string nextCode   = Utilities.getNextCode(lastCode);

            foreach (DataGridViewRow row in em.Rows)
            {
                if ((string)row.Cells[tCodeIndex].Value == nextCode)
                {
                    return;
                }
                eventCodeTextbox.Text = nextCode;
            }
        }
Exemple #3
0
        private void okButton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(usernameTextbox.Text))
            {
                MessageBox.Show("Username cannot be empty string!");
                return;
            }
            if (string.IsNullOrWhiteSpace(passwordTextbox.Text))
            {
                MessageBox.Show("Password cannot be empty string!");
                return;
            }
            loginPanel.Enabled     = false;
            loadingPicture.Enabled = true;
            loadingPicture.Visible = true;
            loadingPicture.BringToFront();
            this.Refresh();
            mm = new ManageMasterpoints(m_site, usernameTextbox.Text, passwordTextbox.Text);
            string json_result = mm.validateCredentials();
            Dictionary <string, string> result = Utilities.convertJsonOutput(json_result);
            bool errorStatus = Convert.ToBoolean(result["error"]);

            loadingPicture.Visible = false;
            loginPanel.Enabled     = true;
            if (!errorStatus)
            {
                mm.m_session_id   = result["content"];
                this.DialogResult = DialogResult.OK;
                this.Close();
                if (m_site.Contains(m_productionSite))
                {
                    MessageBox.Show(
                        "Please note that you are logged in to the production site. Your changes will impact content on the official public BFI web site!",
                        "Production Web site warning!!!", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
                }
            }
            else
            {
                MessageBox.Show("Unable to validate username and password because : " + Environment.NewLine + result["message"]);
                return;
            }
        }
Exemple #4
0
        public AddNewTournament(ManageMasterpoints mm, DataGridView tlm, DataGridView tm, string tournament_level_code)
        {
            m_mm = mm;
            InitializeComponent();
            int colIndex  = tlm.Columns["tournament_level_code"].Index;
            int descIndex = tlm.Columns["description"].Index;

            tournamentLevelCodes = new string[tlm.Rows.Count];
            int count = 0;

            foreach (DataGridViewRow row in tlm.Rows)
            {
                tournamentLevelCodes[count++] = (string)(row.Cells[colIndex].Value);
                tournamentLevelCombobox.Items.Add((string)(row.Cells[descIndex].Value));
            }
            if (tournament_level_code == null)
            {
                tournamentLevelCombobox.SelectedIndex = 0;
            }
            else
            {
                tournamentLevelCombobox.Text = tournament_level_code;
            }
            tm.Sort(tm.Columns["tournament_code"], ListSortDirection.Descending);
            int    tCodeIndex = tm.Columns["tournament_code"].Index;
            string lastCode   = (string)tm.Rows[0].Cells[tCodeIndex].Value;
            string nextCode   = Utilities.getNextCode(lastCode);

            foreach (DataGridViewRow row in tm.Rows)
            {
                if ((string)row.Cells[tCodeIndex].Value == nextCode)
                {
                    return;
                }
                tournamentCodeTextbox.Text = nextCode;
            }
        }
 public AddNewTournamentLevel(ManageMasterpoints mm)
 {
     m_mm = mm;
     InitializeComponent();
 }
 public UploadProgress(ManageMasterpoints mm)
 {
     m_mm = mm;
     InitializeComponent();
 }