📄 gczled.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "gczled.h"
#include "dm.h"
#include "jhselect.h"
#include "Ubcxtj.h"
#include "main.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "KsSkinButtons"
#pragma link "KsSkinForms"
#pragma link "KsSkinLabels"
#pragma link "KsSkinPanels"
#pragma link "se_controls"
#pragma link "KsSkinDBGrids"
#pragma resource "*.dfm"
TForm52 *Form52;
extern AnsiString lujing;
AnsiString jhstr[20];
AnsiString zlbhtmp,zllytmp,mctmp,xfrqtmp,ywrqtmp,xhtmp,dhrqtmp,yqrqtmp,swrqtmp,smtmp,ldtmp,fhtmp,jxtmp;
bool bianji;
extern TDataSet* cxb;
//---------------------------------------------------------------------------
__fastcall TForm52::TForm52(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm52::xfrqdpChange(TObject *Sender)
{
xfrq->Text=DateToStr(xfrqdp->Date);
}
//---------------------------------------------------------------------------
void __fastcall TForm52::ywrqdpChange(TObject *Sender)
{
ywrq->Text=DateToStr(ywrqdp->Date);
}
//---------------------------------------------------------------------------
void __fastcall TForm52::dhrqdpChange(TObject *Sender)
{
dhrq->Text=DateToStr(dhrqdp->Date);
}
//---------------------------------------------------------------------------
void __fastcall TForm52::swrqdpChange(TObject *Sender)
{
swrq->Text=DateToStr(swrqdp->Date);
}
//---------------------------------------------------------------------------
void __fastcall TForm52::yqrqdpChange(TObject *Sender)
{
yqrq->Text=DateToStr(yqrqdp->Date);
}
//---------------------------------------------------------------------------
void __fastcall TForm52::FormCreate(TObject *Sender)
{
jhcm->Items->LoadFromFile(lujing+"plane.txt");
bianji=false;
}
//---------------------------------------------------------------------------
void __fastcall TForm52::Button3Click(TObject *Sender)
{
jhcm->Enabled=true;
bianji=true;
Button4->Enabled=true;
}
//---------------------------------------------------------------------------
void __fastcall TForm52::Button4Click(TObject *Sender)
{
jhcm->Enabled=false;
if(!jhcm->Visible)
jhcm->Visible=true;
if(jhxzbtn->Visible)
{
jhxzbtn->Visible=false;
zlbhtmp=DBEdit1->Text;
zllytmp=DBEdit2->Text;
mctmp=DBEdit3->Text;
ywrqtmp=ywrq->Text;
xfrqtmp=xfrq->Text;
dhrqtmp=dhrq->Text;
swrqtmp=swrq->Text;
xhtmp=DBEdit7->Text;
jxtmp=DBComboBox1->Text;
ldtmp=DBEdit4->Text;
yqrqtmp=yqrq->Text;
smtmp=DBEdit6->Text;
fhtmp=DBEdit5->Text;
for(int i=0;i<jhcm->Items->Count;i++)
{
if(jhstr[i]!="")
{
if(zlbhtmp!="")
DataModule1->gczlzlbh->AsString=zlbhtmp;
if(zllytmp!="")
DataModule1->gczlzlly->AsString=zllytmp;
if(mctmp!="")
DataModule1->gczlmc->AsString=mctmp;
if(ywrqtmp!="")
DataModule1->gczlywrq->AsDateTime=StrToDate(ywrqtmp);
if(xfrqtmp!="")
DataModule1->gczlxfrq->AsDateTime=StrToDate(xfrqtmp);
if(dhrqtmp!="")
DataModule1->gczldhrq->AsDateTime=StrToDate(dhrqtmp);
DataModule1->gczljh->AsString=jhstr[i];
if(swrqtmp!="")
DataModule1->gczlswrq->AsDateTime=StrToDate(swrqtmp);
if(xhtmp!="")
DataModule1->gczlxh->AsString=xhtmp;
if(jxtmp!="")
DataModule1->gczljx->AsString=jxtmp;
if(ldtmp!="")
DataModule1->gczlzt->AsString=ldtmp;
if(yqrqtmp!="")
DataModule1->gczlyqrq->AsDateTime=StrToDate(yqrqtmp);
if(smtmp!="")
DataModule1->gczlsm->AsString=smtmp;
if(fhtmp!="")
DataModule1->gczlfh->AsInteger=StrToInt(fhtmp);
DataModule1->gczl->Post();
DataModule1->gczl->Append();
}
}
DataModule1->gczl->Cancel();
}
if(bianji)
{
jhxzbtn->Visible=false;
zlbhtmp=DBEdit1->Text;
zllytmp=DBEdit2->Text;
mctmp=DBEdit3->Text;
ywrqtmp=ywrq->Text;
xfrqtmp=xfrq->Text;
dhrqtmp=dhrq->Text;
swrqtmp=swrq->Text;
xhtmp=DBEdit7->Text;
jxtmp=DBComboBox1->Text;
ldtmp=DBEdit4->Text;
yqrqtmp=yqrq->Text;
smtmp=DBEdit6->Text;
fhtmp=DBEdit5->Text;
DataModule1->gczl->Edit();
if(jhcm->Text!="")
DataModule1->gczljh->AsString=jhcm->Text;
if(zlbhtmp!="")
DataModule1->gczlzlbh->AsString=zlbhtmp;
if(zllytmp!="")
DataModule1->gczlzlly->AsString=zllytmp;
if(mctmp!="")
DataModule1->gczlmc->AsString=mctmp;
if(ywrqtmp!="")
DataModule1->gczlywrq->AsDateTime=StrToDate(ywrqtmp);
if(xfrqtmp!="")
DataModule1->gczlxfrq->AsDateTime=StrToDate(xfrqtmp);
if(dhrqtmp!="")
DataModule1->gczldhrq->AsDateTime=StrToDate(dhrqtmp);
// DataModule1->gczljh->AsString=jhstr[i];
if(swrqtmp!="")
DataModule1->gczlswrq->AsDateTime=StrToDate(swrqtmp);
if(xhtmp!="")
DataModule1->gczlxh->AsString=xhtmp;
if(jxtmp!="")
DataModule1->gczljx->AsString=jxtmp;
if(ldtmp!="")
DataModule1->gczlzt->AsString=ldtmp;
if(yqrqtmp!="")
DataModule1->gczlyqrq->AsDateTime=StrToDate(yqrqtmp);
if(smtmp!="")
DataModule1->gczlsm->AsString=smtmp;
if(fhtmp!="")
DataModule1->gczlfh->AsInteger=StrToInt(fhtmp);
DataModule1->gczl->Post();
bianji=false;
}
Button4->Enabled=false;
}
//---------------------------------------------------------------------------
void __fastcall TForm52::Button5Click(TObject *Sender)
{
jhcm->Enabled=false;
if(!jhcm->Visible)
jhcm->Visible=true;
if(jhxzbtn->Visible)
{
jhxzbtn->Visible=false;
}
DataModule1->gczl->Cancel();
}
//---------------------------------------------------------------------------
void __fastcall TForm52::Button1Click(TObject *Sender)
{
jhxzbtn->Visible=true;
jhcm->Visible=false;
Button4->Enabled=true;
DataModule1->gczl->Append();
}
//---------------------------------------------------------------------------
void __fastcall TForm52::jhxzbtnClick(TObject *Sender)
{
TForm56* f56=new TForm56(this);
TCheckBox* jh[20];
for(int i=0;i<jhcm->Items->Count;i++)
{
jh[i]=new TCheckBox(f56->Handle);
jh[i]->Caption=jhcm->Items->Strings[i];
jh[i]->Parent= f56;
jh[i]->Left=30+i%2*120;
jh[i]->Top=10+int(i/2)*20;
}
f56->ShowModal();
for(int i=0;i<jhcm->Items->Count;i++)
{
if(jh[i]->Checked)
jhstr[i]=jh[i]->Caption;
else
jhstr[i]="";
}
delete f56;
}
//---------------------------------------------------------------------------
void __fastcall TForm52::Button6Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm52::Button2Click(TObject *Sender)
{
DataModule1->gczl->Delete();
}
//---------------------------------------------------------------------------
void __fastcall TForm52::Button7Click(TObject *Sender)
{
cxb=DataModule1->gczl;
FBcxtj->Show();
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -