Merge remote-tracking branch 'origin/master'

# Conflicts:
#	app/src/main/res/layout/activity_main.xml
ongbodev
哈哈哈哈哈士奇 6 years ago
parent ae9cfb9df9
commit 7844fa5006

@ -1,7 +1,12 @@
package Schema;
import android.content.DialogInterface;
import android.gesture.Prediction;
import androidx.appcompat.app.AlertDialog;
import com.example.cmknowledgegraph.LoginActivity;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@ -33,4 +38,39 @@ public class OperaSchema {
}
return false;
}
/**
*
* @return truefalse
*/
public static boolean register(String tel,String nickname,String password){
Connection conn=InitSchema.getConnect();
PreparedStatement pstmt;
ResultSet rst;
try {
pstmt=conn.prepareStatement("select paw\n" +
"from UserInfo\n" +
"where tel='"+tel+"'");
rst=pstmt.executeQuery();
if(rst==null){//注册成功
//注册成功提醒
AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
builder.setTitle("登陆提醒");// 设置标题
builder.setMessage("注册成功");// 为对话框设置内容
builder.create().show();// 使用show()方法显示对话框
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
// TODO Auto-generated method stub
//点击确定返回登录界面
finish();
}
});
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}

@ -39,6 +39,8 @@ public class LoginActivity extends AppCompatActivity {
*/
if(isLogin) {
finish();//返回个人中心Activity
//刷新个人中心Activity
}else{//登陆失败提醒
AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
builder.setTitle("登陆提醒");// 设置标题

@ -30,6 +30,7 @@ public class RegisterActivity extends AppCompatActivity {
String password=password_edit.getText().toString();
String NickName=nickname_edit.getText().toString();
//调用数据库类方法进行注册
}
});
}

Loading…
Cancel
Save