Пример #1
0
        protected void loginButton1_Click(object sender, EventArgs e)
        {
            DataAccess_MySQL dbconn0 = new DataAccess_MySQL();
            Aux aux1 = new Aux();

            if (loginTextboxPass.Text.ToString().Contains("OR") || loginTextboxUser.Text.ToString().Contains("OR"))
            {
                ErrMsg_1.Text = "Sugi pula cristi";
                return;
            }
            if (aux1.IsEmpty(loginTextboxUser.Text.ToString()) == true || aux1.IsEmpty(loginTextboxPass.Text.ToString()) == true)
            {
                ErrMsg_1.Text = aux1.ErrorIsEmpty;
            }
            else
            {
                dbconn0.setUserName = loginTextboxUser.Text;
                dbconn0.setPassword = loginTextboxPass.Text;
                dbconn0.Settype     = "login";
                dbconn0.connect();

                if (dbconn0.setconnSuccess == true)
                {
                    Response.Redirect("~/Pages/ExerciseUpload.aspx");
                }
                else
                {
                    ErrMsg_1.Text         = "Invalid credentials if you want to create a new account, please click to SignUp button below";
                    signUpButton1.Visible = true;
                }
            }
            return;
        }
Пример #2
0
        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();
        }