資源簡介
超市收銀系統,有源代碼和可執行文件的數據庫設計,適合初學者

代碼片段和文件信息
//?CashierLogDlg.cpp?:?implementation?file
//
#include?“stdafx.h“
#include?“SupermarketCahsier.h“
#include?“CashierLogDlg.h“
#include?“CashierRecordSet.h“
#include?“CashinfoRecordSet.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CCashierLogDlg?dialog
CCashierLogDlg::CCashierLogDlg(CWnd*?pParent?/*=NULL*/)
:?CDialog(CCashierLogDlg::IDD?pParent)
{
//{{AFX_DATA_INIT(CCashierLogDlg)
m_strName?=?_T(““);
m_strPass?=?_T(““);
m_bLogSave?=?TRUE;
//}}AFX_DATA_INIT
}
void?CCashierLogDlg::DoDataExchange(CDataExchange*?pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCashierLogDlg)
DDX_Text(pDX?IDC_EDIT_LOGNAME?m_strName);
DDV_MaxChars(pDX?m_strName?20);
DDX_Text(pDX?IDC_EDIT_LOGPASS?m_strPass);
DDV_MaxChars(pDX?m_strPass?20);
DDX_Check(pDX?IDC_CHECK_LOG?m_bLogSave);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCashierLogDlg?CDialog)
//{{AFX_MSG_MAP(CCashierLogDlg)
ON_BN_CLICKED(IDOK?OnOKClicked)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CCashierLogDlg?message?handlers
//DEL?void?CCashierLogDlg::OnOK()?
//DEL?{
//DEL? //?TODO:?Add?extra?validation?here
//DEL? CCashierRecordSet?m_CashierRS;
//DEL? CString??strSQL;
//DEL?
//DEL? if(m_CashierLogDlg.DoModal()!=IDOK)
//DEL? {
//DEL? UpdateData(TRUE);
//DEL? strSQL.Format(“select?*?from?Cashier?where?Clogname?=?‘%s‘“
//DEL? “?and?Clogpass?=?‘%s‘“m_CashierLogDlg.m_strNamem_CashierLogDlg.m_strPass);
//DEL? if(m_CashierRS.IsOpen())
//DEL? m_CashierRS.Close();
//DEL? m_CashierRS.Open(AFX_DB_USE_DEFAULT_TYPEstrSQL);
//DEL?
//DEL? if(!m_CashierRS.IsEOF())?
//DEL? m_bLogOn?=?TRUE;
//DEL? else
//DEL? AfxMessageBox(“密碼錯誤或用戶不存在!“);
//DEL? return;
//DEL? }
//DEL? CDialog::OnOK();
//DEL?}
void?CCashierLogDlg::OnOKClicked()?
{
//?TODO:?Add?your?control?notification?handler?code?here
CCashierRecordSet?m_CashierRS;
CString??strSQL;
UpdateData(TRUE);
strSQL.Format(“select?*?from?Cashier?where?Clogname?=?‘%s‘“
“?and?Clogpass?=?‘%s‘“m_strNamem_strPass);
if(m_CashierRS.IsOpen())
m_CashierRS.Close();
m_CashierRS.Open(AFX_DB_USE_DEFAULT_TYPEstrSQL);
if(!m_CashierRS.GetRecordCount())
{
AfxMessageBox(“密碼錯誤或用戶不存在!“);
m_CashierRS.Close();
CDialog::OnCancel();
}
else
{
//保存用戶名
FILE*?file?=?fopen(_T(“user.dat“)“w“);
int?i?=?0;
char?cName[20]?=?_T(““);
char?*?cTemp?=?cName;
if?(m_bLogSave)
{
i?=?m_strName.GetLength();
strcpy(cName(LPCTSTR)m_strName);
}
if(NULL?!=?file)
{
while(i--)
fputc(*(cTemp++)file);
}
fclose(file);
CString?strCno?=?m_CashierRS.m_Cno;
if(m_CashierRS.IsOpen())
m_CashierRS.Close();
//加入收銀員登錄消息(收銀信息)
CCashinfoRecordSet?m_Cashinfo;
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3802??2008-09-07?18:08??數據庫課設完整版\dm.sql
?????文件????????514??2008-09-17?23:50??數據庫課設完整版\ReadMe.txt
?????文件?????516214??2008-09-11?15:35??數據庫課設完整版\可執行程序\SupermarketCahsier.exe
?????文件??????????6??2008-09-17?23:50??數據庫課設完整版\可執行程序\user.dat
?????文件?????701440??2008-09-17?23:32??數據庫課設完整版\數據庫課程設計報告.doc
?????文件???????3571??2008-09-08?11:02??數據庫課設完整版\源代碼(工程)\CashierLogDlg.cpp
?????文件???????1305??2008-09-07?21:40??數據庫課設完整版\源代碼(工程)\CashierLogDlg.h
?????文件??????36996??2008-09-09?00:37??數據庫課設完整版\源代碼(工程)\CashierOperationDLg.cpp
?????文件???????2433??2008-09-08?15:26??數據庫課設完整版\源代碼(工程)\CashierOperationDLg.h
?????文件???????1567??2008-09-01?13:30??數據庫課設完整版\源代碼(工程)\CashierRecordSet.cpp
?????文件???????1412??2008-09-01?13:30??數據庫課設完整版\源代碼(工程)\CashierRecordSet.h
?????文件???????1476??2008-09-01?22:56??數據庫課設完整版\源代碼(工程)\CashinfoRecordSet.cpp
?????文件???????1399??2008-09-01?22:56??數據庫課設完整版\源代碼(工程)\CashinfoRecordSet.h
?????文件???????1630??2008-09-06?21:30??數據庫課設完整版\源代碼(工程)\CustomerRecordSet.cpp
?????文件???????1441??2008-09-06?21:40??數據庫課設完整版\源代碼(工程)\CustomerRecordSet.h
?????文件?????516214??2008-09-11?15:35??數據庫課設完整版\源代碼(工程)\Debug\SupermarketCahsier.exe
?????文件??????????6??2008-09-14?11:10??數據庫課設完整版\源代碼(工程)\Debug\user.dat
?????文件???????1467??2008-09-01?13:34??數據庫課設完整版\源代碼(工程)\GoodsRecordSet.cpp
?????文件???????1369??2008-09-01?13:34??數據庫課設完整版\源代碼(工程)\GoodsRecordSet.h
?????文件???????1336??2008-09-08?23:22??數據庫課設完整版\源代碼(工程)\HelpDlg.cpp
?????文件???????1226??2008-09-08?23:20??數據庫課設完整版\源代碼(工程)\HelpDlg.h
?????文件??????10548??2008-09-08?23:34??數據庫課設完整版\源代碼(工程)\MainFrm.cpp
?????文件???????2617??2008-09-08?22:17??數據庫課設完整版\源代碼(工程)\MainFrm.h
?????文件???????1626??2008-09-07?14:23??數據庫課設完整版\源代碼(工程)\QueryCashinfoRecordSet.cpp
?????文件???????1473??2008-09-07?14:23??數據庫課設完整版\源代碼(工程)\QueryCashinfoRecordSet.h
?????文件???????1716??2008-09-11?15:35??數據庫課設完整版\源代碼(工程)\QueryTradeinfoRecordSet.cpp
?????文件???????1520??2008-09-08?12:46??數據庫課設完整版\源代碼(工程)\QueryTradeinfoRecordSet.h
?????文件???????4599??2008-08-31?23:27??數據庫課設完整版\源代碼(工程)\ReadMe.txt
?????文件?????155958??2008-09-01?21:43??數據庫課設完整版\源代碼(工程)\res\3.bmp
?????文件?????101694??2008-09-01?18:32??數據庫課設完整版\源代碼(工程)\res\rabbit.bmp
............此處省略34個文件信息
評論
共有 條評論