📄 frmjianlu.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "frmjianlu.h"
#include "dlgjianluprint.h"
#include "frmprintform1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "model"
#pragma resource "*.dfm"
Tjianlu *jianlu;
//---------------------------------------------------------------------------
__fastcall Tjianlu::Tjianlu(TComponent* Owner)
: TMDIChild(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tjianlu::FormDestroy(TObject *Sender)
{
delete yuange_jl;
delete list_temp;
}
//---------------------------------------------------------------------------
void __fastcall Tjianlu::FormShow(TObject *Sender)
{
this->Width=12;
setwidthheight();
}
//---------------------------------------------------------------------------
void __fastcall Tjianlu::setwidthheight()
{
if(this->Width<663)this->Width=663;
if(this->Height<486)this->Height=486; //TODO: Add your source code here
}
void __fastcall Tjianlu::FormResize(TObject *Sender)
{
setwidthheight();
}
//---------------------------------------------------------------------------
void __fastcall Tjianlu::FormCreate(TObject *Sender)
{
list_temp=new TStringList;
}
//---------------------------------------------------------------------------
void __fastcall Tjianlu::lbfzChange(TObject *Sender)
{
int index;
AnsiString str;
index=lbfz->ItemIndex;
if(index<0||lbfz->Items->Count<1)return;
str=lbfz->Items->Strings[index].Trim();
yuange_jl->selectlbfz(str);
xm->Items->Assign(yuange_jl->list_list_xmmc);
xm->Text="";
}
//---------------------------------------------------------------------------
void __fastcall Tjianlu::xmChange(TObject *Sender)
{
bool res;
index=xm->ItemIndex;
if(index<0)return ;
temp_str=xm->Text;
temp_str=yuange_jl->selectbsxm(temp_str);
if(temp_str=="-1"){
ShowMessage("错误:项目改变时候");
return;
}
res=yuange_jl->setxminfo(temp_str);
if(!res){
ShowMessage("错误:项目改变时候");
return;
}
bsfs->Text="";
//设置比赛方式的....
parsestr(yuange_jl->list_mcbsmc,&list_temp,';');
bsfs->Items->Assign(list_temp);
bsfs->ItemIndex=0;
yuange_jl->curbsfs=bsfs->ItemIndex+1;
yuange_jl->getzxm(&list_temp);
zxm->Items->Assign(list_temp);
zxm->ItemIndex=zxm->Items->Count-1;
yuange_jl->setzxminfo(zxm->ItemIndex);
}
//---------------------------------------------------------------------------
void __fastcall Tjianlu::BitBtn1Click(TObject *Sender)
{
if(bsfs->Text.Trim().IsEmpty()||xm->Text.Trim().IsEmpty()||lbfz->Text.Trim().IsEmpty()){
ShowMessage("请全部选择类别,分组,项目,比赛方式");
return ;
}
index=bsfs->ItemIndex;
yuange_jl->getnewsinfo();
if(!yuange_jl->validebsfs(index)){
ShowMessage("错误:不能检录当前的项目,可能已经检录完毕");
return;
}
yuange_jl->createsrtable(1);
yuange_jl->selectydy(1);
yuange_jl->setbszt(1);
refresh();
}
//---------------------------------------------------------------------------
void __fastcall Tjianlu::BitBtn3Click(TObject *Sender)
{
if(bsfs->Text.Trim().IsEmpty()||xm->Text.Trim().IsEmpty()||lbfz->Text.Trim().IsEmpty()){
ShowMessage("请全部选择类别,分组,项目,比赛方式");
return ;
}
if(!jl1_query->Active){
ShowMessage("没有数据可以提交");
return ;
}
//if(jl1_query->RecordCount<=0){
//ShowMessage("没有数据可以提交");
//return ;
//}
if(Sender!=this)
if(!showok("是否要提交"))return;
yuange_jl->updatejl(1);
close();
}
//---------------------------------------------------------------------------
void __fastcall Tjianlu::BitBtn4Click(TObject *Sender)
{
if(bsfs->Text.Trim().IsEmpty()||xm->Text.Trim().IsEmpty()||lbfz->Text.Trim().IsEmpty()){
ShowMessage("请全部选择类别,分组,项目,比赛方式");
return ;
}
if(!showok("是否要结束当前项目的检录?"))return;
if(jl1_query->Active)
if(jl1_query->RecordCount>0){
if(showok("已经有检录的数据是否要提交"))
BitBtn3->OnClick(this);
}
yuange_jl->setbszt(2);
close();
}
//---------------------------------------------------------------------------
void __fastcall Tjianlu::BitBtn5Click(TObject *Sender)
{
int idok;
int type,i ;
AnsiString xzh,frompdh,topdh,dxbh,m_sql;
int num;
bool isliji;
if(bsfs->Text.Trim().IsEmpty()||xm->Text.Trim().IsEmpty()||lbfz->Text.Trim().IsEmpty()){
ShowMessage("请全部选择类别,分组,项目,比赛方式");
return ;
}
if(!jl1_query->Active){
ShowMessage("没有数据可以打印,请按开始");
return;
}
if(jl1_query->RecordCount<=0){
ShowMessage("没有数据可以打印,请按开始");
return;
}
jlprint=new Tjlprint(this);
jlprint->l->Caption=lbfz->Text+xm->Text+bsfs->Text+"检录打印";
jlprint->zxm->Items->Assign(yuange_jl->list_zxmmc);
jlprint->zxm->ItemIndex=0;
idok=jlprint->ShowModal();
if(idok!=IDOK)return;
isliji=jlprint->dayin->Checked;
xzh=jlprint->xzh->Text;
frompdh=jlprint->from_pdh->Text;
topdh=jlprint->to_pdh->Text;
try{num=StrToInt(xzh);}catch(...){xzh="1";}
try{num=StrToInt(frompdh);}catch(...){frompdh="1";}
try{num=StrToInt(topdh);}catch(...){topdh="100";}
try{num=StrToInt(jlprint->num->Text.Trim());}catch(...){num=1;}
if(jlprint->sxzh->Checked)type=1;
if(jlprint->spdh->Checked)type=2;
if(jlprint->sall->Checked)type=3;
if(yuange_jl->list_xmxj!="全能"){
if(yuange_jl->list_xmxj=="接力"||yuange_jl->list_xmxj=="大众体育"){
print_form1->js_title->Caption=Application->Title;
print_form1->js_xm->Caption=lbfz->Text.Trim()+" "+xm->Text.Trim()+" "+bsfs->Text.Trim();
print_form1->js_djz->Caption="第"+xzh+"组";
if(type==1)
m_sql="select a.PDH as m_pdh,a.YDYBH as m_ydybh,b.YDYXM as m_xm,c.DWJC as m_dwmc from "+yuange_jl->m_table_name+" a,ydyb b,jsdwb c where a.YDYBH=b.YDYBH and b.DWBH=c.BH and a.XZH="+xzh+" and a.JLBZ=1 order by a.XZH,a.PDH";
if(type==2)
m_sql="select a.PDH as m_pdh,a.YDYBH as m_ydybh,b.YDYXM as m_xm,c.DWJC as m_dwmc from "+yuange_jl->m_table_name+" a,ydyb b,jsdwb c where a.YDYBH=b.YDYBH and b.DWBH=c.BH and a.PDH>="+frompdh+" and a.PDH<="+topdh+" and a.JLBZ=1 order by a.XZH,a.PDH";;
if(type==3)
m_sql="select a.PDH as m_pdh,a.YDYBH as m_ydybh,b.YDYXM as m_xm,c.DWJC as m_dwmc from "+yuange_jl->m_table_name+" a,ydyb b,jsdwb c where a.YDYBH=b.YDYBH and b.DWBH=c.BH"+" and a.JLBZ=1 order by a.XZH,a.PDH";;
print_form1->open(m_sql);
if(!isliji)
print_form1->js_rep->Preview();
else{
for(i=0;i<num;i++)print_form1->js_rep->Print();
}
}
if(yuange_jl->list_xmxj=="径赛"){
print_form1->js_title->Caption=Application->Title;
print_form1->js_xm->Caption=lbfz->Text.Trim()+" "+xm->Text.Trim()+" "+bsfs->Text.Trim();
print_form1->js_djz->Caption="第"+xzh+"组";
if(type==1)
m_sql="select a.PDH as m_pdh,a.YDYBH as m_ydybh,b.YDYXM as m_xm,c.DWJC as m_dwmc from "+yuange_jl->m_table_name+" a,ydyb b,jsdwb c where a.YDYBH=b.YDYBH and b.DWBH=c.BH and a.XZH="+xzh+" and a.JLBZ=1 order by a.XZH,a.PDH";
if(type==2)
m_sql="select a.PDH as m_pdh,a.YDYBH as m_ydybh,b.YDYXM as m_xm,c.DWJC as m_dwmc from "+yuange_jl->m_table_name+" a,ydyb b,jsdwb c where a.YDYBH=b.YDYBH and b.DWBH=c.BH and a.PDH>="+frompdh+" and a.PDH<="+topdh+" and a.JLBZ=1 order by a.XZH,a.PDH";;
if(type==3)
m_sql="select a.PDH as m_pdh,a.YDYBH as m_ydybh,b.YDYXM as m_xm,c.DWJC as m_dwmc from "+yuange_jl->m_table_name+" a,ydyb b,jsdwb c where a.YDYBH=b.YDYBH and b.DWBH=c.BH"+" and a.JLBZ=1 order by a.XZH,a.PDH";;
print_form1->open(m_sql);
if(!isliji)
print_form1->js_rep->Preview();
else{
for(i=0;i<num;i++)print_form1->js_rep->Print();
}
}
if(yuange_jl->list_xmxj=="高度"){
print_form1->ts_gdtitle->Caption=Application->Title;
print_form1->ts_gdxm->Caption=lbfz->Text.Trim()+" "+xm->Text.Trim()+" "+bsfs->Text.Trim();
if(type==1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -