⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ld_face.cpp

📁 设计模式:工厂模式、单例模式的基本实现
💻 CPP
📖 第 1 页 / 共 3 页
字号:

	cout<<"\tESC\t返回上一层"<<"\t\t"<<endl;
	cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<endl;
	cout<<"\t◆请选择:";
}


//注册界面
void LD_Face::m_LD_FC_RegisterAdd(int &_nTotalStu)
{
	cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<endl<<endl;
	cout<<"\t\t\t\t"<<"注册新考生"<<'\t'<<endl;
	cout<<""<<'\t'<<endl;
	cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<endl;

	cout<<""<<"\t\t\t\t\t\t\t已注册考生"<<_nTotalStu<<"位\t"<<endl;
	cout<<"\t◆输入考生用户名(长度不超过15):\t\t\t\n"<<endl;
	cout<<""<<"\t◆输入 考生密码(6个阿拉伯数字):\t\t\t\n"<<endl;
	cout<<"\t◆确 认 密 码 (6个阿拉伯数字):\t\n"<<endl;
}



//用户名超过15字符
void CLD_FC_subRegisterFace::m_LD_FC_RegisterAddNameLong(int &_nTotalStu)
{
	cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<'\n'<<endl;
	cout<<"\t\t\t\t"<<"注册新考生"<<'\t'<<endl;
	cout<<""<<'\t'<<endl;
	cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<endl;

	cout<<""<<"\t\t\t\t\t\t\t已注册考生"<<_nTotalStu<<"位\t"<<endl;
	cout<<""<<"\t◆输入考生用户名(长度不超过15):"<<endl<<endl;
	cout<<"\t◆用户名超过规定的范围,请重新输入!\n"<<endl;
	cout<<""<<"\t◆输入考生用户名(长度不超过15):\t\t\t\n"<<endl;
	cout<<""<<"\t◆输入 考生密码(6个阿拉伯数字):\t\t\t\n"<<endl;
	cout<<"\t◆确 认 密 码 (6个阿拉伯数字):\t\n"<<endl;
}



//用户名重名
void CLD_FC_subRegisterFace::m_LD_FC_RegisterAddNameExist(int &_nTotalStu)
{
	cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<'\n'<<endl;
	cout<<"\t\t\t\t"<<"注册新考生"<<'\t'<<endl;
	cout<<""<<'\t'<<endl;
	cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<endl;

	cout<<""<<"\t\t\t\t\t\t\t已注册考生"<<_nTotalStu<<"位\t"<<endl;
	cout<<""<<"\t◆输入考生用户名(长度不超过15):\t\t\t\n"<<endl;
	cout<<endl<<endl;
	cout<<"\t◆请选择:"<<" "<<"\t\t"<<endl;
}

//查看
void LD_Face::m_LD_FC_RegisterLook(int &_nTotalStu)
{
	cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<'\n'<<endl;
	cout<<"\t\t\t\t"<<"查看当前注册人员"<<'\t'<<endl;
	cout<<""<<'\t'<<endl;
	cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<endl;
	cout<<""<<"\t\t\t\t\t\t\t已注册考生"<<_nTotalStu<<"位\t"<<endl;
	LD_FileR* Temple;

	Temple=Test.LD_CTR_ReadRegister();
	static int j=1;
	while (Temple!=NULL)
	{
		cout<<j<<endl;
		int k=0;
		for (;(k+1+(j-1)*12)<=_nTotalStu&&k<12;k++)
		{
			cout<<'\t'<<k+1+(j-1)*12<<"->"<<Temple->getName()<<endl;
			Temple=Temple->getNext();
		}
		if(j<_nTotalStu/12+1)
		{
			cout<<endl<<endl<<"    第 "<<j<<" 页	"<<"  ->1上一页	 ->2下一页"<<"    共 "<<_nTotalStu/12<<" 页  "<<" ESC返回上一层"<<endl;
			int nChoose = 0;
			cin>>nChoose;
			if (nChoose==1)
			{
				system("cls");
				m_LD_FC_RegisterManage(_nTotalStu);
			}
			if (nChoose==2)
			{
				m_LD_FC_RegisterManage(_nTotalStu);
				system("cls");
				cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<'\n'<<endl;
				cout<<"\t\t\t\t"<<"查看当前注册人员"<<'\t'<<endl;
				cout<<""<<'\t'<<endl;
				cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<endl;
				cout<<""<<"\t\t\t\t\t\t\t已注册考生"<<_nTotalStu<<"位\t"<<endl;
			}
			if (nChoose==27)
			{
				cout<<"return!"<<endl;
			}
			else
			{
				cout<<"Your input is error !"<<endl;
			}
		}
		else
		{
			cout<<"    第 "<<j<<" 页	"<<"  ->1上一页	 ->2下一页"<<"    共 "<<_nTotalStu/12<<" 页  "<<" ESC返回上一层"<<endl;
			cout<<endl<<"    ◆已经是最后一页了!"<<endl;
			cout<<"    第 "<<j<<" 页	"<<"  ->1上一页	 ->2下一页"<<"    共 "<<_nTotalStu/12<<" 页  "<<" ESC返回上一层"<<endl;
	    	getchar();	
			break;
		}
		j++;
	}
}


