Exemple #1
0
        protected List <List <Team> > BuildLeague()
        {
            // pull cities and team names from server and randomly generate league
            SQL_Connect         connect = new SQL_Connect();
            List <List <Team> > league  = connect.BuildLeagues();

            Application.Contents.Add("league", league);
            return(league);
        }
Exemple #2
0
        protected void Confirm_Click(object sender, EventArgs e)
        {
            // create new team with selected items
            SQL_Connect connect  = new SQL_Connect();
            City        UserCity = new City(CityList.SelectedItem.Text.Split(',')[0], CityList.SelectedItem.Text.Split(',')[1], CityList.SelectedItem.Text.Split(',')[2]);
            Team        UserTeam = new Team(UserCity, TeamNameList.SelectedValue);

            Application.Contents.Add("UserTeam", UserTeam);
            Server.Transfer("CareerHome.aspx");
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }
            System.Web.UI.ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.None;

            SQL_Connect connect = new SQL_Connect();

            HomeTeamDDL.DataSource = connect.populateTeamNames();
            HomeTeamDDL.DataBind();
            AwayTeamDDL.DataSource = connect.populateTeamNames();
            AwayTeamDDL.DataBind();
        }
Exemple #4
0
        protected void ConfirmRegister_Click(object sender, EventArgs e)
        {
            ErrorLabel.Visible = false;
            // attempt to register, username must be unique
            SQL_Connect connect = new SQL_Connect();

            ErrorLabel.Text    = connect.Register(UserName.Text, Password.Text, Email.Text);
            ErrorLabel.Visible = true;
            if (ErrorLabel.Text == "Registration successful")
            {
                // reset application.contents before adding new user data
                Application.Contents.Clear();
                Application.Contents.Add("UserName", UserName.Text);
                Server.Transfer("MainMenu.aspx");
            }
        }
Exemple #5
0
        protected void LogInBtn_Click(object sender, EventArgs e)
        {
            ErrorLabel.Visible = false;
            // attempt to login, validated by sql database
            SQL_Connect connect = new SQL_Connect();

            ErrorLabel.Text     = connect.Login(UserName.Text, Password.Text);
            ErrorLabel.Visible  = true;
            RegisterBtn.Visible = true;
            if (ErrorLabel.Text == "Login Successful")
            {
                // reset application.contents before adding this user data
                Application.Contents.Clear();
                Application.Contents.Add("UserName", UserName.Text);
                Server.Transfer("MainMenu.aspx");
            }
        }
Exemple #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }

            //populate drop down lists
            SQL_Connect connect = new SQL_Connect();

            CityList.DataSource     = connect.populateCities();
            CityList.DataTextField  = "StringID";
            CityList.DataValueField = "CityName";
            CityList.DataBind();

            TeamNameList.DataSource = connect.populateTeamNames();
            TeamNameList.DataBind();
        }