Browse Source

添加项目文件。

Creamo 2 years ago
parent
commit
db1fcb7da7

+ 23 - 0
1、WorkerMangerRequire.cpp

@@ -0,0 +1,23 @@
+//职工管理系统
+
+//1、管理系统需求
+//职工管理系统需求
+
+//职工管理系统可以用来管理公司内所有员工的信息
+//本教程主要利用C++来实现一个基于多态的职工管理系统
+
+//公司中职工分三类:普通员工、经理、老板,显示信息时,需要显示职工编号、职工姓名、职工岗位、以及职责
+//普通员工职责:完成经理交给的任务
+//经理职责:完成老板交给的任务,并下发任务给员工
+//老板职责:管理公司所有事务
+
+//职工管理系统需要实现的功能如下:
+//⚪退出管理程序:退出当前系统
+//⚪增加职工信息:实现批量添加职工功能,将信息录入到文件中,职工信息为:职工编号、姓名、部门编号
+//⚪显示职工信息:显示公司内部所有职工信息
+//⚪删除离职职工:按照编号删除指定的职工
+//⚪修改职工信息:按照编号修改职工个人信息
+//⚪查找职工信息:按照职工的编号或者职工的姓名进行查找相关的人员信息
+//⚪按照编号排序:按照职工编号,进行排序,排序规则由用户指定
+//⚪清空所有文档:清空文件中记录的所有职工信息(清空前需要再次确认,防止误删)
+

+ 5 - 0
worker.h

@@ -0,0 +1,5 @@
+#pragma once
+#include <iostream>
+#include <string>
+
+

+ 40 - 0
workerManger.cpp

@@ -0,0 +1,40 @@
+#include "workerManger.h"
+
+WorkerManger::WorkerManger()
+{
+
+
+}
+
+//展示菜单
+void WorkerManger::show_Menu()
+{
+	
+	std::cout << "**************************************************" << std::endl;
+	std::cout << "*************欢迎使用职工管理系统****************" << std::endl;
+	std::cout << "****************0、退出管理系统******************" << std::endl;
+	std::cout << "****************1、增加职工信息******************" << std::endl;
+	std::cout << "****************2、显示职工信息******************" << std::endl;
+	std::cout << "****************3、删除职工信息******************" << std::endl;
+	std::cout << "****************4、修改职工信息******************" << std::endl;
+	std::cout << "****************5、查找职工信息******************" << std::endl;
+	std::cout << "****************6、按照编号排序******************" << std::endl;
+	std::cout << "****************7、清空所有文档******************" << std::endl;
+	std::cout << "**************************************************" << std::endl;
+	std::cout << std::endl;
+
+}
+
+//退出系统
+void WorkerManger::ExitSystem()
+{
+	std::cout << "欢迎下次使用" << std::endl;
+	system("pause");
+	exit(0);
+}
+
+WorkerManger::~WorkerManger()
+{
+
+
+}

+ 20 - 0
workerManger.h

@@ -0,0 +1,20 @@
+#pragma once;              //防止头文件重复包含
+
+#include <iostream>
+
+class WorkerManger
+{
+public:
+	//构造函数
+	WorkerManger();
+
+	//展示菜单
+	void show_Menu();
+
+	//退出系统
+	void ExitSystem();
+
+	//析构函数
+	~WorkerManger();
+
+};

+ 58 - 0
职工管理系统.cpp

@@ -0,0 +1,58 @@
+#include <iostream>
+#include "workerManger.h"
+
+int main()
+{
+
+	//实例化一个管理者对象
+	WorkerManger wm;
+
+	int choice = 0;     //用来存储用户的选项
+
+	while (true)
+	{
+		//调用展示菜单成员函数
+		wm.show_Menu();
+
+		std::cout << "请输入您的选择:" << std::endl;
+		std::cin >> choice;         //接受用户的选项
+
+		switch (choice)
+		{
+		case 0:          //退出系统
+			wm.ExitSystem();
+			break;
+
+		case 1:          //增加职工
+			break;
+
+		case 2:          //显示职工
+			break;
+
+		case 3:          //删除职工
+			break;
+
+		case 4:          //修改职工
+			break;
+
+		case 5:          //查找职工
+			break;
+
+		case 6:          //排序职工
+			break;
+
+		case 7:          //清空文档
+			break;
+
+		default:
+			system("cls");  //清屏
+			break;
+		}
+	}
+
+
+
+	system("pause");
+
+	return 0;
+}

+ 31 - 0
职工管理系统.sln

@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.32802.440
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "职工管理系统", "职工管理系统.vcxproj", "{CBB41D26-53A1-435E-9F3C-CC3F65E3948E}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{CBB41D26-53A1-435E-9F3C-CC3F65E3948E}.Debug|x64.ActiveCfg = Debug|x64
+		{CBB41D26-53A1-435E-9F3C-CC3F65E3948E}.Debug|x64.Build.0 = Debug|x64
+		{CBB41D26-53A1-435E-9F3C-CC3F65E3948E}.Debug|x86.ActiveCfg = Debug|Win32
+		{CBB41D26-53A1-435E-9F3C-CC3F65E3948E}.Debug|x86.Build.0 = Debug|Win32
+		{CBB41D26-53A1-435E-9F3C-CC3F65E3948E}.Release|x64.ActiveCfg = Release|x64
+		{CBB41D26-53A1-435E-9F3C-CC3F65E3948E}.Release|x64.Build.0 = Release|x64
+		{CBB41D26-53A1-435E-9F3C-CC3F65E3948E}.Release|x86.ActiveCfg = Release|Win32
+		{CBB41D26-53A1-435E-9F3C-CC3F65E3948E}.Release|x86.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {2652D1BF-D833-4EFA-A2F1-20840143270D}
+	EndGlobalSection
+EndGlobal

+ 153 - 0
职工管理系统.vcxproj

@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <VCProjectVersion>16.0</VCProjectVersion>
+    <Keyword>Win32Proj</Keyword>
+    <ProjectGuid>{cbb41d26-53a1-435e-9f3c-cc3f65e3948e}</ProjectGuid>
+    <RootNamespace>职工管理系统</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>true</ConformanceMode>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>true</ConformanceMode>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>true</ConformanceMode>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>true</ConformanceMode>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="1、WorkerMangerRequire.cpp" />
+    <ClCompile Include="workerManger.cpp" />
+    <ClCompile Include="职工管理系统.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="worker.h" />
+    <ClInclude Include="workerManger.h" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 36 - 0
职工管理系统.vcxproj.filters

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="源文件">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="头文件">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
+    </Filter>
+    <Filter Include="资源文件">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="1、WorkerMangerRequire.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="workerManger.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="职工管理系统.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="workerManger.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="worker.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>