📄 smcheck.cpp
字号:
// SMCheck.cpp : implementation file
//
#include "stdafx.h"
#include "ShopManage.h"
#include "SMCheck.h"
#include "NewSaleMan.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern _RecordsetPtr Record1;
extern _ConnectionPtr DataConn;
extern _RecordsetPtr DataRecord;
extern _CommandPtr Com;
/////////////////////////////////////////////////////////////////////////////
// SMCheck dialog
SMCheck::SMCheck(CWnd* pParent /*=NULL*/)
: CDialog(SMCheck::IDD, pParent)
{
//{{AFX_DATA_INIT(SMCheck)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void SMCheck::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SMCheck)
DDX_Control(pDX, IDC_SaleManTelephone, m_SMTelephone);
DDX_Control(pDX, IDC_SaleManName, m_Name);
DDX_Control(pDX, IDC_SaleManMailCode, m_MailCode);
DDX_Control(pDX, IDC_SaleManID, m_SaleManID);
DDX_Control(pDX, IDC_SaleManAddress, m_Address);
DDX_Control(pDX, IDC_LinkTelephone, m_LinkTelphone);
DDX_Control(pDX, IDC_LinkMan, m_LinkMan);
DDX_Control(pDX, IDC_CheckInfo, m_Checkinfo);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(SMCheck, CDialog)
//{{AFX_MSG_MAP(SMCheck)
ON_BN_CLICKED(IDC_SMClose, OnSMClose)
ON_BN_CLICKED(IDC_SMSearch, OnSMSearch)
ON_WM_CLOSE()
ON_BN_CLICKED(IDC_New, OnNew)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// SMCheck message handlers
void SMCheck::OnOK()
{
// TODO: Add extra validation here
//CDialog::OnOK();
}
void SMCheck::OnSMClose()
{
// TODO: Add your control notification handler code here
EndDialog(0);
}
void SMCheck::OnSMSearch()
{
// TODO: Add your control notification handler code here
CString sql,Checkinfo,info[8];
m_Checkinfo.GetWindowText(Checkinfo);
if(Checkinfo.GetLength() == 0)
{
MessageBox("请输入供应商ID","提示");
return;
}
/*********************************************/
sql.Format("select * from SaleMan where SaleManID=%s",Checkinfo);
Record1->raw_Close();
//sql.Format("select StorageCount from Storage where GoodsID=%s",GoodsID);
Record1->Open((_variant_t)sql,DataConn.GetInterfacePtr(),adOpenKeyset,adLockOptimistic,adCmdText);
if(Record1->RecordCount > 0)
{
for(int i=0;i<7;i++)
{
info[i] = (TCHAR*)(_bstr_t)Record1->GetFields()->GetItem((long)i)->Value;
}
}
else
{
MessageBox("对不起,这个供应商不存在","提示");
return;
}
m_SaleManID.SetWindowText(info[0]);
m_Name.SetWindowText(info[1]);
m_MailCode.SetWindowText(info[2]);
m_Address.SetWindowText(info[3]);
m_SMTelephone.SetWindowText(info[4]);
m_LinkMan.SetWindowText(info[5]);
m_LinkTelphone.SetWindowText(info[6]);
/***********************************************/
m_Checkinfo.SetWindowText("");
}
void SMCheck::OnClose()
{
// TODO: Add your message handler code here and/or call default
//CDialog::OnClose();
}
void SMCheck::OnNew()
{
// TODO: Add your control notification handler code here
//NewSaleMan nsm;
//nsm.DoModal();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -