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

📄 user1.cpp

📁 这是一个人力资源管理软件。运行MAIN.CPP 进入“登陆信息”。 要进入员工管理页面请如下输入 empid - JOEL ,password - JOEL 进入管理人员界面: empid - ADM
💻 CPP
📖 第 1 页 / 共 2 页
字号:
class leave
{
public:

char typeofleave[13];
char nameleave[13];
char designation[13];
char date[13];
char leavefrom[13];
char leavetill[13];
char reason[13];
int noofdays;
int numberl;
int numbero;
int amount;
int sanction;
int sentl;
int sentOD;

leave(){loopc(typeofleave);loopc(nameleave);loopc(designation);
	loopc(designation);loopc(date);loopc(leavefrom);loopc(leavetill);
	loopc(reason);noofdays=-1;numberl=-1;numbero=-1;sanction=-1;sentl=-1;
	sentOD=-1;amount=-1;}

void rreadfromdisk(int);
void lwritetodisk(leave *,int);
void readfromdisk(int);
void setNULL();
void workOD();
void sappliedOD(int );
void applyOD();
void sOD();
void gOD(char*,char *,char *,int ,char *);
//void sleavedetails();
//void checkleaves();
void workleave();
void gleave(char *,char *,char *,char *,char *,char *,int ,char *);
void sleave();
void applyleave();
void sappliedleave(int );

}leaveOD;


void leave::workOD()
{
mouse.hidemouseptr();
setbk();
//mouse.showmouseptr();
/*		button apply(260,200,350,240);
		button chec(260,280,350,320);
		apply.show(0);
		chec.show(0);
		setcolor(15);
		outtextxy(280,220,"APPLY");
		outtextxy(280,300,"CHECK");
		*/
		settextstyle(0,0,3);
		setcolor(14);
		outtextxy(170,150,"OVER DEMAND");
		settextstyle(0,0,0);
		button apply(240,230,330,260);
		button chec(240,310,330,340);
		apply.tbutton(1);
		chec.tbutton(1);
		apply.show(0);
		chec.show(0);
		setcolor(15);
		outtextxy(257,240,"APPLY");
		outtextxy(257,320,"CHECK");

		button back(594,443,15,15);
		back.tbutton(2);
		back.show();
		o.open("back.dat",ios::in|ios::out|ios::nocreate|ios::noreplace|ios::binary);
		if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN BACK.DAT");getch();}
		o.read(picture,10000);
		o.close();
		putimage(580,427,picture,0);
while(1)
{
	mouse.showmouseptr();
		if(apply.check()==TRUE)
			{
				leaveOD.applyOD();return;
			}
		if(chec.check()==TRUE)
			{
				leaveOD.sOD();return;
			}
		if(back.check()==TRUE)
			{
				/*employee();*/workflow();return;
			}

}
}

void leave::applyOD()
{
leave a;
mouse.hidemouseptr();
setbk();
textbox name,designation,date,amount,reason;
setcolor(14);
name.setpoints(170,150);	outtextxy(60,162,"NAME");
designation.setpoints(170,220);	outtextxy(60,232,"DESIGNATION");
date.setpoints(170,290);	outtextxy(60,302,"DATE");
reason.setpoints(470,255);	outtextxy(327,267,"REASON");
amount.setpoints(470,185);	outtextxy(327,197,"AMOUNT");
name.show(15);
designation.show(15);
date.show(15);
amount.show(15);
reason.show(15);
button back(594,443,15,15);
back.tbutton(2);
back.show();

o.open("back.dat",ios::in|ios::out|ios::nocreate|ios::noreplace|ios::binary);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN BACK.DAT");getch();}
o.read(picture,10000);
o.close();
putimage(580,427,picture,0);
button down(30,350,615,355);
down.show(0);

//button submit(280,400,370,430);
//submit.show(4);setcolor(15);outtextxy(317,418,"SUBMIT");
button submit(280,400,370,433);
submit.show(4);setcolor(15);
o.open("submit.dat",ios::in|ios::out|ios::nocreate|ios::noreplace|ios::binary);
o.read(picture,10000);
o.close();
putimage(281,401,picture,0);
outtextxy(316,410,"SUBMIT");



while(1)
{

mouse.showmouseptr();
name.check(4,15);
designation.check(4,15);
date.check(4,15);
amount.check(4,15);
reason.check(4,15);

if(submit.check()==TRUE)
{
a.gOD(name.readstring(),designation.readstring(),date.readstring(),
		amount.readnumber(),reason.readstring());
a.lwritetodisk(&a,a.numbero);
leaveOD.workOD();return;
}
if(back.check()==TRUE)
	{
	leaveOD.workleave();return;
	}
}
}


void leave::gOD(char *n,char *d,char *d1,int no,char *r)
{
strcpy(nameleave,n);
strcpy(designation,d);
strcpy(date,d1);
amount=no;
strcpy(reason,r);
numberl=(current.RRN*2)-2;
numbero=(current.RRN*2)-1;

}


void leave::sappliedOD(int i=0)
{
mouse.hidemouseptr();
setbk();
o.open("logo.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN LOGO.DAT");getch();}
o.read(picture,10000);
o.close();
putimage(20,20,picture,0);
button back(594,443,15,15);
back.tbutton(2);
back.show();
o.open("back.dat",ios::in|ios::out|ios::nocreate|ios::noreplace|ios::binary);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN BACK.DAT");getch();}
o.read(picture,10000);
o.close();
putimage(580,427,picture,0);

/*button modify(260,420,350,450);
modify.show(4);setcolor(15);outtextxy(310,433,"EDIT");*/
button down(100,395,570,400);
down.show(0);

setcolor(14);
char b[13];
itoa(leaveOD.amount,b,10);
outtextxy(130,90,"NAME               :-");  outtextxy(370,150,leaveOD.nameleave);
outtextxy(130,130,"DESIGNATION        :-");  outtextxy(370,200,leaveOD.designation);
outtextxy(130,170,"DATE               :-");  outtextxy(370,250,leaveOD.date);
//outtextxy(130,210,"TYPE OF LEAVE      :-");  outtextxy(370,210,leaveOD.typeofleave);
//outtextxy(130,250,"LEAVE FROM         :-");  outtextxy(370,250,leaveOD.leavefrom);
//outtextxy(130,290,"LEAVE TILL         :-");  outtextxy(370,290,leaveOD.leavetill);
outtextxy(130,330,"AMOUNT             :-"); outtextxy(370,300,b);
outtextxy(130,370,"REASON             :-");  outtextxy(370,350,leaveOD.reason);
button sanct(200,420);
button nsanct(350,420);
sanct.show(0);
nsanct.show(0);

if(i==0)
{
//sanct.show(0);
setcolor(15);
outtextxy(207,427,"SANCTION");
outtextxy(357,427,"REJECT");
}
if(i==1)
{
setcolor(15);
outtextxy(207,427,"NEXT");
outtextxy(357,427,"DELETE");
}
while(1)
{
mouse.showmouseptr();
if(i==0)
	{
		if(sanct.check()==TRUE)
		{
			leaveOD.sanction=TRUE;
			sentOD=TRUE;
			leaveOD.lwritetodisk(&leaveOD,numbero);
			break;
			/*administratormain();return;*/
		}
		if(nsanct.check()==TRUE)
		{
			leaveOD.sanction=FALSE;
			sentl=TRUE;
			leaveOD.setNULL();
			leaveOD.lwritetodisk(&leaveOD,numbero);
			break;
			/*administratormain();return;*/
		}
	}
if(i==1)
	{
		if(sanct.check()==TRUE)
		{
			break;
		}
		if(nsanct.check()==TRUE)
		{
			leaveOD.sentOD=-1;
			//leaveOD.setNULL();
			leaveOD.lwritetodisk(&leaveOD,leaveOD.numbero);
			cleardevice();
			mouse.hidemouseptr();
			setbk();
			mouse.showmouseptr();
			setcolor(14);
			outtextxy(150,250,"MESSAGE DELETED");
			getch();
			break;
		}

	}
if(back.check()==TRUE)
	{
		administratormain();return;
	}
}


}

