数据库课程设计(自己做的)

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

数据库系统课程设计
——货存控制系统
组长:杜康
数据库分析员:郭仙草
用户界面设计员:王彤
程序员:包曙光
胡萍
测试员:李元芳
一、课程设计题目:
货存管理系统
一个公司希望为控制它的货存建立一个数据库,货存中的产品被分为几类,如服装、食品和文具。

当产品需要从供应商那里重新订购时,工作人员需要提出一个购买订单。

跟踪记录要提供买进、卖出的货物以及其他的费用。

实验课程任务与要求
目的与任务:
1. 掌握数据库设计和实现的基本过程
2. 掌握数据库模式设计、分析和实现的方法
3. 了解数据库应用系统软件开发的一般过程。

实验基本要求:
(1)学习相关的预备知识
(2)按照数据库设计与实现过程完成数据库的设计,应用程序的开发,上机调试、运行
(3)写出课程设计报告
开发环境说明:
处理器:Intel Pentium 4 3.06以上
内存:256M以上
硬盘空间:40G以上
操作系统:windows 2000 /XP/win7
开发软件:C++Builder 6.0
数据库:Microsoft SQL Service 2000
二、功能需求分析:
根据系统要求分析,本系统功能如下:
用户管理:添加用户,修改用户密码。

客户管理:添加客户,查询客户信息。

供应商管理:添加供应商,查询供应商信息。

仓库管理:添加仓库,查询仓库信息。

货物管理:添加物品信息,物品类型信息。

入库管理:货物的入库信息的添加和修改。

出库管理:货物的出库信息的添加和修改。

库存信息:对货物的现有信息存量查询。

三、数据库概念设计:
本实例根据根据上面的设计规划出的实体有仓库实体、客户实体、供应商实体、管理员实体、货物实体、货物类型实体、入库实体、出库实体、库存实体。

各个实体的E-R图描述如下:
仓库实体E-R图
供应商实体E-R图
客户实体E-R图
管理员实体E-R图
货物实体E-R图
货物类型实体E-R图
入库实体E-R图
出库实体E-R图
库存实体E-R图整体E-R图如下所示:
四、数据库逻辑设计:
关系数据库的数据模型(即关系模型)由一组关系模式组成,因而ER图向关系模型的转换实际上就是将实体(包括实体的属性)和联系转换为关系模式,一般遵循以下基本原则:
1. 一个实体型转换为一个关系模式。

实体的属性就是关系的属性,实体的码就是关系的码。

2. 一个1:X(X为1或n)联系通常与某一端的关系模式合并,其中1:n的联系需要与n端对应的关系模式合并。

需要在合并的关系模式的属性中加入另一个关系模式的码和联系本身的属性。

3. 一个m:n联系转换为一个关系模式。

与该关系相连的各实体的码以及联系本身的属性均转换为关系的属性,而关系的码为各实体码的组合。

4. 三个或三个以上实体间的一个多元联系可以转换为一个关系模式。

与该多元联系相连的各实体的码以及联系本身的属性均转换为关系的属性,而关系的码为各实体的码的组合。

5. 具有相同码的关系模式可合并。

使用SQL server 2000企业管理器建立数据库和表(也可使用SQL语句建立数据库)。

