C++人事管理系统源代码及设计 第3页
void __fastcall TFmain::SpeedButton3Click(TObject *Sender)
{
DataModule3->ADOQuery1->First() ;
StatusBar1->Panels->Items[0]->Text="数据指向第一个";
}
void __fastcall TFmain::SpeedButton1Click(TObject *Sender)
{
DataModule3->ADOQuery1->Prior() ;
StatusBar1->Panels->Items[0]->Text="数据指向上一个";
}
void __fastcall TFmain::SpeedButton2Click(TObject *Sender)
{
DataModule3->ADOQuery1->Next() ;
StatusBar1->Panels->Items[0]->Text="数据指向下一个";
}
void __fastcall TFmain::SpeedButton4Click(TObject *Sender)
{
DataModule3->ADOQuery1->Last() ;
StatusBar1->Panels->Items[0]->Text="数据指向最后";
}
void __fastcall TFmain::Button2Click(TObject *Sender)
{
//添加新的数据
Fadd->Caption="添加数据";
DataModule3->ADOQuery1->Append() ;
Fadd->ShowModal() ;
}
void __fastcall TFmain::FormClose(TObject *Sender, TCloseAction &Action)
{
//对退出程序做确认处理
if(MessageBox(this->Handle,"确定要退出吗?","提示",MB_YESNO+MB_ICONQUESTION) == IDNO)
Action=caNone;
}
void __fastcall TFmain::N10Click(TObject *Sender)
{
AboutBox->ShowModal() ; //显示关于对话框
}
void __fastcall TFmain::Button4Click(TObject *Sender)
{
//以下为查找语句
AnsiString sql;
if(Edit1->Text=="")return;
if( ComboBox1->Text =="精确")sql=" ='"+Edit1->Text+"';";
else sql=" like '%"+Edit1->Text+"%';";
sql="select * from renshi where "+ComboBox2->Text+sql;
StatusBar1->Panels->Items[0]->Text=sql;
DataModule3->ADOQuery1->Active =false;
DataModule3->ADOQuery1->SQL->Clear();
DataModule3->ADOQuery1->SQL->Add(sql);
DataModule3->ADOQuery1->Active =true;
if(DataModule3->ADOQuery1->RecordCount==0)
StatusBar1->Panels->Items[1]->Text="无符合条件数据";
else StatusBar1->Panels->Items[1]->Text="符合条件数据个数为:"+IntToStr(DataModule3->ADOQuery1 www.751com.cn
void __fastcall TFmain::Button6Click(TObject *Sender)
{
//以下为显示所有数据
AnsiString sql;
sql="select * from renshi;";
StatusBar1->Panels->Items[0]->Text="显示全部数据";
DataModule3->ADOQuery1->Active =false;
DataModule3->ADOQuery1->SQL->Clear();
DataModule3->ADOQuery1->SQL->Add(sql);
DataModule3->ADOQuery1->Active =true;
if(DataModule3->ADOQuery1->RecordCount==0)
StatusBar1->Panels->Items[1]->Text="无符合条件数据";
else StatusBar1->Panels->Items[1]->Text="数据总量为:"+IntToStr(DataModule3->ADOQuery1->RecordCount);
}
void __fastcall TFmain::Button1Click(TObject *Sender)
{
//刷新显示
DataModule3->ADOQuery1->Active =false;
DataModule3->ADOQuery1->Active =true;
}
void __fastcall TFmain::N9Click(TObject *Sender)
{
//帮助内容
ShowMessage("\
大家好,虽然只是一个简单的程序但是也要写帮助。\n\
简单的操作如下:\n\
一、打开程序。\n\
二、可以进行数据的添加、删除、浏览、查找\n\
三、关闭。\n\
谢谢使用!\n\");
上一页 [1] [2] [3] [4] 下一页
C++人事管理系统源代码及设计 第3页下载如图片无法显示或论文不完整,请联系qq752018766