Exemplo n.º 1
0
        protected void grdGames_ItemCommand(object sender, EO.Web.GridCommandEventArgs e)
        {
            //If lnkSwitch.Text = "Schedules" Then
            //    'turn off selection on grid
            //    'grdGames.DisplayLayout.ActiveRow.Activated = False
            //    Exit Sub

            //End If
            ////JavaScript call
            //if (e.CommandName == "select")
            //{
            //string s = string.Empty;
            //s += "Row Index:" + e.Item.Index.ToString();
            //s += "<br />1:" + e.Item.Cells[1].Value.ToString();
            //s += "<br />2:" + e.Item.Cells[2].Value.ToString();
            //s += "<br />3:" + e.Item.Cells[3].Value.ToString();
            //LabelDebugInfo.Text = s;

            if (e.CommandName != "select")
                return;

            Session["GameNumber"] = e.Item.Cells(0).Value.ToString();
            Session["GameType"] = e.Item.Cells(1).Value.ToString();
            Session["HomeTeam"] = e.Item.Cells(6).Value.ToString();
            Session["VisitingTeam"] = e.Item.Cells(7).Value.ToString();

            if (KeepStats())
            {
                //transfer to stats
                Response.Redirect("GamesStats.aspx");
                return;
            }

            if (Session["ScheduleNoAD"] != e.Item.Cells(2).Value.ToString())
            {
                Session["ScheduleNoAD"] = e.Item.Cells(2).Value.ToString();
                ValidateAccess();
                if (lblError.Text > "")
                    return;
            }
            Session["ScheduleNoAD"] = e.Item.Cells(2).Value.ToString();

            Season.clsGames oGames = new Season.clsGames();
            try
            {
                oGames.GetGames(Session["ScheduleNoAD"], Session["GameNumber"], Session["GameType"]);
                //I NEED TO EVALUATE FOR NOTHING COMING BACK
                lblDate.Text = oGames.GameDate + " " + oGames.GameTime;
                lblLocation.Text = oGames.Location;
                lblHome.Text = oGames.Home;
                lblVisitor.Text = oGames.Visitor;
                if (!Information.IsDBNull(oGames.HomeTeamScore))
                {
                    txtHScores.Text = oGames.HomeTeamScore;
                }
                else
                {
                    txtHScores.Text = "";
                }
                if (!Information.IsDBNull(oGames.VisitingTeamScore))
                {
                    txtVScores.Text = oGames.VisitingTeamScore;
                }
                else
                {
                    txtVScores.Text = "";
                }
            }
            catch (Exception ex)
            {
                lblError.Text = "grdGames:" + ex.Message;
                return;
            }
            finally
            {
                oGames = null;
            }
            lblError.Text = "";
            //imgStandings.Visible = False
            if (string.IsNullOrEmpty(Session["USERNAME"]) & string.IsNullOrEmpty(Session["Admin"]))
            {
                lblUsername.Visible = true;
                txtUser.Visible = true;
                lblPassword.Visible = true;
                txtPwd.Visible = true;
                btnSubmit.Visible = true;
                lnkForgot.Visible = true;
                //imgStandings.Visible = False

                lblDate.Visible = false;
                lblLocation.Visible = false;
                lblVisitor.Visible = false;
                lblHome.Visible = false;
                txtVScores.Visible = false;
                txtHScores.Visible = false;
                btnUpdate.Visible = false;

            }
            else
            {
                lblUsername.Visible = false;
                txtUser.Visible = false;
                lblPassword.Visible = false;
                txtPwd.Visible = false;
                btnSubmit.Visible = false;
                lnkForgot.Visible = false;
                lblDate.Visible = true;
                lblLocation.Visible = true;
                lblVisitor.Visible = true;
                lblHome.Visible = true;
                txtVScores.Visible = true;
                txtHScores.Visible = true;
                btnUpdate.Visible = true;
                //Call CheckForStats()

            }
            //End Sub
            //    If e.CommandName = "Select" Then

            //        lblError.Text = "Bingo"
            //    End If
        }
Exemplo n.º 2
0
 private void LoadStandings(string sDesc, int iDiv)
 {
     Season.clsGames oGames = new Season.clsGames();
     DataTable rsData = default(DataTable);
     try
     {
         rsData = oGames.GetStanding(Session["CompanyID"], iDiv);
         //CreateXML(rsData)
         var _with4 = grdStanding;
         _with4.DataSource = rsData;
         _with4.DataBind();
         //With .DisplayLayout.Bands(0).Columns
         //    .FromKey("TeamNo").Hidden = True
         //    .FromKey("ScheduleName").Hidden = True
         //    .FromKey("DivNo").Hidden = True
         //    .FromKey("TeamName").Hidden = True
         //    .FromKey("TieBreaker").Hidden = True
         //    .FromKey("Team").Width = 130
         //    .FromKey("Team").Header.Fixed = True
         //    .FromKey("Won").CellStyle.HorizontalAlign = HorizontalAlign.Center
         //    .FromKey("won").Width = 40
         //    .FromKey("won").Header.Fixed = True
         //    .FromKey("Lost").CellStyle.HorizontalAlign = HorizontalAlign.Center
         //    .FromKey("Lost").Width = 40
         //    .FromKey("Lost").Header.Fixed = True
         //    .FromKey("PCT").CellStyle.HorizontalAlign = HorizontalAlign.Center
         //    .FromKey("PCT").Width = 60
         //    .FromKey("PCT").Header.Fixed = True
         //    .FromKey("Streak").CellStyle.HorizontalAlign = HorizontalAlign.Center
         //    .FromKey("Streak").Width = 60
         //    .FromKey("Streak").Header.Fixed = True
         //    .FromKey("PF").CellStyle.HorizontalAlign = HorizontalAlign.Center
         //    .FromKey("PF").Width = 60
         //    .FromKey("PF").Header.Fixed = True
         //    .FromKey("PA").CellStyle.HorizontalAlign = HorizontalAlign.Center
         //    .FromKey("PA").Width = 60
         //    .FromKey("PA").Header.Fixed = True
         //    .FromKey("GB").CellStyle.HorizontalAlign = HorizontalAlign.Center
         //    .FromKey("GB").Header.Fixed = True
         //    .FromKey("GB").Width = 100
         //End With
         if (iDiv > 0)
         {
             lblTitle.Text = sDesc + " Standing";
         }
         else
         {
             lblTitle.Text = "Standing";
         }
         Session["ReportName"] = "Standings";
         Session["ScheduleDesc"] = sDesc;
         Session["ScheduleNo"] = iDiv;
         lblError.Text = " ";
     }
     catch (Exception ex)
     {
         lblError.Text = "LoadStandings:" + ex.Message;
     }
     finally
     {
         oGames = null;
     }
     //grdStanding.Columns(7).Header.Title = "PF=>All games points scored (by team), PA=All Games point scored (by opponents), GB=Games Behind the division leader"
 }
Exemplo n.º 3
0
 private void UpdateScores()
 {
     Season.clsGames oGames = new Season.clsGames();
     try
     {
         if (Information.IsNumeric(txtHScores.Text) & Information.IsNumeric(txtVScores.Text))
         {
             oGames.UpdateGameScores(Session["ScheduleNo"], Session["GameNumber"], Session["GameType"], txtHScores.Text, txtVScores.Text);
         }
         else
         {
             oGames.UpdateGameScores(Session["ScheduleNo"], Session["GameNumber"], Session["GameType"]);
         }
     }
     catch (Exception ex)
     {
         lblError.Text = "UpdateScores:" + ex.Message;
     }
     finally
     {
         oGames = null;
     }
 }