数据库包括:
1.仓库的数据项描述: Storage
2.供应商的数据项描述:Provider
3.客户的数据项描述:Client
4.货物的数据项描述:Goods
5.货物类型的数据项描述:Type
6.管理员的数据项描述:Manager
7.库存的数据项描述: Stock
8.入库的数据项描述:Stock_In
9.出库的数据项描述:Stock_Out
五、系统开发
1. 数据库建立
Create database storage_manage;
供应商 Provider create table Provider( Pno char(5) primary key, Pname char(20), Padddr char(40), Postcode char(6),
Ptel char(11)
);
客户 Client
create table Client(
Cno char(5) primary key, Cname char(20),
Caddr char(40),
Ctel char(11)
);
货物类型 Type create table Type(
Tno char(5) primary key, Tname char(20), Tdescription char(50) );
货物 Goods
create table Goods(
Gno char(5) primary key,
Gname char(20),
Tno char(5),
foreign key(Tno) references Type(Tno)
);
管理员 Manager create table Manager( Mno char(5) primary key, Mname char(20),
PW char(6)
);
仓库 Storage create table Storage( Sno char(5) primary key, Sname char(20),
Saddr char(40),
Mno char(5),
Ssize int,
foreign key(Mno) references Manager(Mno) );
库存 Stock
create table Stock(
Gno char(5),
Sno char(5),
Gname char(10),
Tname char(20),
primary key(Gno),
foreign key(Gno) references Goods(Gno), foreign key(Sno) references Storage(Sno) );
入库 Stock_In
create table Stock_In(
Gno char(5),
Gname char(10),
Tname char(20),
Ginprice real,
Innum int,
Inprice real,
Indata char(20),
primary key(Gno,Pno),
foreign key(Gno) references Goods(Gno), foreign key(Pno) references Provider(Pno) );
出库 Stock_Out
create table Stock_Out(
Cno char(5),
Gname char(10),
Tname char(20),
Goutprice real,
Outnum int,
Outprice real,
Outdata char(20),
primary key(Gno,Cno),
foreign key(Gno) references Goods(Gno), foreign key(Cno) references Client(Cno) );
2、界面设计
Form1
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("select * from Manager ");
ADOQuery1->SQL->Add("where Mname='"+Edit1->Text+"' and PW='"+Edit2->Text+"'");
if(ADOQuery1->ExecSQL())
{
ShowMessage("登陆成功");
Form2->Show();
}
else
{
ShowMessage("用户名或密码错误!");
}
}
//--------------------------------------------------------------------------- void __fastcall TForm1::Button2Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
Form2
//--------------------------------------------------------------------------- #include <vcl.h>
#pragma hdrstop
#include "Unit2.h"
#include "Unit1.h"
#include "unit3.h"
#include "unit4.h"
#include "Unit5.h"
#include "Unit6.h"
#include "Unit7.h"
#include "Unit8.h"
#include "Unit9.h"
#include "Unit10.h"
#include "Unit11.h"
#include "Unit12.h"
#include "Unit13.h"
#include "Unit14.h"
#include "Unit15.h"
#include "Unit16.h"
//--------------------------------------------------------------------------- #pragma package(smart_init)
#pragma resource "*.dfm"
TForm2 *Form2;
//--------------------------------------------------------------------------- __fastcall TForm2::TForm2(TComponent* Owner)
: TForm(Owner)
{
}
//--------------------------------------------------------------------------- void __fastcall TForm2::N5Click(TObject *Sender)
{
Form3->Show();
Form2->Close();
}
//--------------------------------------------------------------------------- void __fastcall TForm2::N6Click(TObject *Sender)
{
Form4->Show();
Form2->Close();
}
//--------------------------------------------------------------------------- void __fastcall TForm2::N18Click(TObject *Sender)
{
Form1->Show();
Form2->Close();
}
//--------------------------------------------------------------------------- void __fastcall TForm2::N8Click(TObject *Sender)
{
Form6->Show();
Form2->Close();
}
//--------------------------------------------------------------------------- void __fastcall TForm2::N7Click(TObject *Sender)
{
Form5->Show();
Form2->Close();
}
//--------------------------------------------------------------------------- void __fastcall TForm2::N12Click(TObject *Sender)
{
Form10->Show();
Form2->Close();
}
//--------------------------------------------------------------------------- void __fastcall TForm2::N9Click(TObject *Sender)
{
Form7->Show();
Form2->Close();
}
//-------------------------------------------------------------------------- void __fastcall TForm2::N10Click(TObject *Sender)
{
Form8->Show();
Form2->Close();
}
//--------------------------------------------------------------------------- void __fastcall TForm2::N16Click(TObject *Sender)
{
Form9->Show();
Form2->Close();
}
//--------------------------------------------------------------------------- void __fastcall TForm2::N13Click(TObject *Sender)
{
Form12->Show();
Form2->Close();
}
//--------------------------------------------------------------------------- void __fastcall TForm2::N14Click(TObject *Sender)
{
Form11->Show();
Form2->Close();
}
//--------------------------------------------------------------------------- void __fastcall TForm2::N15Click(TObject *Sender)
{
Form14->Show();
Form2->Close();
}
void __fastcall TForm2::N11Click(TObject *Sender)
{
Form9->Show();
Form2->Close();
}
//--------------------------------------------------------------------------- void __fastcall TForm2::N17Click(TObject *Sender)
{
Form15->Show();
Form2->Close();
}
//--------------------------------------------------------------------------- void __fastcall TForm2::N19Click(TObject *Sender)
{
Form16->Show();
Form2->Close();
}
//---------------------------------------------------------------------------
Form3
//--------------------------------------------------------------------------- #include <vcl.h>
#pragma hdrstop
#include "Unit3.h"
#include "Unit2.h"
//--------------------------------------------------------------------------- #pragma package(smart_init)
#pragma resource "*.dfm"
TForm3 *Form3;
__fastcall TForm3::TForm3(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Button1Click(TObject *Sender)
{Form3->ADOTable1->Active=true;
Form3->ADOTable1->Append();
Form3->ADOTable1->FieldByName("Cno")->AsString=Edit1->Text; Form3->ADOTable1->FieldByName("Cname")->AsString=Edit2->Text; Form3->ADOTable1->FieldByName("Caddr")->AsString=Edit3->Text; Form3->ADOTable1->FieldByName("Ctel")->AsString=Edit4->Text; Form3->ADOTable1->Post();
ShowMessage("录入成功!");
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Button2Click(TObject *Sender)
{
Edit1->Text=' ';
Edit2->Text=' ';
Edit3->Text=' ';
Edit4->Text=' ';
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Button3Click(TObject *Sender)
{
Form2->Show();
Form3->Close();
}
//---------------------------------------------------------------------------
Form4
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit4.h"
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm4 *Form4;
//---------------------------------------------------------------------------
__fastcall TForm4::TForm4(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Button1Click(TObject *Sender)
{
ADOQuery1->Active=false;
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("Select * From Client");
ADOQuery1->SQL->Add("Where Cno like '"+Edit1->Text+"%'"); ADOQuery1->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Button2Click(TObject *Sender)
{
ADOQuery1->Active=false;
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("Select * From Client");
ADOQuery1->SQL->Add("Where Cname like '"+Edit2->Text+"%'"); ADOQuery1->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Button3Click(TObject *Sender)
{
Form2->Show();
Form4->Close();
}
//---------------------------------------------------------------------------
From5
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit5.h"
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm5 *Form5;
//---------------------------------------------------------------------------
__fastcall TForm5::TForm5(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm5::Button1Click(TObject *Sender)
{
Form5->ADOTable1->Active=true;
Form5->ADOTable1->Append();
Form5->ADOTable1->FieldByName("Pno")->AsString=Edit1->Text;
Form5->ADOTable1->FieldByName("Pname")->AsString=Edit2->Text; Form5->ADOTable1->FieldByName("Paddr")->AsString=Edit3->Text; Form5->ADOTable1->FieldByName("Postcode")->AsString=Edit3->Text; Form5->ADOTable1->FieldByName("Ptel")->AsString=Edit5->Text; Form5->ADOTable1->FieldByName("Prep")->AsString=Edit6->Text; Form5->ADOTable1->Post();
ShowMessage("录入成功!");
}
//---------------------------------------------------------------------------
void __fastcall TForm5::Button2Click(TObject *Sender)
{
Edit1->Text=' ';
Edit2->Text=' ';
Edit3->Text=' ';
Edit4->Text=' ';
Edit5->Text=' ';
Edit6->Text=' ';
}
//---------------------------------------------------------------------------
void __fastcall TForm5::Button3Click(TObject *Sender)
{
Form2->Show();
Form5->Close();
}
//---------------------------------------------------------------------------
Form6
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit6.h"
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm6 *Form6;
//---------------------------------------------------------------------------
__fastcall TForm6::TForm6(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm6::Button1Click(TObject *Sender)
{
ADOQuery1->Active=false;
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("Select * From Provider");
ADOQuery1->SQL->Add("Where Pno like '"+Edit1->Text+"%'"); ADOQuery1->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm6::Button2Click(TObject *Sender)
{
ADOQuery1->Active=false;
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("Select * From Provider");
ADOQuery1->SQL->Add("Where Pname like '"+Edit2->Text+"%'"); ADOQuery1->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm6::Button3Click(TObject *Sender)
{
Form2->Show();
Form6->Close();
}
//---------------------------------------------------------------------------
Form7
//--------------------------------------------------------------------------- #include <vcl.h>
#pragma hdrstop
#include "Unit7.h"
#include "Unit2.h"
//--------------------------------------------------------------------------- #pragma package(smart_init)
#pragma resource "*.dfm"
TForm7 *Form7;
//--------------------------------------------------------------------------- __fastcall TForm7::TForm7(TComponent* Owner)
: TForm(Owner)
{
}
//--------------------------------------------------------------------------- void __fastcall TForm7::Button2Click(TObject *Sender)
{
Edit1->Text=' ';
Edit2->Text=' ';
Edit3->Text=' ';
Edit5->Text=' ';
}
//---------------------------------------------------------------------------
void __fastcall TForm7::Button3Click(TObject *Sender)
{
Form2->Show();
Form7->Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm7::Button1Click(TObject *Sender)
{
Form7->ADOTable1->Active=true;
Form7->ADOTable1->Append();
Form7->ADOTable1->FieldByName("Sno")->AsString=Edit1->Text;
Form7->ADOTable1->FieldByName("Sname")->AsString=Edit2->Text;
Form7->ADOTable1->FieldByName("Saddr")->AsString=Edit3->Text;
Form7->ADOTable1->FieldByName("Mno")->AsString=DBComboBox1->Text; Form7->ADOTable1->FieldByName("Ssize")->AsString=Edit5->Text;
Form7->ADOTable1->Post();
ShowMessage("录入成功!");
}
//---------------------------------------------------------------------------
Form8
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit8.h"
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm8 *Form8;
//---------------------------------------------------------------------------
__fastcall TForm8::TForm8(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm8::Button1Click(TObject *Sender)
{
ADOQuery1->Active=false;
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("Select * From Storage");
ADOQuery1->SQL->Add("Where Sno like '"+Edit1->Text+"%'"); ADOQuery1->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm8::Button2Click(TObject *Sender)
{
ADOQuery1->Active=false;
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("Select * From Storage");
ADOQuery1->SQL->Add("Where Sname like '"+Edit2->Text+"%'"); ADOQuery1->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm8::Button3Click(TObject *Sender)
{
Form2->Show();
Form8->Close();
}
//---------------------------------------------------------------------------
Form9
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit9.h"
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm9 *Form9;
//---------------------------------------------------------------------------
__fastcall TForm9::TForm9(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm9::Button1Click(TObject *Sender)
{
Form9->ADOTable1->Active=true;
Form9->ADOTable1->Append();
Form9->ADOTable1->FieldByName("Gno")->AsString=Edit1->Text; Form9->ADOTable1->FieldByName("Gname")->AsString=Edit2->Text; Form9->ADOTable1->FieldByName("Tno")->AsString=Edit3->Text; Form9->ADOTable1->Post();
ShowMessage("录入成功!");
}
//--------------------------------------------------------------------------- void __fastcall TForm9::Button2Click(TObject *Sender)
{
Edit1->Text=' ';
Edit2->Text=' ';
Edit3->Text=' ';
}
//--------------------------------------------------------------------------- void __fastcall TForm9::Button3Click(TObject *Sender)
{
Form2->Show();
Form9->Close();
}
//--------------------------------------------------------------------
Form10
//--------------------------------------------------------------------------- #include <vcl.h>
#pragma hdrstop
#include "Unit10.h"
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm10 *Form10;
//---------------------------------------------------------------------------
__fastcall TForm10::TForm10(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm10::Button1Click(TObject *Sender)
{ double a=Edit5->Text.ToDouble();
int b=Edit6->Text.ToInt();
double c=a*b;
Form10->ADOTable1->Active=true;
Form10->ADOTable1->Append();
Form10->ADOTable1->FieldByName("Gno")->AsString=DBComboBox1->Text; Form10->ADOTable1->FieldByName("Pno")->AsString=DBComboBox2->Text; Form10->ADOTable1->FieldByName("Gname")->AsString=Edit3->Text;
Form10->ADOTable1->FieldByName("Tname")->AsString=Edit4->Text;
Form10->ADOTable1->FieldByName("Ginprice")->AsString=Edit5->Text.ToDouble(); Form10->ADOTable1->FieldByName("Innum")->AsString=Edit6->Text.ToInt(); Form10->ADOTable1->FieldByName("Inprice")->AsString=c;
Form10->ADOTable1->FieldByName("Indate")->AsString=Edit8->Text;
Form10->ADOTable1->Post();
ShowMessage("录入成功!");
ADOQuery1->Active=false;
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("update Stock");
ADOQuery1->SQL->Add("set Gnum=Gnum+'"+Edit6->Text+"'");
ADOQuery1->SQL->Add("where Gno='"+DBComboBox1->Text+"'");
ADOQuery1->ExecSQL();
}
//---------------------------------------------------------------------------
void __fastcall TForm10::Button2Click(TObject *Sender)
{
Edit3->Text=' ';
Edit4->Text=' ';
Edit5->Text=' ';
Edit6->Text=' ';
Edit8->Text=' ';
}
//--------------------------------------------------------------------------- void __fastcall TForm10::Button3Click(TObject *Sender) {
Form2->Show();
Form10->Close();
}
//---------------------------------------------------------------------------
Form11
//--------------------------------------------------------------------------- #include <vcl.h>
#pragma hdrstop
#include "Unit11.h"
#include "Unit2.h"
//--------------------------------------------------------------------------- #pragma package(smart_init)
#pragma resource "*.dfm"
TForm11 *Form11;
//--------------------------------------------------------------------------- __fastcall TForm11::TForm11(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm11::Button1Click(TObject *Sender)
{
ADOQuery1->Active=false;
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("Select * From Stock");
ADOQuery1->SQL->Add("Where Gno like '"+Edit1->Text+"%'"); ADOQuery1->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm11::Button2Click(TObject *Sender)
{
ADOQuery1->Active=false;
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("Select * From Stock");
ADOQuery1->SQL->Add("Where Gname like '"+Edit2->Text+"%'"); ADOQuery1->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm11::Button3Click(TObject *Sender)
{
Form2->Show();
Form11->Close();
}
//---------------------------------------------------------------------------
Form12
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit12.h"
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm12 *Form12;
//---------------------------------------------------------------------------
__fastcall TForm12::TForm12(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm12::Button1Click(TObject *Sender)
{
double a=Edit5->Text.ToDouble();
int b=Edit6->Text.ToInt();
double c=a*b;
Form12->ADOTable1->Active=true;
Form12->ADOTable1->Append();
Form12->ADOTable1->FieldByName("Gno")->AsString=DBComboBox1->Text; Form12->ADOTable1->FieldByName("Cno")->AsString=DBComboBox2->Text; Form12->ADOTable1->FieldByName("Gname")->AsString=Edit3->Text;
Form12->ADOTable1->FieldByName("Tname")->AsString=Edit4->Text;
Form12->ADOTable1->FieldByName("Goutprice")->AsString=Edit5->Text.ToDouble(); Form12->ADOTable1->FieldByName("Outnum")->AsString=Edit6->Text.ToInt(); Form12->ADOTable1->FieldByName("Outprice")->AsString=c;
Form12->ADOTable1->FieldByName("Outdate")->AsString=Edit8->Text;
Form12->ADOTable1->Post();
ShowMessage("录入成功!");
ADOQuery1->Active=false;
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("update Stock");
ADOQuery1->SQL->Add("set Gnum=Gnum-'"+Edit6->Text+"'");
ADOQuery1->SQL->Add("where Gno='"+DBComboBox1->Text+"'");
ADOQuery1->ExecSQL();
}
//---------------------------------------------------------------------------
void __fastcall TForm12::Button2Click(TObject *Sender)
{
Edit3->Text=' ';
Edit4->Text=' ';
Edit5->Text=' ';
Edit6->Text=' ';
Edit8->Text=' ';
}
//--------------------------------------------------------------------------- void __fastcall TForm12::Button3Click(TObject *Sender) {
Form2->Show();
Form12->Close();
}
//---------------------------------------------------------------------------
Form14
//--------------------------------------------------------------------------- #include <vcl.h>
#pragma hdrstop
#include "Unit14.h"
#include "Unit2.h"
//--------------------------------------------------------------------------- #pragma package(smart_init)
#pragma resource "*.dfm"
TForm14 *Form14;
//--------------------------------------------------------------------------- __fastcall TForm14::TForm14(TComponent* Owner)
: TForm(Owner)
{
}
//--------------------------------------------------------------------------- void __fastcall TForm14::Button1Click(TObject *Sender) {Form2->Show();
Form14->Close();
}
//--------------------------------------------------------------------------
Form15
//--------------------------------------------------------------------------- #include <vcl.h>
#pragma hdrstop
#include "Unit15.h"
#include "Unit2.h"
//--------------------------------------------------------------------------- #pragma package(smart_init)
#pragma resource "*.dfm"
TForm15 *Form15;
//--------------------------------------------------------------------------- __fastcall TForm15::TForm15(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm15::Button4Click(TObject *Sender)
{
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("select * from Manager ");
ADOQuery1->SQL->Add("where Mname='dba' and PW='"+Edit5->Text+"'");
if(ADOQuery1->ExecSQL())
{
ShowMessage("密码正确!");
Label1->Visible=true;
Label2->Visible=true;
Label3->Visible=true;
Edit1->Visible=true;
Edit2->Visible=true;
Edit3->Visible=true;
Button1->Visible=true;
Button2->Visible=true;
Button3->Visible=true;
}
else
{
ShowMessage("用户名或密码错误,请重置或退出!");
}
}
//---------------------------------------------------------------------------
void __fastcall TForm15::Button5Click(TObject *Sender)
{
Form2->Show();
Form15->Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm15::Button1Click(TObject *Sender)
{
Form15->ADOTable1->Active=true;
Form15->ADOTable1->Append();
Form15->ADOTable1->FieldByName("Mno")->AsString=Edit1->Text;
Form15->ADOTable1->FieldByName("Mname")->AsString=Edit2->Text;
Form15->ADOTable1->FieldByName("PW")->AsString=Edit3->Text;
Form15->ADOTable1->Post();
ShowMessage("录入成功!");
}
//---------------------------------------------------------------------------。

相关文档
最新文档