//修改考生密码
void LD_Face::m_LD_FC_RegisterChange(int &_nTotalStu)
{
	char PWTmp[7]="";
	string PW="";
	LD_Control sv;
	cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<'\n'<<endl;
	cout<<"\t\t\t\t"<<"修改注册考生信息"<<'\t'<<endl;
	cout<<""<<'\t'<<endl;
	cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<endl;
	cout<<""<<"\t\t\t\t\t\t\t已注册考生"<<_nTotalStu<<"位\t"<<endl;	
	cout<<"\t◆请输入要修改的考生:";
	string strname="";
	cin>>strname;
	LD_FileR* Temple;
	Temple=Test.LD_CTR_ReadRegister();
	while (Temple!=NULL)
	{
		if (Temple->getName()==strname)
		{
			Temple->getPassWord()="";
			cout<<"\t◆密码修改为:";
			for(int i=0; i<7; i++)
			{
				char mm=getch();
				if (mm==8)
				{
					i-=1;
					if(mm==8&&i>=0)
					{
						cout<<"\b";
						cout<<" ";
						cout<<"\b";
						i-=1;		
					}
				}
				else if(i<6)
				{
					PWTmp[i]=mm;
					cout<<"*";
				}
			}
			PW=PWTmp;
			Temple->setPassWord(PW);
			cout<<endl<<"\t◆确认修改为:";
			for(i=0; i<6; i++)
			{
				char mm=getch();
				if (mm==8)
				{
					i-=1;
					if(mm==8&&i>=0)
					{
						cout<<"\b";
						cout<<" ";
						cout<<"\b";
						i-=1;		
					}
				}
				else if(i<6)
				{
					PWTmp[i]=mm;
					cout<<"*";
				}
			}
			PW=PWTmp;
			Temple->setrPassWord(PW);
			cout<<endl<<"◆修改成功!"<<endl;
			cout<<"\t◆ESC返回上一层		◆任意键继续修改"<<endl;
		}
		Temple=Temple->getNext();	
	}
	sv.LD_CTR_SaveRegister(Temple);						//??????????????????????
}


//删除注册考生信息
void LD_Face::m_LD_FC_RegisterDelete(int &_nTotalStu)
{
	cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<'\n'<<endl;
	cout<<"\t\t\t\t"<<"删除注册考生信息"<<'\t'<<endl;
	cout<<""<<'\t'<<endl;
	cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<endl;
	cout<<""<<"\t\t\t\t\t\t\t已注册考生"<<_nTotalStu<<"位\t"<<endl;	
	cout<<"◆请输入要删除的考生:";
	string strname="";
	cin>>strname;
	LD_FileR* p1, *p2;
	p1=p2=Test.LD_CTR_ReadRegister();
	while (p1!=NULL)
	{
		if (p1==NULL)
		{
			cout<<"NO STUDENT!"<<endl;
			break;
		}
		while (strname!=p1->getName()&&p1->getNext()!=NULL)
		{
			p2=p1;
			p1=p1->getNext();
		}
		if (p1->getName()==strname)				//Find
		{		
			if (p1==Test.LD_CTR_ReadRegister())			//the first is the one
			{
				cout<<"◆删除成功!"<<endl;
				cout<<"◆ESC返回上一层		◆任意键继续"<<endl;
				break;
			}
			else
			{
				p2->FLR_Next=p1->getNext();
				cout<<"◆删除成功!"<<endl;
				cout<<"◆ESC返回上一层		◆任意键继续"<<endl;
				break;
			}
		}
		else
		{
			cout<<"◆该考生不存在!"<<endl;
			cout<<"1->重新输入		2->ESC返回"<<endl;
			int nTest = 0;
			cin>>nTest;
			if (nTest == 1)
			{
				m_LD_FC_RegisterDelete(_nTotalStu);
			}
			if (nTest == 27)
			{
				m_LD_FC_RegisterManage(_nTotalStu);
			}
			
		}
	}
}
/************************************************************************/
/*    试题管理界面		作者:贾玉辉                                    */
/************************************************************************/
/************************************************************************/
/*    添加试题界面		作者:贾玉辉                                    */
/************************************************************************/
/************************************************************************/
/*    修改试题界面		作者:贾玉辉                                    */
/************************************************************************/

// string LD_Face::string(int _b)
// {
// 	int i=0;
// 	while (1)
// 	{
// 		
// 	}
// }

// 
//iostream& LD_Face::operator>>(iostream &in, string& ld)
// iostream& operator>>(iostream &in, string& ld)
// {
// 	char chTem='\0';
// 	char chTem1='\0';
// 	int i=0;
// 	while(1)
// 	{
// 		chTem=getch();
// 		if (chTem=='\r')
// 		{
// 			putch(chTem);
// 			break;
// 		}else if (chTem==0)
// 		{
// 			getch();
// 			continue;
// 		}else if (chTem<=254&&chTem>=161)
// 		{
// 			if (chTem==224)
// 			{
// 				char chTem1=getch();
// 				if (chTem==72||chTem==75||chTem==80||chTem==77||chTem==79||chTem==71)
// 				{
// 					cout<<(char)chTem<<(char)chTem1;
// 				}
// 			}else
// 			{
// 				chTem1=chTem;
// 				chTem=getch();
// 				cout<<(char)chTem1<<(char)chTem;
// 			}
// 		}
// 		ld[i]=chTem;
// 		i++;
// 	}
// 	in>>ld;
// 	return in;
// }
// // void LD_Face::operator>>(string &str)
// // {
// // 	char chTem='\0';
// // 	char chTem1='\0';
// // 	iostream *ii;
// // 	chTem=getch();
// // 	if (chTem=='\0')
// // 	{
// // 		return;
// // 	}
// // 	
// // 	return;
// // }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -