📄 main.~cpp
字号:
jieguo=CopyFile(source.c_str(),destfile.c_str(),false);
source=lujing+"bzcsjtj.cds";
destfile=dest+"bzcsjtj.cds";
DeleteFile(destfile.c_str());
jieguo=CopyFile(source.c_str(),destfile.c_str(),false);
source=lujing+"jihua.cds";
destfile=dest+"jihua.cds";
DeleteFile(destfile.c_str());
jieguo=CopyFile(source.c_str(),destfile.c_str(),false);
source=lujing+"gczl.cds";
destfile=dest+"gczl.cds";
DeleteFile(destfile.c_str());
jieguo=CopyFile(source.c_str(),destfile.c_str(),false);
Form1->Cursor<<crDefault;
}
__finally
{
if(jieguo)
M1->ShowMessage("数据备份完毕!");
else
M1->ShowMessage("数据备份失败,请确认目录"+dest+"是否存在。");
}
}
else
M1->ShowMessage("对不起,你没有权限。");
}
//---------------------------------------------------------------------------
void __fastcall TForm1::MD821_oldClick(TObject *Sender)
{
pass=0;
TForm23 *Form23=new TForm23(Application);
Form23->ShowModal();
delete Form23;
DataModule1->hours->ReadOnly=!edit;
Form27->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N38_oldClick(TObject *Sender)
{
TForm28 *Form28=new TForm28(Application);
Form28->ShowModal();
if(Form28->ModalResult==mrOk)
{
shurufa=Form28->ComboBox1->Text;
danwei=Form28->danwei->Text;
const String RegKey="SOFTWARE\\sckglxt\\setup";
TRegIniFile* RegFile=new TRegIniFile(RegKey);
RegFile->WriteString("ime","chime",shurufa);
RegFile->WriteString("dw","repdw",danwei);
delete RegFile;
}
delete Form28;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::MD822_oldClick(TObject *Sender)
{
if(M1->MessageDlg("是否要保存为电子表格? ",mtConfirmation, TMsgDlgButtons() << mbYes<<mbNo, 0)==mrNo)
{TForm32* Form32=new TForm32(Application);
Form32->title->Caption="MD82飞机小时卡、起落卡清单";
Form32->QuickRep1->Preview();
delete Form32;
}
else
{
TForm24 *f24=new TForm24(this);
f24->ADT=DataModule1->hours;
f24->ShowModal();
delete f24;
}
}
//---------------------------------------------------------------------------
void TForm1::fhhourctrl()
{ controlnum=0;
AnsiString jixing;
AnsiString lastjihao;
int jiashu=memo->Lines->Count;
for(int jia=0;jia<jiashu;jia++)
{ fhjihao[controlnum]=memo->Lines->Strings[jia];
if(StrToInt(fhjihao[controlnum])>2200)
jixing="MD90";
else
jixing="MD82";
AnsiString printtj="";
DataModule1->tiaojian->Filtered=false;
DataModule1->tiaojian->Filter="定检名称 <> 'A' AND 定检名称 <> 'C' AND 机型 = '"+jixing+"'";
DataModule1->tiaojian->Filtered=true;
int tjcount=DataModule1->tiaojian->RecordCount;
DataModule1->tiaojian->First();
for(int i=0;i<tjcount;i++)
{
AnsiString leixing,jiange,wucha,tixing;
leixing=DataModule1->tiaojianField->AsString;
jiange=DataModule1->tiaojianField2->AsString;
wucha=DataModule1->tiaojianField3->AsString;
tixing=DataModule1->tiaojianField4->AsString;
if(jiange=="")
jiange="0";
if(wucha=="")
wucha="0";
if(tixing=="")
tixing="0";
DataModule1->md82ctrl->Filtered=false;
DataModule1->md82ctrl->Filter="机号 = '"+fhjihao[controlnum]+
"' AND 类型 = '"+leixing+"' AND 间隔 = '"+jiange+"' AND 备注 = '新'";
DataModule1->md82ctrl->Filtered=true;
if(DataModule1->md82ctrl->RecordCount==0)
{
DataModule1->tiaojian->Next();
continue;
}
DataModule1->md82ctrl->Last();
int leijicishu=DataModule1->md82cishu->AsInteger;
int shangcishijian=DataModule1->md82shangcishijian->AsInteger;
DataModule1->dayreport->IndexFieldNames="机身总";
DataModule1->dayreport->Filtered=false;
DataModule1->dayreport->Filter="机号 = '"+fhjihao[controlnum]+"'";
DataModule1->dayreport->Filtered=true;
if(DataModule1->dayreport->RecordCount==0)
{
DataModule1->tiaojian->Next();
continue;
}
DataModule1->dayreport->Last();
int dangqian=0;
if(leixing=="FH")
dangqian=DataModule1->dayreportField4->AsInteger/60;
if(leixing=="LD")
dangqian=DataModule1->dayreportField10->AsInteger;
if(leixing=="M" ||leixing=="D")
{
dangqian=Now();
}
if (dangqian==0)
{
DataModule1->tiaojian->Next();
continue;
}
if(leixing=="M")
{
if((StrToInt(jiange)*30-(dangqian-shangcishijian))<=StrToInt(wucha))
{
fhcolor[controlnum]=clRed;
fhjiange[controlnum]=StrToInt(jiange)*30;
fhqidian[controlnum]=shangcishijian;
fhleixing[controlnum]=leixing;
fhcishu[controlnum]=leijicishu;
lastjihao=fhjihao[controlnum];
fhdangqian[controlnum]=dangqian;
controlnum++;
fhjihao[controlnum]=lastjihao;
DataModule1->tiaojian->Next();
continue;
}
else if((StrToInt(jiange)*30-(dangqian-shangcishijian))<=StrToInt(tixing))
{
fhcolor[controlnum]=clYellow;
fhjiange[controlnum]=StrToInt(jiange)*30;
fhqidian[controlnum]=shangcishijian;
fhleixing[controlnum]=leixing;
fhdangqian[controlnum]=dangqian;
fhcishu[controlnum]=leijicishu;
lastjihao=fhjihao[controlnum];
controlnum++;
fhjihao[controlnum]=lastjihao;
DataModule1->tiaojian->Next();
continue;
}
}
else
{
if((StrToInt(jiange)-(dangqian-shangcishijian))<=StrToInt(wucha))
{
fhcolor[controlnum]=clYellow;
fhjiange[controlnum]=StrToInt(jiange);
fhqidian[controlnum]=shangcishijian;
fhleixing[controlnum]=leixing;
fhdangqian[controlnum]=dangqian;
fhcishu[controlnum]=leijicishu;
lastjihao=fhjihao[controlnum];
controlnum++;
fhjihao[controlnum]=lastjihao;
}
else if((StrToInt(jiange)-(dangqian-shangcishijian))<=StrToInt(tixing))
{
fhcolor[controlnum]=clRed;
fhjiange[controlnum]=StrToInt(jiange);
fhqidian[controlnum]=shangcishijian;
fhleixing[controlnum]=leixing;
fhcishu[controlnum]=leijicishu;
fhdangqian[controlnum]=dangqian;
lastjihao=fhjihao[controlnum];
controlnum++;
fhjihao[controlnum]=lastjihao;
}
}
DataModule1->tiaojian->Next();
}
}
AnsiString tx="目前共有"+IntToStr(controlnum)+"个小时卡或起落卡等监控卡已超提醒时间,是否察看监控窗?";
if(Application->MessageBox(tx.c_str(),"生产科管理系统",MB_OKCANCEL)==IDOK)
Form31->Show();
}
void __fastcall TForm1::N39_oldClick(TObject *Sender)
{
if (N39->Checked)
{
N39->Checked=0;
Form31->Close();
}
else
{ N39->Checked=-1;
Form31->Show();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N42_oldClick(TObject *Sender)
{
if(M1->MessageDlg("是否要保存为电子表格? ",mtConfirmation, TMsgDlgButtons() << mbYes<<mbNo, 0)==mrNo)
{
TForm33* f33=new TForm33(this);
f33->QuickRep1->Preview();
delete f33;
}
else
{
TForm24 *f24=new TForm24(this);
f24->ADT=DataModule1->dingjian;
f24->ShowModal();
delete f24;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N43_oldClick(TObject *Sender)
{
if(M1->MessageDlg("是否要保存为电子表格? ",mtConfirmation, TMsgDlgButtons() << mbYes<<mbNo, 0)==mrNo)
{
DataModule1->md82ctrl->Filtered=false;
TForm34* f34=new TForm34(this);
f34->QuickRep1->Preview();
delete f34;
}
else
{
TForm24 *f24=new TForm24(this);
f24->ADT=DataModule1->md82ctrl;
f24->ShowModal();
delete f24;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N44_oldClick(TObject *Sender)
{
TForm35* Form35=new TForm35(this);
Form35->ShowModal();
delete Form35;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N45_oldClick(TObject *Sender)
{
fjyb=false;
TForm7* form7=new TForm7(this);
form7->ShowModal();
if(form7->ModalResult==mrOk&&form7->ComboBox1->Text!=NULL&&form7->ComboBox2->Text!=NULL)
{
DataModule1->fjyb->Filtered=false;
DataModule1->fjyb->Filter="年 = '"+form7->ComboBox1->Text+"' AND 月份= '"+form7->ComboBox2->Text+"'";
DataModule1->fjyb->Filtered=true;
TForm37* Form37=new TForm37(this);
Form37->QuickRep1->Preview();
delete Form37;
}
delete form7;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N46_oldClick(TObject *Sender)
{
TForm38* f38=new TForm38(this);
f38->ShowModal();
delete f38;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N50_oldClick(TObject *Sender)
{
TForm42 *f42=new TForm42(this);
f42->ShowModal();
if(f42->ComboBox1->Text!=NULL&&f42->ComboBox2->Text!=NULL)
{
DataModule1->bzcsjtj->Filtered=false;
DataModule1->bzcsjtj->Filter="年 ='"+f42->ComboBox1->Text+"' AND 月 ='"+f42->ComboBox2->Text+"'";
DataModule1->bzcsjtj->Filtered=true;
if(DataModule1->bzcsjtj->RecordCount==0)
{
delete f42;
return;
}
}
else
{delete f42;
return;
}
delete f42;
float v1,v2;
DataModule1->bzcsjtj->First();
v1=DataModule1->bzcsjtjfh->AsInteger/60;
DataModule1->bzcsjtj->Next();
v2=DataModule1->bzcsjtjfh->AsInteger/60;
TForm41* Form41=new TForm41(this);
Form41->BarSeries5->AddBar(v1,"MD90",clRed);
Form41->BarSeries5->AddBar(v2,"MD82",clGreen);
Form41->QuickRep1->Preview();
delete Form41;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::MD82MD901_oldClick(TObject *Sender)
{
TForm42 *f42=new TForm42(this);
f42->ShowModal();
if(f42->ComboBox1->Text!=NULL&&f42->ComboBox2->Text!=NULL)
{
DataModule1->bzcsjtj->Filtered=false;
DataModule1->bzcsjtj->Filter="年 ='"+f42->ComboBox1->Text+"' AND 月 ='"+f42->ComboBox2->Text+"'";
DataModule1->bzcsjtj->Filtered=true;
if(DataModule1->bzcsjtj->RecordCount==0)
{
delete f42;
return;
}
}
else
{delete f42;
return;
}
delete f42;
float v1,v2;
int yw1,yw2,qx1,qx2,chu1,chu2,ywmel1,ywmel2,qxmel1,qxmel2;
DataModule1->bzcsjtj->First();
chu1=DataModule1->bzcsjtjcgcs->AsInteger;
yw1=DataModule1->bzcsjtjzywcs->AsInteger;
qx1=DataModule1->bzcsjtjzqxcs->AsInteger;
ywmel1=DataModule1->bzcsjtjmelyw->AsInteger;
qxmel1=DataModule1->bzcsjtjmelqxcs->AsInteger;
DataModule1->bzcsjtj->Next();
chu2=DataModule1->bzcsjtjcgcs->AsInteger;
yw2=DataModule1->bzcsjtjzywcs->AsInteger;
qx2=DataModule1->bzcsjtjzqxcs->AsInteger;
ywmel2=DataModule1->bzcsjtjmelyw->AsInteger;
qxmel2=DataModule1->bzcsjtjmelqxcs->AsInteger;
v1=(chu1-yw1-qx1)*100/chu1;
v2=(chu2-yw2-qx2)*100/chu2;
TForm43* f43=new TForm43(this);
f43->BarSeries6->AddBar(v1,"MD90",clRed);
f43->BarSeries6->AddBar(v2,"MD82",clGreen);
v1=(chu1-ywmel1-qxmel1)*100/chu1;
v2=(chu2-ywmel2-qxmel2)*100/chu2;
f43->BarSeries7->AddBar(v1,"MD90",clRed);
f43->BarSeries7->AddBar(v2,"MD82",clGreen);
f43->QuickRep1->Preview();
delete f43;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N52_oldClick(TObject *Sender)
{
TForm45* f45=new TForm45(this);
f45->ShowModal();
if(f45->qn->Text!=NULL&&f45->qy->Text!=NULL&&f45->jn->Text!=NULL&&f45->jy->Text!=NULL&&f45->jx->Text!=NULL)
{
DataModule1->bzcsjtj->Filtered=false;
DataModule1->bzcsjtj->Filter="年 >= '"+f45->qn->Text+"' AND 年 <= '"+f45->jn->Text+
"' AND 月 >= '"+f45->qy->Text+"' AND 月 <= '"+f45->jy->Text+"' AND 机型 = '"+f45->jx->Text+"'";
DataModule1->bzcsjtj->Filtered=true;
if(DataModule1->bzcsjtj->RecordCount==0)
{
delete f45;
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -