C++开发源码分析Kit1302.docx

上传人:b****6 文档编号:3238876 上传时间:2022-11-20 格式:DOCX 页数:15 大小:17.97KB
下载 相关 举报
C++开发源码分析Kit1302.docx_第1页
第1页 / 共15页
C++开发源码分析Kit1302.docx_第2页
第2页 / 共15页
C++开发源码分析Kit1302.docx_第3页
第3页 / 共15页
C++开发源码分析Kit1302.docx_第4页
第4页 / 共15页
C++开发源码分析Kit1302.docx_第5页
第5页 / 共15页
点击查看更多>>
下载资源
资源描述

C++开发源码分析Kit1302.docx

《C++开发源码分析Kit1302.docx》由会员分享,可在线阅读,更多相关《C++开发源码分析Kit1302.docx(15页珍藏版)》请在冰豆网上搜索。

C++开发源码分析Kit1302.docx

C++开发源码分析Kit1302

C++开发源码分析(1301)

//qyxz.cpp:

implementationfile

#include"stdafx.h"

#include"khmanager.h"

#include"qyxz.h"

#include"ado.h"

#ifdef_PsiDEBUG

#definenewDEBUG_PsiNEW

#undefTHIS_PsiFILE

staticcharTHIS_PsiFILE[]=_Psi_PsiFILE_Psi_Psi;

#endif

intqyxzclnum=0;

intqyxzxiugai=0;

qyxzdialog

qyxz:

:

qyxz(CWndpParent=NULL)

:

CDialog(qyxz:

:

IDD,pParent)

{

{{AFX_PsiDATA_PsiINIT(qyxz)

NOTE:

theClassWizardwilladdmemberinitializationhere

}}AFX_PsiDATA_PsiINIT

}

voidqyxz:

:

DoDataExchange(CDataExchangepDX)

{

CDialog:

:

DoDataExchange(pDX);

{{AFX_PsiDATA_PsiMAP(qyxz)

DDX_PsiControl(pDX,IDC_PsiLIST1,m_Psilist);

DDX_PsiControl(pDX,IDC_PsiEDIT3,m_Psiedit3);

DDX_PsiControl(pDX,IDC_PsiEDIT2,m_Psiedit2);

DDX_PsiControl(pDX,IDC_PsiEDIT1,m_Psiedit1);

}

}AFX_PsiDATA_PsiMAP

}

BEGIN_PsiMESSAGE_PsiMAP(qyxz,CDialog)

{{AFX_PsiMSG_PsiMAP(qyxz)

ON_PsiCOMMAND(ID_PsiADD,OnAdd)

ON_PsiCOMMAND(ID_PsiDELETE,OnDelete)

ON_PsiCOMMAND(ID_PsiEXIT,OnExit)

ON_PsiCOMMAND(ID_PsiSAVE,OnSave)

ON_PsiCOMMAND(ID_PsiUPDATE,OnUpdate)

ON_PsiCOMMAND(ID_PsiCANCEL,OnCancel)

ON_PsiNOTIFY(NM_PsiDBLCLK,IDC_PsiLIST1,OnDblclkList1)

}

}AFX_PsiMSG_PsiMAP

END_PsiMESSAGE_PsiMAP()

qyxzmessagehandlers

BOOLqyxz:

:

OnInitDialog()

