public string SaveExerciseFileToDatabase(string source) { MySqlConnection conn = new MySqlConnection("Server=82.43.85.43;Database=web;Port=3306;User Id=cosmoto;Password=eArendil16; Connect Timeout=300"); MySqlCommand mycmd = new MySqlCommand(); StreamReader reader = new StreamReader(source); DataAccess_MySQL mySQL = new DataAccess_MySQL(); mySQL.Settype = "InsertExercise"; string lineCurr = ""; string[] item = new string[] { "one" }; string result = ""; int i = 0; while (!reader.EndOfStream) { lineCurr = reader.ReadLine(); item = lineCurr.Split(','); if (i > 0) { mySQL.SqlCommand = "INSERT INTO web.Exercise(Date,Time,Exercise,Reps,Weight) VALUES('" + item[0] + "','" + item[1] + "','" + item[2] + "','" + item[3] + "','" + item[4] + "')"; mySQL.connect(); } i++; } reader.Dispose(); return(i.ToString()); }
public DataTable populate1RMDashboard() { DataAccess_MySQL mySQL = new DataAccess_MySQL(); mySQL.Settype = "1RMDashboard"; mySQL.connect(); return(mySQL.Dt2); }
public DataTable populate1RmGraph() { DataAccess_MySQL mySQL = new DataAccess_MySQL(); mySQL.Settype = "1RMGraph"; mySQL.connect(); return(mySQL.Dt2); }
public void populate() { if (type == "AllDistinctExercises") { DataAccess_MySQL mySQL = new DataAccess_MySQL(); mySQL.Settype = "retrieveAllExerciseTitles"; mySQL.connect(); List <string> allExerciselist = new List <string>(mySQL.DistinctExercises) { }; ReturnedList = allExerciselist; } }
protected void Button_Submit_SignUp_OnClick(object sender, EventArgs e) { Aux aux1 = new Aux(); if (aux1.IsEmpty(TextBox_UserName_SignUp.Text.ToString()) == true || aux1.IsEmpty(TextBox_Password_SignUp.Text.ToString()) == true) { Label_Error_SignUp.Text = aux1.ErrorIsEmpty; } else { DataAccess_MySQL signUp = new DataAccess_MySQL(); signUp.Settype = "signUp"; signUp.setUserName = TextBox_UserName_SignUp.Text.ToString(); signUp.setPassword = TextBox_Password_SignUp.Text.ToString(); signUp.connect(); Response.Redirect("~/Pages/index.aspx"); } }