protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { using (PortalDataContext pdc = new PortalDataContext()) { var qDivision = (from ed in pdc.EventDivisions orderby ed.Name select new { DivisionID = ed.EventDivisionID, Name = ed.Name }).ToList(); ddlDivision.DataSource = qDivision; ddlDivision.DataValueField = "DivisionID"; ddlDivision.DataTextField = "Name"; ddlDivision.DataBind(); var qCategory = (from ec in pdc.EventCategories orderby ec.Name select new { CategoryID = ec.EventCategoryID, Name = ec.Name }).ToList(); ddlCategory.DataSource = qCategory; ddlCategory.DataValueField = "CategoryID"; ddlCategory.DataTextField = "Name"; ddlCategory.DataBind(); ddlWinner.DataSource = DALPortal.DSLTeamNA(); ddlWinner.DataValueField = "TeamID"; ddlWinner.DataTextField = "TeamName"; ddlWinner.DataBind(); } } }
/////////////////////////////// ///////// Form Events ///////// /////////////////////////////// protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { bool blnHasAccess = clsSystemModule.HasAccess(clsSystemModule.ModuleSynergy, Request.Cookies["Speedo"]["Username"]); hdnGameID.Value = Request.QueryString["gameid"]; ddlStartMonth.DataSource = clsDateTime.GetMonths(); ddlStartMonth.DataValueField = "pvalue"; ddlStartMonth.DataTextField = "ptext"; ddlStartMonth.DataBind(); ddlStartDay.DataSource = clsDateTime.GetDays(); ddlStartDay.DataValueField = "pvalue"; ddlStartDay.DataTextField = "ptext"; ddlStartDay.DataBind(); ddlStartHour.DataSource = clsDateTime.GetHours(); ddlStartHour.DataValueField = "pvalue"; ddlStartHour.DataTextField = "ptext"; ddlStartHour.DataBind(); ddlStartMinute.DataSource = clsDateTime.GetMinutes(); ddlStartMinute.DataValueField = "pvalue"; ddlStartMinute.DataTextField = "ptext"; ddlStartMinute.DataBind(); ddlStartTimePeriod.DataSource = clsDateTime.GetTimePeriod(); ddlStartTimePeriod.DataValueField = "pvalue"; ddlStartTimePeriod.DataTextField = "ptext"; ddlStartTimePeriod.DataBind(); ddlEndMonth.DataSource = clsDateTime.GetMonths(); ddlEndMonth.DataValueField = "pvalue"; ddlEndMonth.DataTextField = "ptext"; ddlEndMonth.DataBind(); ddlEndDay.DataSource = clsDateTime.GetDays(); ddlEndDay.DataValueField = "pvalue"; ddlEndDay.DataTextField = "ptext"; ddlEndDay.DataBind(); ddlEndHour.DataSource = clsDateTime.GetHours(); ddlEndHour.DataValueField = "pvalue"; ddlEndHour.DataTextField = "ptext"; ddlEndHour.DataBind(); ddlEndMinute.DataSource = clsDateTime.GetMinutes(); ddlEndMinute.DataValueField = "pvalue"; ddlEndMinute.DataTextField = "ptext"; ddlEndMinute.DataBind(); ddlEndTimePeriod.DataSource = clsDateTime.GetTimePeriod(); ddlEndTimePeriod.DataValueField = "pvalue"; ddlEndTimePeriod.DataTextField = "ptext"; ddlEndTimePeriod.DataBind(); ddlWinner.DataSource = DALPortal.DSLTeamNA(); ddlWinner.DataValueField = "TeamID"; ddlWinner.DataTextField = "TeamName"; ddlWinner.DataBind(); ddlGamePhase.DataSource = DALPortal.DSLGamePhase(); ddlGamePhase.DataValueField = "pvalue"; ddlGamePhase.DataTextField = "ptext"; ddlGamePhase.DataBind(); using (PortalDataContext pdc = new PortalDataContext()) { EventGame eventGame = (from eg in pdc.EventGames where eg.GameID == hdnGameID.Value.ToInt() select eg).SingleOrDefault(); hdnEventID.Value = eventGame.EventID.ToString(); txtEvent.Text = DALPortal.GetEventName(eventGame.EventID); ddlGamePhase.SelectedValue = eventGame.GamePhase.ToString(); txtStartYear.Text = eventGame.StartDate.Year.ToString(); ddlStartMonth.SelectedValue = eventGame.StartDate.Month.ToString(); ddlStartDay.SelectedValue = eventGame.StartDate.Day.ToString(); ddlStartHour.SelectedValue = eventGame.StartDate.ToString("hh"); ddlStartMinute.SelectedValue = eventGame.StartDate.Minute.ToString(); ddlStartTimePeriod.SelectedValue = eventGame.StartDate.ToString("tt"); txtEndYear.Text = eventGame.EndDate.Year.ToString(); ddlEndMonth.SelectedValue = eventGame.EndDate.Month.ToString(); ddlEndDay.SelectedValue = eventGame.EndDate.Day.ToString(); ddlEndHour.SelectedValue = eventGame.EndDate.ToString("hh"); ddlEndMinute.SelectedValue = eventGame.EndDate.Minute.ToString(); ddlEndTimePeriod.SelectedValue = eventGame.EndDate.ToString("tt"); txtLocation.Text = eventGame.Location; ddlWinner.SelectedValue = eventGame.WinnerTeamID.ToString(); chkFinished.Checked = eventGame.IsFinished; } if (blnHasAccess) { trSaveSchedule.Visible = true; } else { trSaveSchedule.Visible = false; ddlGamePhase.Enabled = false; ddlStartMonth.Enabled = false; ddlStartDay.Enabled = false; txtStartYear.Enabled = false; ddlStartHour.Enabled = false; ddlStartMinute.Enabled = false; ddlStartTimePeriod.Enabled = false; ddlEndMonth.Enabled = false; ddlEndDay.Enabled = false; txtEndYear.Enabled = false; ddlEndHour.Enabled = false; ddlEndMinute.Enabled = false; ddlEndTimePeriod.Enabled = false; txtLocation.ReadOnly = true; txtLocation.BackColor = System.Drawing.Color.AliceBlue; ddlWinner.Enabled = false; chkFinished.Enabled = false; } this.LoadOfficials(); this.LoadCompetingTeams(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { hdnEventID.Value = Request.QueryString["eventid"]; using (PortalDataContext pdc = new PortalDataContext()) { txtEvent.Text = (from ev in pdc.Events where ev.EventID == hdnEventID.Value.ToInt() select ev.Name).SingleOrDefault(); } ddlStartMonth.DataSource = clsDateTime.GetMonths(); ddlStartMonth.DataValueField = "pvalue"; ddlStartMonth.DataTextField = "ptext"; ddlStartMonth.DataBind(); ddlStartDay.DataSource = clsDateTime.GetDays(); ddlStartDay.DataValueField = "pvalue"; ddlStartDay.DataTextField = "ptext"; ddlStartDay.DataBind(); ddlStartHour.DataSource = clsDateTime.GetHours(); ddlStartHour.DataValueField = "pvalue"; ddlStartHour.DataTextField = "ptext"; ddlStartHour.DataBind(); ddlStartMinute.DataSource = clsDateTime.GetMinutes(); ddlStartMinute.DataValueField = "pvalue"; ddlStartMinute.DataTextField = "ptext"; ddlStartMinute.DataBind(); ddlStartTimePeriod.DataSource = clsDateTime.GetTimePeriod(); ddlStartTimePeriod.DataValueField = "pvalue"; ddlStartTimePeriod.DataTextField = "ptext"; ddlStartTimePeriod.DataBind(); ddlEndMonth.DataSource = clsDateTime.GetMonths(); ddlEndMonth.DataValueField = "pvalue"; ddlEndMonth.DataTextField = "ptext"; ddlEndMonth.DataBind(); ddlEndDay.DataSource = clsDateTime.GetDays(); ddlEndDay.DataValueField = "pvalue"; ddlEndDay.DataTextField = "ptext"; ddlEndDay.DataBind(); ddlEndHour.DataSource = clsDateTime.GetHours(); ddlEndHour.DataValueField = "pvalue"; ddlEndHour.DataTextField = "ptext"; ddlEndHour.DataBind(); ddlEndMinute.DataSource = clsDateTime.GetMinutes(); ddlEndMinute.DataValueField = "pvalue"; ddlEndMinute.DataTextField = "ptext"; ddlEndMinute.DataBind(); ddlEndTimePeriod.DataSource = clsDateTime.GetTimePeriod(); ddlEndTimePeriod.DataValueField = "pvalue"; ddlEndTimePeriod.DataTextField = "ptext"; ddlEndTimePeriod.DataBind(); ddlGamePhase.DataSource = DALPortal.DSLGamePhase(); ddlGamePhase.DataValueField = "pvalue"; ddlGamePhase.DataTextField = "ptext"; ddlGamePhase.DataBind(); ddlStartMonth.SelectedValue = DateTime.Now.Month.ToString(); ddlStartDay.SelectedValue = DateTime.Now.Day.ToString(); txtStartYear.Text = DateTime.Now.Year.ToString(); ddlEndMonth.SelectedValue = DateTime.Now.Month.ToString(); ddlEndDay.SelectedValue = DateTime.Now.Day.ToString(); txtEndYear.Text = DateTime.Now.Year.ToString(); ddlWinner.DataSource = DALPortal.DSLTeamNA(); ddlWinner.DataValueField = "TeamID"; ddlWinner.DataTextField = "TeamName"; ddlWinner.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { clsSpeedo.Authenticate(); if (!Page.IsPostBack) { bool blnHasAccess = clsSystemModule.HasAccess(clsSystemModule.ModuleSynergy, Request.Cookies["Speedo"]["Username"]); btnSave.Visible = blnHasAccess; btnNewSchedule.Visible = blnHasAccess; btnSaveEventTeamScore.Visible = blnHasAccess; hdnEventID.Value = Request.QueryString["eventid"]; using (PortalDataContext pdc = new PortalDataContext()) { var qDivision = (from ed in pdc.EventDivisions orderby ed.Name select new { DivisionID = ed.EventDivisionID, Name = ed.Name }).ToList(); ddlDivision.DataSource = qDivision; ddlDivision.DataValueField = "DivisionID"; ddlDivision.DataTextField = "Name"; ddlDivision.DataBind(); var qCategory = (from ec in pdc.EventCategories orderby ec.Name select new { CategoryID = ec.EventCategoryID, Name = ec.Name }).ToList(); ddlCategory.DataSource = qCategory; ddlCategory.DataValueField = "CategoryID"; ddlCategory.DataTextField = "Name"; ddlCategory.DataBind(); ddlWinner.DataSource = DALPortal.DSLTeamNA(hdnEventID.Value.ToInt()); ddlWinner.DataValueField = "TeamID"; ddlWinner.DataTextField = "TeamName"; ddlWinner.DataBind(); //Event eventSynergy = new Event(); //eventSynergy = (from ev in pdc.Events // where ev.EventID == hdnEventID.Value.ToInt() // select ev).SingleOrDefault(); //lnkEventDetails.Text = eventSynergy.Name; //lnkEventDetails.NavigateUrl = "EventDetails.aspx?eventid=" + hdnEventID.Value.ToInt(); //txtEventName.Text = eventSynergy.Name; //txtMaxPoints.Text = eventSynergy.MaxPoint.ToString(); //txtOrder.Text = eventSynergy.SortOrder.ToString(); //ddlDivision.SelectedValue = eventSynergy.EventDivisionID.ToString(); //ddlCategory.SelectedValue = eventSynergy.EventCategoryID.ToString(); //ddlWinner.SelectedValue = eventSynergy.WinnerTeamID.ToString(); //txtCreateBy.Text = eventSynergy.CreatedBy; //txtCreateOn.Text = eventSynergy.DateCreated.Value.ToString("MMM dd, yyyy hh:mm tt"); //txtModifyBy.Text = eventSynergy.ModifiedBy.ToSafeString(); //txtModifyOn.Text = (eventSynergy.DateModified == null ? "" : eventSynergy.DateModified.Value.ToString("MMM dd, yyyy hh:mm tt")); } this.LoadEventDetails(); if (!blnHasAccess) { txtEventName.ReadOnly = true; txtEventName.BackColor = System.Drawing.Color.AliceBlue; ddlCategory.Enabled = false; ddlDivision.Enabled = false; txtMaxPoints.ReadOnly = true; txtMaxPoints.BackColor = System.Drawing.Color.AliceBlue; ddlWinner.Enabled = false; txtOrder.ReadOnly = true; txtOrder.BackColor = System.Drawing.Color.AliceBlue; } //this.CheckInsertEventTeamScore(); this.LoadEventScheduleList(); this.LoadEventTeamScore(); chkActive.Checked = IsActive(Request.QueryString["eventid"].ToInt()); } }