Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.IsAuthenticated)
            {
                int opponentId = Convert.ToInt32(Request.QueryString["opponentId"]);
                RadDatePicker1.MinDate = DateTime.Now.AddDays(1);

                if (!IsPostBack)
                {
                    if (!StoredData.User.TempDivision.Value || !StoredData.User.AccessExpired.Value)
                    {
                        using (FlexibleTennisLeagueDataContext dataContext = new FlexibleTennisLeagueDataContext())
                        {
                            ISingleResult <SelectUserPublicProfileResult> users = dataContext.SelectUserPublicProfile(opponentId);
                            SelectUserPublicProfileResult user = users.First();
                            opponentLabel.Text = user.FirstName + " " + user.LastName;

                            List <TennisCourt> tennisCourts = dataContext.SelectTennisCourtsByEmailId(StoredData.User.EmailId).ToList();
                            locationDropDownList.DataSource     = tennisCourts;
                            locationDropDownList.DataTextField  = "CourtName";
                            locationDropDownList.DataValueField = "CourtId";
                            locationDropDownList.DataBind();

                            locationDropDownList.SelectedValue = StoredData.User.HomeCourt.ToString();
                            ViewState["UserCourtName"]         = locationDropDownList.SelectedItem.Text;
                        }
                    }
                }
            }
        }