void leave::sOD()
{
leaveOD.readfromdisk((current.RRN*2)-1);
mouse.hidemouseptr();
setbk();
o.open("logo.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN LOGO.DAT");getch();}
o.read(picture,10000);
o.close();
putimage(20,20,picture,0);
button back(594,443,15,15);
back.tbutton(2);
back.show();
o.open("back.dat",ios::in|ios::out|ios::nocreate|ios::noreplace|ios::binary);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN BACK.DAT");getch();}
o.read(picture,10000);
o.close();
putimage(580,427,picture,0);

button down(100,395,570,400);
down.show(0);
if(leaveOD.sentOD!=TRUE)
{leaveOD.workOD();return;}
if(leaveOD.sanction==FALSE)
{leaveOD.setNULL();}
setcolor(14);
char b[13];
itoa(leaveOD.amount,b,10);
outtextxy(130,150,"NAME               :-");
outtextxy(130,200,"DESIGNATION        :-");
outtextxy(130,250,"DATE               :-");
outtextxy(130,300,"NO OF DAYS         :-");
outtextxy(130,350,"REASON             :-");
outtextxy(370,150,leaveOD.nameleave);
outtextxy(370,200,leaveOD.designation);
outtextxy(370,250,leaveOD.date);
outtextxy(370,300,b);
outtextxy(370,350,leaveOD.reason);
while(1)
{
mouse.showmouseptr();
if(back.check()==TRUE)
{
leaveOD.workOD();return;
}
}

}


void leave::setNULL()
{
loopc(typeofleave);
loopc(nameleave);
loopc(designation);
loopc(date);
loopc(leavefrom);
loopc(leavetill);
loopc(reason);
amount=-1;
noofdays=-1;
sanction=0;
//amount=0;
}


void leave::workleave()
	{
		mouse.hidemouseptr();
		setbk();
		settextstyle(0,0,3);
		setcolor(14);
		outtextxy(170,150,"LEAVE APPLICATION");
		settextstyle(0,0,0);
		button apply(240,230,330,260);
		button chec(240,310,330,340);
		apply.tbutton(1);
		chec.tbutton(1);
		apply.show(0);
		chec.show(0);
		setcolor(15);
		outtextxy(257,240,"APPLY");
		outtextxy(257,320,"CHECK");
		button back(594,443,15,15);
		back.tbutton(2);
		back.show();
		o.open("back.dat",ios::in|ios::out|ios::nocreate|ios::noreplace|ios::binary);
		if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN BACK.DAT");getch();}
		o.read(picture,10000);
		o.close();
		putimage(580,427,picture,0);
		while(1)
		{
		mouse.showmouseptr();
		if(apply.check()==TRUE)
			{
				leaveOD.applyleave();return;
			}
		if(chec.check()==TRUE)
			{
				leaveOD.sleave();return;
			}
		if(back.check()==TRUE)
			{
				/*employee();*/workflow();return;
			}
		}
	}


void leave::gleave(char *n,char *d,char *d1,char *t,char *d2,char *d3,int no,char *r)
{
strcpy(nameleave,n);
strcpy(designation,d);
strcpy(date,d1);
strcpy(typeofleave,t);
strcpy(leavefrom,d2);
strcpy(leavetill,d3);
noofdays=no;
strcpy(reason,r);
numberl=(current.RRN*2)-2;
numbero=(current.RRN*2)-1;
//writetodisk(&apply);
}


void leave::lwritetodisk(leave *j,int i)
{
fstream f;
f.open("LEAVE.DAT",ios::in|ios::out|ios::nocreate|ios::binary|ios::noreplace);
if(!f.good()){cleardevice();setcolor(RED);outtextxy(150,150,"ERROR IN USER.DAT");getch();exit(1);}
f.seekp(0+(sizeof(leave)*i),ios::beg);
f.write((const char*)j,sizeof(leave));
f.close();
//l.close();
}


void leave::readfromdisk(int a)
{
fstream f;
f.open("LEAVE.DAT",ios::in|ios::out|ios::nocreate|ios::binary|ios::noreplace);
if(!f.good()){outtextxy(100,100,"ERROR IN USER.DAT");getch();return;}

⌨️ 快捷键说明

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