📄 qrygkset.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "qrygkset.h"
#include "dm.h"
#include "querygk.h"
#include "main.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "KsSkinForms"
#pragma link "se_controls"
#pragma link "KsSkinButtons"
#pragma link "KsSkinCheckBoxs"
#pragma link "KsSkinComboBoxs"
#pragma link "KsSkinEdits"
#pragma link "KsSkinGroupBoxs"
#pragma link "KsSkinPanels"
#pragma resource "*.dfm"
TForm11 *Form11;
AnsiString tj1,tj2,tj3,tj4,fstr;
//---------------------------------------------------------------------------
__fastcall TForm11::TForm11(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm11::FormActivate(TObject *Sender)
{
tj1="";
tj2="";
tj3="";
tj4="";
}
//---------------------------------------------------------------------------
void __fastcall TForm11::Button1Click(TObject *Sender)
{
if(CheckBox1->Checked&&ComboBox1->Text.operator !=(""))
tj1="间隔='"+ComboBox1->Text+"*'";
else
tj1="";
if(CheckBox2->Checked&&ComboBox2->Text.operator !=(""))
tj2="专业='"+ComboBox2->Text+"*'";
else
tj2="";
if(CheckBox3->Checked&&Edit1->Text.operator !=(""))
tj3="区域='"+Edit1->Text+"*'";
else
tj3="";
if(CheckBox4->Checked&&Edit2->Text.operator !=(""))
tj4="卡号='"+Edit2->Text+"*'";
else
tj4="";
DataModule1->gk90->Filtered=false;
if(tj1!=""&&(tj2!=""||tj3!=""||tj4!=""))
tj1+=" AND ";
if(tj2!=""&&(tj3!=""||tj4!=""))
tj2+=" AND ";
if(tj3!=""&&tj4!="")
tj3+=" AND ";
fstr=tj1+tj2+tj3+tj4;
DataModule1->gk90->Filter=fstr;
DataModule1->gk90->Filtered=true;
TForm10* Form10=new TForm10(this);
if(Form10->DBGrid1->DataSource!=DataModule1->work90)
Form10->DBGrid1->DataSource=DataModule1->work90;
Form10->Caption="满足查询条件:"+fstr+"的工卡清单";
if(!Form10->Showing)
Form10->ShowModal();
CheckBox1->Checked=false;
CheckBox2->Checked=false;
CheckBox3->Checked=false;
CheckBox4->Checked=false;
ComboBox1->Text="";
ComboBox2->Text="";
Edit1->Text="";
Edit2->Text="";
tj1=tj2=tj3=tj4=fstr="";
delete Form10;
}
//---------------------------------------------------------------------------
void __fastcall TForm11::Button2Click(TObject *Sender)
{
CheckBox1->Checked=false;
CheckBox2->Checked=false;
CheckBox3->Checked=false;
CheckBox4->Checked=false;
ComboBox1->Text="";
ComboBox2->Text="";
Edit1->Text="";
Edit2->Text="";
tj1=tj2=tj3=tj4=fstr="";
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm11::CheckBox3Click(TObject *Sender)
{
Edit1->SetFocus();
}
//---------------------------------------------------------------------------
void __fastcall TForm11::CheckBox4Click(TObject *Sender)
{
Edit2->SetFocus();
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -