protected void Page_Load(object sender, EventArgs e) { //Default values uploadTextBox1.Text = DateTime.Now.ToString().Substring(0, 10); uploadTextBox2.Text = DateTime.Now.ToString().Substring(11, 5); //populating drop down with Exercise types PopulateDropDown exerciseDD = new PopulateDropDown(); exerciseDD.Type = "AllDistinctExercises"; exerciseDD.populate(); uploadDropDownList1.DataSource = exerciseDD.ReturnedList; uploadDropDownList1.DataBind(); //populating dashboard PopulateDashboard1RM RMDash = new PopulateDashboard1RM(); DashboardGridView1.DataSource = RMDash.populate1RMDashboard(); DashboardGridView1.DataBind(); /////////////////// Populate1RmGraph RMDash2 = new Populate1RmGraph(); GridView2.DataSource = RMDash2.populate1RmGraph(); GridView2.DataBind(); }
protected void uploadButton2_Click(object sender, EventArgs e) { DataAccess_MySQL mySQL2 = new DataAccess_MySQL(); mySQL2.Settype = "InsertExercise"; mySQL2.SqlCommand = "INSERT INTO web.Exercise(Date,Time,Exercise,Reps,Weight) VALUES('" + uploadTextBox1.Text + "','" + uploadTextBox2.Text + "','" + uploadTextBox3.Text + "','" + uploadTextBox4.Text + "','" + uploadTextBox5.Text + "')"; mySQL2.connect(); //Repopulate the list with newly inserted item PopulateDropDown exerciseDD = new PopulateDropDown(); exerciseDD.Type = "AllDistinctExercises"; exerciseDD.populate(); uploadDropDownList1.DataSource = exerciseDD.ReturnedList; uploadDropDownList1.DataBind(); }