strSQL = strSQL + "CommodityInfo.unit, StoreInfo.saleprice, StoreInfo.num FROM CommodityInfo INNER JOIN StoreInfo ON ";
strSQL = strSQL + "CommodityInfo.barcode = StoreInfo.barcode WHERE CommodityInfo.barcode = '";
strSQL = strSQL + m_strSerchCode + "' OR CommodityInfo.commoditycode = '";
strSQL = strSQL + m_strSerchCode + "' OR CommodityInfo.spellcode = '";
strSQL = strSQL + m_strSerchCode + "'";
dlgAll.strTitle = "商品基本信息";
dlgAll.strSQL = strSQL;
dlgAll.intKey = 0;
if (dlgAll.DoModal() == IDOK)
{
strSQL = "SELECT CommodityInfo.barcode, CommodityInfo.name, CommodityInfo.standard, ";
strSQL = strSQL + "CommodityInfo.unit, StoreInfo.saleprice, StoreInfo.num FROM CommodityInfo INNER JOIN StoreInfo ON ";
strSQL = strSQL + "CommodityInfo.barcode = StoreInfo.barcode WHERE CommodityInfo.barcode = '";
strSQL = strSQL + dlgAll.strKey + "'";
adoFind.Open(strSQL);
//adoFind.InitList(&m_ctrlListMain);
adoFind.FillList(&m_ctrlListMain);
m_ctrlListMain.SetItemText(0, 6, "1");
m_fltSalePrice = atof(m_ctrlListMain.GetItemText(0, 4));
m_iNum = 1;
m_fltAmount = m_fltAmount + m_iNum * m_fltSalePrice;
UpdateData(FALSE);
}
}
#if !defined(AFX_SALESBILL_H__E95A758E_1C5A_442D_91F0_BA25EF86E146__INCLUDED_)
#define AFX_SALESBILL_H__E95A758E_1C5A_442D_91F0_BA25EF86E146__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SalesBill.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CSalesBill dialog
#include "MyButton.h"
class CSalesBill : public CDialog
{
private:
CBitmapButton bitmapButton;
// Construction
public:
CSalesBill(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CSalesBill)
enum { IDD = IDD_SALESBILLDLG };
CMyButton m_btnCommoditySearch;
CMyButton m_btnCommodityResearch;
CListCtrl m_ctrlListMain;
CString m_strBillDate;
CString m_strBiller;
CString m_strNote;
CString m_strSerchCode;
float m_fltSalePrice;
int m_iNum;
float m_fltAmount;
CString m_strClient;
CString m_strBillCode;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSalesBill)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CSalesBill)
virtual BOOL OnInitDialog();
afx_msg void OnBill();
afx_msg void OnSave();
afx_msg void OnUpdate();
afx_msg void OnDelete();
afx_msg void OnAccount();
afx_msg void OnExit();
afx_msg void OnClientfind();
afx_msg void OnCommodityserch();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SALESBILL_H__E95A758E_1C5A_442D_91F0_BA25EF86E146__INCLUDED_)
// SalesBill.cpp : implementation file
//
#include "stdafx.h"
#include "SalesManagementSystem.h"
#include "SalesManagementSystemDlg.h"
#include "SalesBill.h"
#include "ADOConn.h"
#include "MyTime.h"
#include "DiagLog.h"
#include "DlgAll.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#en