DEMO_0001示例程序 |
//派生类头文件申明
class TInputBase_Info_Zhk : public TDialog {
public:
int RunFlag;
TEdit *TYDM1_Edit;
TEdit *TYDM2_Edit;
TEdit *CKRMC_Edit;
TEdit *FRDB_Edit;
TEdit *SFZHM_Edit;
TEdit *LXDZ_Edit;
TEdit *LXDH_Edit;
TEdit *TYDMQX_Edit;
TComboBox *JJLX_ComboBox;
TComboBox *JJHY_ComboBox;
TEdit *YYHM_Edit;
TEdit *GSSWHM_Edit;
TEdit *DSSWHM_Edit;
TEdit *JYFW_Edit;
TComboBox *DKZBH_ComboBox;
TEdit *ZCZB_Edit;
TEdit *BZ_Edit;
public:
virtual void InitDialog(void);
virtual int ExecDialog(void);
virtual char *GetClassName(void){return
"INPUT_BASE_INFO_ZHK";}
virtual int PressEnterEvent(void);
TInputBase_Info_Zhk(int flag,char
*caption,int left,int top,int width,int height,
int ftcolor,int bkcolor);
void Reset(int flag);
int CheckInputOkOrNot(void);
int CheckTydm(void);
int CheckTydm2(void);
int CheckJJLX(void);
int CheckJJHY(void);
int CheckKHJG(void);
int CheckCKRMC(void);
int CheckDate(void);
};
|
//-----------------------------------------------------------------------
//存款人基本信息录入,类定义部分
//-----------------------------------------------------------------------
TInputBase_Info_Zhk::TInputBase_Info_Zhk(int flag,char
*caption,int left,int top,int width,int height,int ftcolor,int
bkcolor)
:TDialog(caption,left,top,width,height,ftcolor,bkcolor)
{//构造函数,所有的程序段都一样
Caption=caption;
Left=left;
Top=top;
Width=width;
Height=height;
BKColor=bkcolor;
FTColor=ftcolor;
RunFlag=flag;
InitDialog();
}
int TInputBase_Info_Zhk::CheckTydm(void)
{
//事件响应函数,检查统一代码输入的有效性
//在统一代码输入条处按回车键会响应该时间
//由用户自己编写的事件响应函数
}
int TInputBase_Info_Zhk::CheckJJLX(void)
{
//事件响应函数,检查经济类型下拉列表框输入的有效性
//在经济类型下拉列表框处按回车键会响应该时间
//由用户自己编写的事件响应函数
}
int TInputBase_Info_Zhk::CheckJJHY(void)
{
//事件响应函数,检查经济行业下拉列表框输入的有效性
//在经济行业下拉列表框处按回车键会响应该时间
//由用户自己编写的事件响应函数
}
int TInputBase_Info_Zhk::CheckKHJG(void)
{
//事件函数,检查贷款主办行输入的有效性
//在贷款主办行输入条处按回车键会响应该时间
//由用户自己编写的事件响应函数
}
int TInputBase_Info_Zhk::CheckDate(void)
{
//事件响应函数,检查日期输入的有效性
//在贷日期输入条处按回车键会响应该时间
//由用户自己编写的事件响应函数
}
int TInputBase_Info_Zhk::CheckInputOkOrNot(void)
{
//事件响应函数,检查所有输入的有效性
//在保存按钮处按回车键会响应该时间
//由用户自己编写的事件响应函数
}
void TInputBase_Info_Zhk::InitDialog(void)
{//用户定义界面元素
TDialog::InsertControl((TControl *)new
TLabel("统一代码:",4,1,BLACK_WHITE));
TYDM1_Edit=new
TEdit(18,0,13,1,20,1,BLACK_WHITE,WHITE_WHITE,
(KEYEVENTFUNCTION)TInputBase_Info_Zhk::CheckTydm);
TDialog::InsertControl((TControl
*)TYDM1_Edit);
TDialog::InsertControl((TControl *)new
TLabel("确认输入:",4,2,BLACK_WHITE));
TYDM2_Edit=new
TEdit(18,0,13,2,20,1,BLACK_WHITE,WHITE_WHITE,
(KEYEVENTFUNCTION)TInputBase_Info_Zhk::CheckTydm2);
TDialog::InsertControl((TControl
*)TYDM2_Edit);
TDialog::InsertControl((TControl *)new
TLabel("名 称:",4,3,BLACK_WHITE));
CKRMC_Edit=new
TEdit(52,0,13,3,54,1,BLACK_WHITE,WHITE_WHITE,
(KEYEVENTFUNCTION)TInputBase_Info_Zhk::CheckCKRMC);
TDialog::InsertControl((TControl
*)CKRMC_Edit);
TDialog::InsertControl((TControl *)new
TLabel("法人代表:",4,4,BLACK_WHITE));
FRDB_Edit=new
TEdit(8,0,13,4,10,1,BLACK_WHITE,WHITE_WHITE);
TDialog::InsertControl((TControl
*)FRDB_Edit);
TDialog::InsertControl((TControl *)new
TLabel("身份证号:",26,4,BLACK_WHITE));
SFZHM_Edit=new
TEdit(18,0,35,4,32,1,BLACK_WHITE,WHITE_WHITE);
TDialog::InsertControl((TControl
*)SFZHM_Edit);
TDialog::InsertControl((TControl *)new
TLabel("地 址:",4,5,BLACK_WHITE));
LXDZ_Edit=new
TEdit(50,0,13,5,54,1,BLACK_WHITE,WHITE_WHITE);
TDialog::InsertControl((TControl
*)LXDZ_Edit);
TDialog::InsertControl((TControl *)new
TLabel("经济类型:",4,6,BLACK_WHITE));
JJLX_ComboBox=new TComboBox("经济类型",13,6,16,4,BLACK_WHITE,BLACK_CYAN,
CYAN_CYAN,WHITE_RED,RED_RED,
(KEYEVENTFUNCTION)TInputBase_Info_Zhk::CheckJJLX);
//GetJJLXInfoFromSybase(JJLX_ComboBox);//用户可以在这里增加列表框的内容
TDialog::InsertControl((TControl
*)JJLX_ComboBox);
TDialog::InsertControl((TControl *)new
TLabel("经济行业:",32,6,BLACK_WHITE));
JJHY_ComboBox=new TComboBox("经济行业",41,6,26,4,BLACK_WHITE,BLACK_CYAN,CYAN_CYAN,
WHITE_RED,RED_RED,
(KEYEVENTFUNCTION)TInputBase_Info_Zhk::CheckJJHY);
//GetJJHYInfoFromSybase(JJHY_ComboBox);
TDialog::InsertControl((TControl
*)JJHY_ComboBox);
TDialog::InsertControl((TControl *)new
TLabel("联系电话:",4,7,BLACK_WHITE));
LXDH_Edit=new
TEdit(20,0,13,7,22,1,BLACK_WHITE,WHITE_WHITE);
TDialog::InsertControl((TControl
*)LXDH_Edit);
TDialog::InsertControl((TControl *)new
TLabel("统一代码有效期限:",38,7,BLACK_WHITE));
TYDMQX_Edit=new
TEdit(8,0,55,7,12,1,BLACK_WHITE,WHITE_WHITE,
(KEYEVENTFUNCTION)TInputBase_Info_Zhk::CheckDate);
TDialog::InsertControl((TControl
*)TYDMQX_Edit);
TDialog::InsertControl((TControl *)new
TLine(M_HORZ,0,8,72,17,BLACK_WHITE));
TDialog::InsertControl((TControl *)new
TLabel("营业执照:",4,9,BLACK_WHITE));
YYHM_Edit=new
TEdit(18,0,13,9,20,1,BLACK_WHITE,WHITE_WHITE);
TDialog::InsertControl((TControl
*)YYHM_Edit);
TDialog::InsertControl((TControl *)new
TLabel("国税号码:",36,9,BLACK_WHITE));
GSSWHM_Edit=new
TEdit(18,0,45,9,22,1,BLACK_WHITE,WHITE_WHITE);
TDialog::InsertControl((TControl
*)GSSWHM_Edit);
TDialog::InsertControl((TControl *)new
TLabel("地税号码:",4,10,BLACK_WHITE));
DSSWHM_Edit=new
TEdit(18,0,13,10,20,1,BLACK_WHITE,WHITE_WHITE);
TDialog::InsertControl((TControl
*)DSSWHM_Edit);
TDialog::InsertControl((TControl *)new
TLabel("经营范围:",4,11,BLACK_WHITE));
JYFW_Edit=new
TEdit(52,0,13,11,54,1,BLACK_WHITE,WHITE_WHITE);
TDialog::InsertControl((TControl
*)JYFW_Edit);
TDialog::InsertControl((TControl *)new
TLabel("贷款主办:",4,12,BLACK_WHITE));
DKZBH_ComboBox=new TComboBox("贷款主办",13,12,54,4,BLACK_WHITE,BLACK_CYAN,
CYAN_CYAN,WHITE_RED,RED_RED,
(KEYEVENTFUNCTION)TInputBase_Info_Zhk::CheckKHJG);
//GetKHJGInfoFromSybase(DKZBH_ComboBox);
TDialog::InsertControl((TControl
*)DKZBH_ComboBox);
TDialog::InsertControl((TControl *)new
TLabel("注册资本:",4,13,BLACK_WHITE));
ZCZB_Edit=new
TEdit(52,0,13,13,54,1,BLACK_WHITE,WHITE_WHITE);
TDialog::InsertControl((TControl
*)ZCZB_Edit);
TDialog::InsertControl((TControl *)new
TLabel("备 注:",4,14,BLACK_WHITE));
BZ_Edit=new
TEdit(40,0,13,14,54,1,BLACK_WHITE,WHITE_WHITE);
TDialog::InsertControl((TControl
*)BZ_Edit);
TDialog::InsertControl((TControl *)new
TLine(M_HORZ,0,15,72,17,BLACK_WHITE));
TDialog::InsertControl((TControl *)new
TButton(SAVE_BUTTON,
"保存",4,16,BLACK_WHITE,WHITE_MAGENTA));
TDialog::InsertControl((TControl *)new
TButton(OTHER_BUTTON,
"取消",18,16,BLACK_WHITE,WHITE_MAGENTA));
TDialog::InsertControl((TControl *)new
TButton(EXIT_BUTTON,
"退出",32,16,BLACK_WHITE,WHITE_MAGENTA));
}
void TInputBase_Info_Zhk::Reset(int flag)
{//初始化显示界面
if(RunFlag==0) {
strcpy(TYDM1_Edit->Text,"");
strcpy(TYDM1_Edit->Text,"");
strcpy(TYDM2_Edit->Text,"");
}
strcpy(CKRMC_Edit->Text,"");
strcpy(FRDB_Edit->Text,"");
strcpy(SFZHM_Edit->Text,"");
strcpy(LXDZ_Edit->Text,"");
strcpy(LXDH_Edit->Text,"");
strcpy(TYDMQX_Edit->Text,"");
strcpy(JJLX_ComboBox->Text,"");
strcpy(JJLX_ComboBox->Edit->Text,"");
strcpy(JJHY_ComboBox->Text,"");
strcpy(JJHY_ComboBox->Edit->Text,"");
strcpy(YYHM_Edit->Text,"");
strcpy(GSSWHM_Edit->Text,"");
strcpy(DSSWHM_Edit->Text,"");
strcpy(JYFW_Edit->Text,"");
strcpy(DKZBH_ComboBox->Text,"");
strcpy(DKZBH_ComboBox->Edit->Text,"");
strcpy(ZCZB_Edit->Text,"");
strcpy(BZ_Edit->Text,"");
if(flag==1) {
TYDM1_Edit->Show();
TYDM2_Edit->Show();
CKRMC_Edit->Show();
FRDB_Edit->Show();
SFZHM_Edit->Show();
LXDZ_Edit->Show();
LXDH_Edit->Show();
TYDMQX_Edit->Show();
JJLX_ComboBox->Show();
JJHY_ComboBox->Show();
YYHM_Edit->Show();
GSSWHM_Edit->Show();
DSSWHM_Edit->Show();
JYFW_Edit->Show();
DKZBH_ComboBox->Show();
ZCZB_Edit->Show();
BZ_Edit->Show();
SetFocus(TYDM1_Edit);
}
}
int TInputBase_Info_Zhk::ExecDialog(void)
{//对话框执行重载,用户可以在显示界面以前做些处理
Reset(0);
GetJJLXInfoFromSybase(JJLX_ComboBox);//把经济类型代码对照表填入下拉列表框中
GetJJHYInfoFromSybase(JJHY_ComboBox);//把经济行业代码对照表填入下拉列表框中
GetKHJGInfoFromSybase(DKZBH_ComboBox);//把贷款主办行对照表填入下拉列表框中
return TDialog::ExecDialog();//执行基类的对话框执行函数
}
|
|
|
|