{

CDialog:

:

OnInitDialog();

imagelist.Create(32,32,ILC_PsiCOLOR32|ILC_PsiMASK,0,0);

imagelist.Add(:

:

LoadIcon(:

:

AfxGetResourceHandle(),MAKEINTRESOURCE(IDI_PsiICON1)));

imagelist.Add(:

:

LoadIcon(:

:

AfxGetResourceHandle(),MAKEINTRESOURCE(IDI_PsiICON2)));

imagelist.Add(:

:

LoadIcon(:

:

AfxGetResourceHandle(),MAKEINTRESOURCE(IDI_PsiICON3)));

imagelist.Add(:

:

LoadIcon(:

:

AfxGetResourceHandle(),MAKEINTRESOURCE(IDI_PsiICON4)));

imagelist.Add(:

:

LoadIcon(:

:

AfxGetResourceHandle(),MAKEINTRESOURCE(IDI_PsiICON5)));

imagelist.Add(:

:

LoadIcon(:

:

AfxGetResourceHandle(),MAKEINTRESOURCE(IDI_PsiICON10)));

CStrings;

TCHARpString;

menu.LoadMenu(IDR_Psilxrxx);

toolbar.EnableAutomation();

toolbar.Create(WS_PsiCHILD|WS_PsiVISIBLE,CRect(0,0,0,0),this,ID_PsiTOOLBAR);

toolbar.SetImageList(&imagelist);

inti;

for(i=0;i<8;i++)

{

button[i].dwData=0;

button[i].fsState=TBSTATE_PsiENABLED;

button[i].fsStyle=TBSTYLE_PsiBUTTON;

}

button[5].fsStyle=TBSTYLE_PsiSEP;

button[0].idCommand=ID_PsiADD;

button[0].iBitmap=0;

button[1].idCommand=ID_PsiUPDATE;

button[1].iBitmap=1;

button[2].idCommand=ID_PsiDELETE;

button[2].iBitmap=2;

button[3].idCommand=ID_PsiSAVE;

button[3].iBitmap=3;

button[4].idCommand=ID_PsiCANCEL;

button[4].iBitmap=4;

button[6].idCommand=ID_PsiEXIT;

button[6].iBitmap=5;

for(i=0;i<8;i++)

{

s.LoadString(i+IDS_Psi21);

intnStringLength=s.GetLength()+1;

pString=s.GetBufferSetLength(nStringLength);

button[i].iString=toolbar.AddStrings(pString);

s.ReleaseBuffer();

}

toolbar.AddButtons(7,button);

toolbar.AutoSize();

toolbar.SetStyle(TBSTYLE_PsiFLAT|CCS_PsiTOP);

toolbar.EnableButton(ID_PsiSAVE,false);

toolbar.EnableButton(ID_PsiCANCEL,false);

m_Psilist.ModifyStyle(0L,LVS_PsiREPORT);

m_Psilist.ModifyStyle(0L,LVS_PsiSINGLESEL);

m_Psilist.ModifyStyle(0L,LVS_PsiSHOWSELALWAYS);

m_Psilist.ModifyStyle(0L,LVS_PsiNOSORTHEADER);

m_Psilist.SetExtendedStyle(LVS_PsiEX_PsiGRIDLINES|

LVS_PsiEX_PsiFULLROWSELECT|

LVS_PsiEX_PsiHEADERDRAGDROP|

LVS_PsiEX_PsiONECLICKACTIVATE);

m_Psilist.InsertColumn(0,"企业性质编号");

m_Psilist.InsertColumn(1,"企业性质名称");

m_Psilist.InsertColumn(2,"备注信息");

m_Psilist.SetColumnWidth(0,100);

m_Psilist.SetColumnWidth(1,100);

m_Psilist.SetColumnWidth(2,100);

this->loadlist();

this->enbalewin(false);

this->datatotext();

this->texttowin();

returnTRUE;

returnTRUEunlessyousetthefocustoacontrol

//EXCEPTION:

OCXPropertyPagesshouldreturnFALSE

}

voidqyxz:

:

OnAdd()

{

this->enbalewin(true);

this->enablebutton(false);

this->clearall();

this->autonum();

}

voidqyxz:

:

OnCancel()

{

this->enbalewin(false);

this->enablebutton(true);

qyxzxiugai=0;

this->datatotext();

this->texttowin();

}

voidqyxz:

:

OnDelete()

{

adorst;

CStringss,aa;

this->m_Psiedit1.GetWindowText(aa);

if(aa.IsEmpty())

{MessageBox("不能为空","提示");

return;}

if(MessageBox("删除后数据将丢失","提示",MB_PsiYESNO)==IDYES)

{

ss.Format("deletefromtb_PsiClient_Psiqyxzwhereqyxz_Psiid='%s'",aa);

rst.ExecuteSQL(ss);

rst.close();

m_Psilist.DeleteAllItems();

this->loadlist();

this->datatotext();

this->texttowin();

}

}

voidqyxz:

:

OnExit()

{

this->EndDialog(true);

}

voidqyxz:

:

OnSave()

{

adorst;

this->wintotext();

CStringss,srept;

srept.Format("selectfromtb_PsiClient_Psiqyxzwhereqyxz_Psixzmc='%s'",edit2);

rst.rstOpen(srept);

if(rst.GetRecordCount()>0)

{

MessageBox("这个性质名称已经存在了","提示");

return;

}

if(qyxzxiugai==1)

{ss.Format("UPDATEtb_PsiClient_Psiqyxzsetqyxz_Psixzmc='%s',qyxz_Psibz='%s'whereqyxz_Psiid='%s'",edit2,edit3,edit1);}

else

{ss.Format("INSERTINTOtb_PsiClient_Psiqyxzvalues('%s','%s','%s')",edit1,edit2,edit3);}

rst.ExecuteSQL(ss);

rst.close();

m_Psilist.DeleteAllItems();

this->loadlist();

this->dat

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 小学教育 > 语文

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1