diff --git a/src/main/java/cn/czyx007/eas_gui/FacultyMainController.java b/src/main/java/cn/czyx007/eas_gui/FacultyMainController.java index 9f99d91..e901fbd 100644 --- a/src/main/java/cn/czyx007/eas_gui/FacultyMainController.java +++ b/src/main/java/cn/czyx007/eas_gui/FacultyMainController.java @@ -2,7 +2,9 @@ package cn.czyx007.eas_gui; import cn.czyx007.eas_gui.bean.Faculty; import cn.czyx007.eas_gui.bean.Student; +import javafx.event.ActionEvent; import javafx.fxml.FXML; +import javafx.scene.control.Label; import javafx.scene.text.Text; /** @@ -12,15 +14,18 @@ import javafx.scene.text.Text; public class FacultyMainController { static Faculty faculty; - @FXML Text showFacultyId; - @FXML Text showFacultyName; - @FXML Text showFacultyDepartment; - @FXML Text showFacultyTitle; + @FXML + private Label showInfo; public void onMainViewButtonClick() { - showFacultyId.setText(faculty.getId()); - showFacultyName.setText(faculty.getName()); - showFacultyDepartment.setText(faculty.getDepartment()); - showFacultyTitle.setText(faculty.getTitle()); + showInfo.setText("职工号:" + faculty.getId() + "\n" + + "姓名:" + faculty.getName() + "\n" + + "性别:" + faculty.getSex() + "\n" + + "出生年月日:" + faculty.getBirth() + "\n" + + "部门/所在系:" + faculty.getDepartment() + "\n" + + "职称:" + faculty.getTitle()); + } + + public void changePassword() { } } diff --git a/src/main/java/cn/czyx007/eas_gui/LoginController.java b/src/main/java/cn/czyx007/eas_gui/LoginController.java index 168e01f..bfa6752 100644 --- a/src/main/java/cn/czyx007/eas_gui/LoginController.java +++ b/src/main/java/cn/czyx007/eas_gui/LoginController.java @@ -16,11 +16,14 @@ import javafx.stage.Stage; import java.sql.Connection; public class LoginController { - @FXML TextField userId; - @FXML PasswordField password; - @FXML RadioButton radioButtonFaculty; - @FXML RadioButton radioButtonStudent; - + @FXML + private TextField userId; + @FXML + private PasswordField password; + @FXML + private RadioButton radioButtonFaculty; + @FXML + private RadioButton radioButtonStudent; @FXML private Label loginText; diff --git a/src/main/java/cn/czyx007/eas_gui/bean/Faculty.java b/src/main/java/cn/czyx007/eas_gui/bean/Faculty.java index 346dd20..8312227 100644 --- a/src/main/java/cn/czyx007/eas_gui/bean/Faculty.java +++ b/src/main/java/cn/czyx007/eas_gui/bean/Faculty.java @@ -1,6 +1,7 @@ package cn.czyx007.eas_gui.bean; import java.time.LocalDate; +import java.util.Date; /** * @author : 张宇轩 @@ -11,14 +12,14 @@ public class Faculty { private String name;//姓名 private String password;//密码 private String sex;//性别 - private LocalDate birth;//出生年月日 + private Date birth;//出生年月日 private String department;// 部门 / 所在系 private String title;//职称 public Faculty() { } - public Faculty(String id, String name, String password, String sex, LocalDate birth, String department, String title) { + public Faculty(String id, String name, String password, String sex, Date birth, String department, String title) { this.id = id; this.name = name; this.password = password; @@ -76,11 +77,11 @@ public class Faculty { this.sex = sex; } - public LocalDate getBirth() { + public Date getBirth() { return birth; } - public void setBirth(LocalDate birth) { + public void setBirth(Date birth) { this.birth = birth; } diff --git a/src/main/java/cn/czyx007/eas_gui/bean/Student.java b/src/main/java/cn/czyx007/eas_gui/bean/Student.java index 0393e25..5b76c7b 100644 --- a/src/main/java/cn/czyx007/eas_gui/bean/Student.java +++ b/src/main/java/cn/czyx007/eas_gui/bean/Student.java @@ -1,6 +1,7 @@ package cn.czyx007.eas_gui.bean; import java.time.LocalDate; +import java.util.Date; /** * @author : 张宇轩 @@ -11,7 +12,7 @@ public class Student { private String name;//姓名 private String password;//密码 private String sex;//性别 - private LocalDate birth;//出生年月日 + private Date birth;//出生年月日 private String department;//所在系 private Integer grade;//年级 private String stuClass;//班级 @@ -19,7 +20,7 @@ public class Student { public Student() { } - public Student(String id, String name, String password, String sex, LocalDate birth, String department, Integer grade, String stuClass) { + public Student(String id, String name, String password, String sex, Date birth, String department, Integer grade, String stuClass) { this.id = id; this.name = name; this.password = password; @@ -86,11 +87,11 @@ public class Student { this.sex = sex; } - public LocalDate getBirth() { + public Date getBirth() { return birth; } - public void setBirth(LocalDate birth) { + public void setBirth(Date birth) { this.birth = birth; } diff --git a/src/main/resources/cn/czyx007/eas_gui/faculty-main-view.fxml b/src/main/resources/cn/czyx007/eas_gui/faculty-main-view.fxml index b1c5f1a..b2c7027 100644 --- a/src/main/resources/cn/czyx007/eas_gui/faculty-main-view.fxml +++ b/src/main/resources/cn/czyx007/eas_gui/faculty-main-view.fxml @@ -1,9 +1,7 @@ - - - + @@ -13,17 +11,19 @@ - -