首页 > 其他分享 >员工管理系统(考试)

员工管理系统(考试)

时间:2023-12-29 20:14:06浏览次数:26  
标签:employees 管理系统 self 员工 print input id 考试

class Syestem:
    def __init__(self):
        self.employees = {}

    def register(self):
        username = input('请输入用户名:>>>>>>')
        password = input('请输入密码:>>>>>>')
        print('注册成功')

    def login(self):
        username = input('请输入用户名:>>>>>>')
        password = input('请输入密码:>>>>>>')
        print('登录成功')

    def add_employee_info(self):
        id = input('请输入员工ID:>>>>>>')
        name = input('请输入员工姓名:>>>>>>')
        money = input('输入员工年薪:>>>>>')
        hobby = input('请输入员工爱好:>>>>>>')
        self.employees[id] = {'name': name, 'money': money, 'hobby': hobby}
        print('信息添加成功')

    def search_employee_info(self, id):
        if id in self.employees:
            print(
                f"员工ID: {id}, 姓名: {self.employees[id]['name']}, 年薪: {self.employees[id]['money']},爱好:{self.employees[id]['hobby']}")
        else:
            print('找不到员工信息')

    def search_all_employee_info(self):
        for id, info in self.employees.items():
            print(f"员工ID: {id}, 姓名: {info['name']}, 年薪: {info['money']},爱好:{info['hobby']}")

    def del_employee(self, id):
        if id in self.employees:
            del self.employees[id]
            print('删除成功')
        else:
            print('找不到员工信息')

    def del_all_employee(self):
        self.employees.clear()
        print('删除所有信息成功')

    def change_info(self, id):
        if id in self.employees:
            new_name = input('请输入新的员工姓名:>>>>>>')
            new_money = input('输入新的年薪:>>>>>>')
            new_hobby = input("请输入新的爱好:>>>>>")
            self.employees[id]['name'] = new_name
            self.employees[id]['money'] = new_money
            self.employees[id]['hobby'] = new_hobby
            print('员工信息修改成功')
        else:
            print('找不到员工信息')

    def exit_system(self):
        print('再见')


def main():
    dhy = Syestem()

    while True:
        print("--------------- 欢迎来到梦梦员工系统 ---------------")
        print(
            "1:注册\n2:登陆\n3:添加员工信息\n4:查看指定员工信息\n5:查看所有员工信息\n6:删除指定员工信息\n7:删除所有员工信息\n8:修改指定员工信息\n9:退出系统")
        choice = input('请输入功能ID:>>>>>')

        if choice == '1':
            dhy.register()
        elif choice == '2':
            dhy.login()
        elif choice == '3':
            dhy.add_employee_info()
        elif choice == '4':
            id = input("请输入员工ID: ")
            dhy.search_employee_info(id)
        elif choice == '5':
            dhy.search_all_employee_info()
        elif choice == '6':
            id = input("请输入员工ID: ")
            dhy.del_employee(id)
        elif choice == '7':
            dhy.del_all_employee()
        elif choice == '8':
            id = input("请输入员工ID: ")
            dhy.change_info(id)
        elif choice == '9':
            dhy.exit_system()
            break
        else:
            print("重新输入")
        if not choice.isdigit():
            print('非法')


if __name__ == '__main__':
    main()

标签:employees,管理系统,self,员工,print,input,id,考试
From: https://www.cnblogs.com/dhyuan/p/17934026.html

相关文章

  • 学生管理系统
    #include<iostream>#include<vector>#include<windows.h>usingnamespacestd;inta=999;intb=0;boolc=false;structstudent{stringname;intage;intcard;intgrade;}s;voidka(){cout<<"学生管理系统:"<<endl;cout<......
  • 华为云耀云服务器L实例-微人事前后端分离人力资源管理系统-RabbitMQ配置
     华为云耀云服务器L实例-微人事前后端分离人力资源管理系统-RabbitMQ配置   产品官网:https://www.huaweicloud.com/product/hecs-light.html 项目源代码地址:https://github.com/lenve/vhr  今天我们采用可靠更安全、智能不卡顿、价优随心用、上手更简单、管理......
  • 华为云耀云服务器L实例-微人事前后端分离人力资源管理系统-项目本地配置
     华为云耀云服务器L实例-微人事前后端分离人力资源管理系统-项目本地配置   产品官网:https://www.huaweicloud.com/product/hecs-light.html 项目源代码地址:https://github.com/lenve/vhr  今天我们采用可靠更安全、智能不卡顿、价优随心用、上手更简单、管理......
  • 华为云耀云服务器L实例-tilas教学管理系统后端配置-3
     华为云耀云服务器L实例-tilas教学管理系统后端配置-3  产品官网:https://www.huaweicloud.com/product/hecs-light.html项目源代码地址:https://github.com/JohnYoung5665/spring-boot-web01/tree/master  今天我们采用可靠更安全、智能不卡顿、价优随心用、上手更......
  • 华为云耀云服务器L实例-tilas教学管理系统后端配置-4
     华为云耀云服务器L实例-tilas教学管理系统后端配置-4  产品官网:https://www.huaweicloud.com/product/hecs-light.html项目源代码地址:https://github.com/JohnYoung5665/spring-boot-web01/tree/master  今天我们继续采用可靠更安全、智能不卡顿、价优随心用、上......
  • 华为云耀云服务器L实例-微人事前后端分离人力资源管理系统-mysql配置vhr数据库准备
     华为云耀云服务器L实例-微人事前后端分离人力资源管理系统-mysql配置vhr数据库准备  产品官网:https://www.huaweicloud.com/product/hecs-light.html 项目源代码地址:https://github.com/lenve/vhr  今天我们采用可靠更安全、智能不卡顿、价优随心用、上手更简......
  • 华为云耀云服务器L实例-微人事前后端分离人力资源管理系统-Redis配置
     华为云耀云服务器L实例-微人事前后端分离人力资源管理系统-Redis配置   产品官网:https://www.huaweicloud.com/product/hecs-light.html 项目源代码地址:https://github.com/lenve/vhr  今天我们采用可靠更安全、智能不卡顿、价优随心用、上手更简单、管理特......
  • 华为云耀云服务器L实例-tilas教学管理系统前端配置
     华为云耀云服务器L实例-tilas教学管理系统前端配置  产品官网:https://www.huaweicloud.com/product/hecs-light.html项目源代码地址:https://github.com/JohnYoung5665/spring-boot-web01/tree/master  今天我们采用可靠更安全、智能不卡顿、价优随心用、上手更简......
  • 全国计算机等级考试简介 School of Computer Science and Engineering
    全国计算机等级考试简介SchoolofComputerScienceandEngineering阅读量:1185     发布时间:2014-05-25分享到: 全国计算机等级考试(NationalComputerRankExamination,简称NCRE),是经原国家教育委员会(现教育部)批准,由教育部考试中心主办,面向社会,用于考查应试人......
  • 从数据中洞察:如何运用公司员工工作状况分析大屏提升管理效果
    在当今快节奏的工作环境中,了解员工的工作状况对于任何组织来说都至关重要。随着数据可视化和人工智能技术的进步,一种新型的管理工具——公司员工工作状况分析大屏应运而生。这种大屏能够实时展示员工的工作状况,帮助管理者更好地理解员工的工作表现,从而制定出更有效的管理策略。 ......