51 lines
1.7 KiB
C++
51 lines
1.7 KiB
C++
|
|
#ifndef ATTENDANCE_SYSTEM_EMPLOYEE_HPP
|
||
|
|
#define ATTENDANCE_SYSTEM_EMPLOYEE_HPP
|
||
|
|
|
||
|
|
#include <string>
|
||
|
|
#include <ctime>
|
||
|
|
|
||
|
|
namespace AttendanceSystem {
|
||
|
|
|
||
|
|
class Employee {
|
||
|
|
public:
|
||
|
|
Employee();
|
||
|
|
Employee(const std::string& id, const std::string& name,
|
||
|
|
const std::string& departmentId, const std::string& position,
|
||
|
|
const std::string& mobile, const std::string& email);
|
||
|
|
|
||
|
|
// Getter方法
|
||
|
|
std::string getId() const { return employeeId_; }
|
||
|
|
std::string getName() const { return name_; }
|
||
|
|
std::string getDepartmentId() const { return departmentId_; }
|
||
|
|
std::string getPosition() const { return position_; }
|
||
|
|
std::string getMobile() const { return mobile_; }
|
||
|
|
std::string getEmail() const { return email_; }
|
||
|
|
time_t getCreateTime() const { return createTime_; }
|
||
|
|
|
||
|
|
// Setter方法
|
||
|
|
void setId(const std::string& id) { employeeId_ = id; }
|
||
|
|
void setName(const std::string& name) { name_ = name; }
|
||
|
|
void setDepartmentId(const std::string& deptId) { departmentId_ = deptId; }
|
||
|
|
void setPosition(const std::string& position) { position_ = position; }
|
||
|
|
void setMobile(const std::string& mobile) { mobile_ = mobile; }
|
||
|
|
void setEmail(const std::string& email) { email_ = email; }
|
||
|
|
|
||
|
|
// 验证员工信息是否完整
|
||
|
|
bool isValid() const;
|
||
|
|
|
||
|
|
// 显示员工信息
|
||
|
|
void display() const;
|
||
|
|
|
||
|
|
private:
|
||
|
|
std::string employeeId_; // 员工ID
|
||
|
|
std::string name_; // 姓名
|
||
|
|
std::string departmentId_; // 部门ID
|
||
|
|
std::string position_; // 职位
|
||
|
|
std::string mobile_; // 手机号
|
||
|
|
std::string email_; // 邮箱
|
||
|
|
time_t createTime_; // 创建时间
|
||
|
|
};
|
||
|
|
|
||
|
|
} // namespace AttendanceSystem
|
||
|
|
|
||
|
|
#endif // ATTENDANCE_SYSTEM_EMPLOYEE_HPP
|