Esempio n. 1
0
        protected void UnAssignButton_Click(object sender, EventArgs e)
        {
            if (Session["SelectedPlayer"] != null)
            {
                SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["FantasyFootballConnectionString"].ConnectionString);
                try
                {
                    myConnection.Open();

                    SqlCommand myCommand = new SqlCommand("UPDATE [assignments] SET [rosterId] = 0, [round] = 0, [pick] = 0 WHERE ([playerId] = " +
                                                          Session["SelectedPlayer"] + ")", myConnection);

                    myCommand.ExecuteNonQuery();

                    myConnection.Close();
                }
                catch (Exception ex)
                {
                }
                finally
                {
                    QBsListBox.ClearSelection();
                    RBsListBox.ClearSelection();
                    WRsListBox.ClearSelection();
                    TEsListBox.ClearSelection();
                    DSTsListBox.ClearSelection();
                    KsListBox.ClearSelection();
                    RosterListBox.ClearSelection();
                    Session.Add("SelectedPlayer", "0");
                    updatePicks();
                }
            }
        }
Esempio n. 2
0
 protected void DSTsListBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     Session.Add("SelectedPlayer", DSTsListBox.SelectedValue);
     QBsListBox.ClearSelection();
     RBsListBox.ClearSelection();
     WRsListBox.ClearSelection();
     TEsListBox.ClearSelection();
     KsListBox.ClearSelection();
     initializePick();
     updatePicks();
 }