Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Курсовой проект1 / Wladimir / kurs / Person
.h#if !defined(AFX_PERSON_H__419EE3CC_D573_45B3_92EC_B7826DE27450__INCLUDED_)
#define AFX_PERSON_H__419EE3CC_D573_45B3_92EC_B7826DE27450__INCLUDED_
#include "ListEmpl.h"
#include <iostream.h>
#if _MSC_VER > 1000
#pragma once
#endif
class CPerson {
public:
CString fio;
CString passport;
CPerson(){};
virtual ~CPerson(){};
virtual void SetFio(CString fio0)=0;
virtual void SetPassport(CString passport0)=0;
};
class CEmpl: public CPerson{
CString post;
public:
CEmpl(){};
void SetFio(CString fio0);
void SetPassport(CString passport0);
void SetPost(CString post0);
CString GetFio(){
return fio;
}
CString GetPassport(){
return passport;
}
CString GetPost(){
return post;
}
};
class CClient: public CPerson{
CTime dataZ;
CTime dataV;
CString room;
public:
void SetFio(CString fio0);
void SetPassport(CString passport0);
void SetDataZ(CTime data0){
dataZ=data0;
}
void SetDataV(CTime period0){
dataV=period0;
}
void SetRoom(CString room0){
room=room0;
}
CString GetRoom(){
return room;
}
CString GetFio(){
return fio;
}
CString GetPassport(){
return passport;
}
CTime GetDataZ(){
return dataZ;
}
CTime GetDataV(){
return dataV;
}
};
class CRoom{
CString number;
CString capasity;
CString occupy;
CString price;
// CList<CClient> lodger;
public:
void SetPrice(CString price0){
price=price0;
}
void SetNumber(CString number0){
number=number0;
}
void SetCapasity(CString capasity0){
capasity=capasity0;
}
void SetOccupy(CString occupy0){
occupy = occupy0;
}
CRoom(CString oc="0 "){occupy=oc;}
CString GetOccupy(){
return occupy;
}
bool SetOccupyDown(){
int oc = atoi(occupy);
char ch[2];
UINT len;
if (oc>0){
oc-=1;
occupy=itoa(oc,ch,10);
len = occupy.GetLength();
if (len>5) {occupy=occupy.Left(5);}
else
while (len<5){
occupy+=' ';
len = occupy.GetLength();
}
return true;
}
else
return false;
}
bool SetOccupyUp(){
int oc = atoi(occupy);
int cap = atoi(capasity);
char ch[6];
UINT len;
if (oc<cap){
oc+=1;
occupy=itoa(oc,ch,10);
len = occupy.GetLength();
if (len>5) {occupy=occupy.Left(5);}
else
while (len<5){
occupy+=' ';
len = occupy.GetLength();
}
return true;
}
else
return false;
}
CString GetNumber(){
return number;
}
CString GetCapasity(){
return capasity;
}
CString GetPrice(){
return price;
}
};
#endif // !defined(AFX_PERSON_H__419EE3CC_D573_45B3_92EC_B7826DE27450__INCLUDED_)
Соседние файлы в папке kurs