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; }
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"); } }