【VC开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了VC开源代码-xkh.cpp的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
// xkh.cpp : implementation file
//
#include "stdafx.h"
#include "khmanager.h"
#include "xkh.h"
#include "ado.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// xkh dialog
xkh::xkh(CWnd* pParent /*=NULL*/)
: CDialog(xkh::IDD, pParent)
{
//{{AFX_DATA_INIT(xkh)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void xkh::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(xkh)
DDX_Control(pDX, IDC_EDIT9, m_edit9);
DDX_Control(pDX, IDC_EDIT8, m_edit8);
DDX_Control(pDX, IDC_EDIT7, m_edit7);
DDX_Control(pDX, IDC_EDIT6, m_edit6);
DDX_Control(pDX, IDC_EDIT5, m_edit5);
DDX_Control(pDX, IDC_EDIT4, m_edit4);
DDX_Control(pDX, IDC_EDIT3, m_edit3);
DDX_Control(pDX, IDC_EDIT2, m_edit2);
DDX_Control(pDX, IDC_EDIT16, m_edit16);
DDX_Control(pDX, IDC_EDIT15, m_edit15);
DDX_Control(pDX, IDC_EDIT14, m_edit14);
DDX_Control(pDX, IDC_EDIT13, m_edit13);
DDX_Control(pDX, IDC_EDIT12, m_edit12);
DDX_Control(pDX, IDC_EDIT11, m_edit11);
DDX_Control(pDX, IDC_EDIT10, m_edit10);
DDX_Control(pDX, IDC_EDIT1, m_edit1);
DDX_Control(pDX, IDC_COMBO5, m_com5);
DDX_Control(pDX, IDC_COMBO4, m_com4);
DDX_Control(pDX, IDC_COMBO3, m_com3);
DDX_Control(pDX, IDC_COMBO2, m_com2);
DDX_Control(pDX, IDC_COMBO1, m_com1);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(xkh, CDialog)
//{{AFX_MSG_MAP(xkh)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// xkh message handlers
BOOL xkh::OnInitDialog()
{
CDialog::OnInitDialog();
this->m_edit1.EnableWindow(false);
m_edit1.SetWindowText(edit1);
m_edit2.SetWindowText(edit2);
m_edit3.SetWindowText(edit3);
m_edit4.SetWindowText(edit4);
m_edit5.SetWindowText(edit5);
m_edit6.SetWindowText(edit6);
m_edit7.SetWindowText(edit7);
m_edit8.SetWindowText(edit8);
m_edit9.SetWindowText(edit9);
m_edit10.SetWindowText(edit10);
m_edit11.SetWindowText(edit11);
m_edit12.SetWindowText(edit12);
m_edit13.SetWindowText(edit13);
m_edit14.SetWindowText(edit14);
m_edit15.SetWindowText(edit15);
m_edit16.SetWindowText(edit16);
m_com1.SetWindowText(com1);
m_com2.SetWindowText(com2);
m_com3.SetWindowText(com3);
m_com4.SetWindowText(com4);
m_com5.SetWindowText(com5);
ado load;
load.Open("select * from tb_Client_sfzy",adCmdText);
int rstnum=load.GetRecordCount();
int l;
for(l=1;l<=rstnum;l++)
{
this->m_com3.AddString(load.GetFieldValue("sfzy_sfmc"));
load.Move(l);
}
load.Open("select * from tb_Client_qyxz",adCmdText);
rstnum=load.GetRecordCount();
for(l=1;l<=rstnum;l++)
{
this->m_com1.AddString(load.GetFieldValue("qyxz_xzmc"));
load.Move(l);
}
load.Open("select * from tb_Client_khjb",adCmdText);
rstnum=load.GetRecordCount();
for(l=1;l<=rstnum;l++)
{
this->m_com4.AddString(load.GetFieldValue("khjb_jbmc"));
load.Move(l);
}
load.Open("select * from tb_Client_qylx",adCmdText);
rstnum=load.GetRecordCount();
for(l=1;l<=rstnum;l++)
{
this->m_com2.AddString(load.GetFieldValue("qylx_lxmc"));
load.Move(l);
}
load.Open("select * from tb_Client_qyzx",adCmdText);
rstnum=load.GetRecordCount();
for(l=1;l<=rstnum;l++)
{
this->m_com5.AddString(load.GetFieldValue("qyzx_zxjb"));
load.Move(l);
}
load.close();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void xkh::OnButton2()
{
this->OnCancel();
}
void xkh::OnButton1()
{
m_edit1.GetWindowText(edit1);
m_edit2.GetWindowText(edit2);
m_edit3.GetWindowText(edit3);
m_edit4.GetWindowText(edit4);
m_edit5.GetWindowText(edit5);
m_edit6.GetWindowText(edit6);
m_edit7.GetWindowText(edit7);
m_edit8.GetWindowText(edit8);
m_edit9.GetWindowText(edit9);
m_edit10.GetWindowText(edit10);
m_edit11.GetWindowText(edit11);
m_edit12.GetWindowText(edit1