2022/06/25-22:43--update

This commit is contained in:
zyx 2022-06-25 22:42:56 +08:00
parent 6fb921390a
commit c19576da7c
6 changed files with 51 additions and 50 deletions

View File

@ -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() {
}
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -1,9 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.text.*?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.text.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
@ -13,17 +11,19 @@
<items>
<Button mnemonicParsing="false" onAction="#onMainViewButtonClick" text="主页" />
<Button mnemonicParsing="false" text="修改信息" />
<Button mnemonicParsing="false" onAction="#changePassword" text="修改密码" />
<Button mnemonicParsing="false" text="后台系统" />
<Button mnemonicParsing="false" text="退出登录" />
</items>
</ToolBar>
<Text layoutX="23.0" layoutY="88.0" strokeType="OUTSIDE" strokeWidth="0.0" text="职工号:" />
<Text layoutX="23.0" layoutY="108.0" strokeType="OUTSIDE" strokeWidth="0.0" text="姓名:" />
<Text layoutX="23.0" layoutY="148.0" strokeType="OUTSIDE" strokeWidth="0.0" text="部门/所在系:" />
<Text layoutX="23.0" layoutY="128.0" strokeType="OUTSIDE" strokeWidth="0.0" text="职称:" />
<Text fx:id="showFacultyId" layoutX="83.0" layoutY="88.0" strokeType="OUTSIDE" strokeWidth="0.0" />
<Text fx:id="showFacultyName" layoutX="68.0" layoutY="108.0" strokeType="OUTSIDE" strokeWidth="0.0" />
<Text fx:id="showFacultyDepartment" layoutX="68.0" layoutY="128.0" strokeType="OUTSIDE" strokeWidth="0.0" />
<Text fx:id="showFacultyTitle" layoutX="120.0" layoutY="148.0" strokeType="OUTSIDE" strokeWidth="0.0" />
<Label fx:id="showInfo" layoutX="14.0" layoutY="58.0" prefHeight="262.0" prefWidth="571.0" />
<TextField fx:id="getDepartment" layoutX="211.0" layoutY="63.0" visible="false" />
<Label fx:id="changeDepartment" layoutX="21.0" layoutY="68.0" prefHeight="20.0" prefWidth="176.0" text="请输入新的部门/所在系:" visible="false" />
<Label fx:id="changeTitle" layoutX="21.0" layoutY="108.0" text="请输入新的职称:" visible="false" />
<TextField fx:id="getTitle" layoutX="211.0" layoutY="103.0" visible="false" />
<Label fx:id="changePassword" layoutX="32.0" layoutY="78.0" text="请输入新密码:" visible="false" />
<Label fx:id="ensurePassword" layoutX="32.0" layoutY="118.0" text="请确认新密码:" visible="false" />
<PasswordField fx:id="getPassword" layoutX="147.0" layoutY="73.0" visible="false" />
<PasswordField fx:id="getEnsurePassword" layoutX="147.0" layoutY="113.0" visible="false" />
</children>
</AnchorPane>

View File

@ -41,28 +41,19 @@
<RadioButton fx:id="radioButtonFaculty" mnemonicParsing="false" text="教职工">
<toggleGroup>
<ToggleGroup fx:id="chooseStatus" />
</toggleGroup></RadioButton>
<RadioButton fx:id="radioButtonStudent" mnemonicParsing="false" text="学生" toggleGroup="$chooseStatus" GridPane.columnIndex="1" />
</toggleGroup>
<GridPane.margin>
<Insets left="20.0" />
</GridPane.margin></RadioButton>
<RadioButton fx:id="radioButtonStudent" mnemonicParsing="false" text="学生" toggleGroup="$chooseStatus" GridPane.columnIndex="1">
<GridPane.margin>
<Insets left="30.0" />
</GridPane.margin></RadioButton>
</children>
</GridPane>
<Button onAction="#onLoginButtonClick" prefHeight="30.0" prefWidth="51.0" text="登录" />
<Label fx:id="loginText" />
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button onAction="#onLoginButtonClick" prefHeight="30.0" prefWidth="51.0" text="登录" GridPane.columnIndex="1">
<GridPane.margin>
<Insets left="50.0" />
</GridPane.margin>
</Button>
</children>
</GridPane>
</children>
</VBox>