图书馆管理系统数据库设计 第4页

图书馆管理系统数据库设计 第4页
    SEX       char(4)                       ,
    CLASS     char(8)                       ,
    DATE1     date                          ,
    primary key (TNO)
);
create table USER
(
    NUM       numeric(5)                    ,
    USER      char(10)                      ,
    ID        char(10)                      ,
    FLAG      char(5)                      
);
create table SFK
(
    SNUM      numeric(5)            not null,
    SNO       char(10)              not null,
    DATE1     date                          ,
    MONEY     numeric(8,2)                  ,
    ID        char(10)                      ,
    primary key (SNUM)
);
create table TFK
(
    TNUM      numeric(5)            not null,
    TNO       char(10)              not null,
    DATE1     date                          ,
    MONEY     numeric(8,2)                  ,
    ID        char(10)                      ,
    primary key (TNUM)
);
6、应用程序的编制
(1)编程语言的选择
VB语言为用户提供大量的界面元素(在VB中称为控件对象),例如“窗体”“菜单”“命令按钮”“工具按钮”“检查框”等等,用户只需要利用鼠标,键盘把这些控件对象若东到适当的位置,设置他们的大小,形状,属性等,就可以设计出所需要的应用程序界面。
6.2相关程序代码及界面
void AddRecord(CList &TelList)
{ system("cls");
CNode *pNode;
CTelRecord *pTel;
char szName[20],szNumber[20], kind[20], writer[20];
cout<<"\n\t\t ◇请输入书名(输入0结束) :";
cin.getline (szName,20);
while(strcmp(szName,"0"))
{
cout<<"\t\t ◇请输入书的编号 :";
cin.getline(szNumber,20);
cout<<"\t\t ◇请输入书的种类(社科,自科,文学,工具书,其他):";
cin.getline(kind,20);
cout<<"\t\t ◇请输入作者的姓名 :";
cin.getline(writer,20);
pTel=new CTelRecord;
pTel->SetRecord(szName,szNumber,kind,writer);
pNode=new CNode;
pNode->InputData(pTel);
TelList.AddNode(pNode);
system("cls");
cout<<"\n\t\t ☆请输入书名(输入0结束):";
cin.getline(szName,20);

}
cout<<endl<<endl;
}
void DisplayRecord(CList &TelList)
{ system("cls");
cout<<endl<<setw(15)<<" ☆ 书名 ☆ "<<setw(15)<<"\t☆ 书的编号 ☆"<<setw(15)<<"\t ☆ 书的种类 ☆"<<setw(15)<<"\t ☆ 作者☆ \n"<<endl;
TelList.ShowList();
cout<<endl<<endl;
}

void LookUpRecord(CList &TelList)
{ system("cls");
CNode *pLook;
char szName[20];
cout<<"\n\t\t ☆请输入您想要查找的书名(输入0结束)";
cin.getline(szName,20);
while(strcmp(szName,"0"))
{
CTelRecord tele(szName,"0","0","0");

pLook=TelList.LookUp(tele);
if(pLook)
{
cout<<endl<<"\t\t ※在里面找到的纪录 "<<szName <<",内容是:\n"<<endl;
cout<<endl<<setw(15)<<" ☆ 书名 ☆ "<<setw(15)<<"\t☆ 书的编号 ☆"<<setw(15)<<"\t ☆ 书的种类 ☆"<<setw(15)<<"\t ☆ 作者☆ \n"<<endl;
pLook->ShowNode();
}
else
cout<<"\n\t\t !!!在里面找不到 "<<szName<<" ."<<endl;
system("pause");
system("cls");
cout<<"\n\t\t ☆请输入您想要查找的书名(输入0结束)";
cin.getline(szName,20);
}
cout<<endl<<endl;
}
void DeleteRecord(CList &TelList)
{ system("cls");
CNode *pLook;
char szName[20];
cout<<"\n\t\t△请输入您想要删除的书名(输入0结束)";
cin.getline(szName,20);
while (strcmp(szName,"0"))
{
CTelRecord tele (szName,"0","0","0");
pLook=TelList.LookUp(tele);
if(pLook)
{
cout<<"\n\t\t☆在里面找到的纪录 "<<szName <<",内容是:\n"<<endl;
cout<<endl<<setw(15)<<" ☆ 书名 ☆ "<<setw(15)<<"\t☆ 书的编号 ☆"<<setw(15)<<"\t ☆ 书的种类 ☆"<<setw(15)<<"\t ☆ 作者☆ \n"<<endl;
pLook->ShowNode();
TelList.DeleteNode(pLook);

上一页  [1] [2] [3] [4] [5] [6] 下一页

Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有