Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     using (HoopsUDBEntities entities = new HoopsUDBEntities())
     {
         string result = entities.sprGetFavoritesByUsername("thowar9").ToString();
         txtFavoriteCourts.Text = result;
     }
 }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     using (HoopsUDBEntities entities = new HoopsUDBEntities())
     {   //SPROC BELOW
         grdCourts.DataSource = entities.sprGetAllCourts();
         grdCourts.DataBind();
     }
 }
Exemplo n.º 3
0
        protected void Submit_Click(object sender, EventArgs e)
        {
            bool Gender = true;

            if (RadioButtonListGender.SelectedValue == "Female")
            {
                Gender = false;
            }

            using (HoopsUDBEntities entities = new HoopsUDBEntities())
            {   //SPROC used to add user data to database
                entities.sprAddUser(txtUsername.Text, txtPassword.Text, txtFirstName.Text, txtLastName.Text, Gender, txtStAddress.Text, txtEmailAddress.Text);
            }

            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Account created!')", true);
        }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["Zone"] == null)
     {
         CourtsNearMe.Visible = false;
     }
     else
     {
         SelectZone.Visible        = false; //QUERY STRING
         CourtsNearMe.GroupingText = (CourtsNearMe.GroupingText + Request.QueryString["Zone"]);
         using (HoopsUDBEntities entities = new HoopsUDBEntities())
         {   //SPROC BELOW
             grdCourts.DataSource = entities.sprGetCourtsByZone(Request.QueryString["Zone"]);
             grdCourts.DataBind();
         }
     }
 }
Exemplo n.º 5
0
        protected void butLogin_Click(object sender, EventArgs e)
        {
            LoginBox.Visible = false;
            userInfo.Visible = true;
            userInfo.Enabled = false;

            using (HoopsUDBEntities entities = new HoopsUDBEntities())
            {
                var user = from s in entities.tblUsers
                           where s.fldUsername == txtUsername.Text && s.fldUserPassword == txtPassword.Text
                           select s;
                if (user != null)
                {
                    detailsViewUserInfo.DataSource = user.ToList();
                    detailsViewUserInfo.DataBind();
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Login unsuccessful.')", true);
                }
            }
        }