📄 protcoloutdlg.cpp
字号:
// ProtcolOutDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Invoice.h"
#include "ProtcolOutDlg.h"
#include "OlddatDlg.h"
#include "MdbSaveDat.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CProtcolOutDlg dialog
CProtcolOutDlg::CProtcolOutDlg(CWnd* pParent /*=NULL*/)
: CDialog(CProtcolOutDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CProtcolOutDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CProtcolOutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CProtcolOutDlg)
DDX_Control(pDX, IDC_LIST_PROTCOL_OUT, m_list_protcolout);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CProtcolOutDlg, CDialog)
//{{AFX_MSG_MAP(CProtcolOutDlg)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CProtcolOutDlg message handlers
BOOL CProtcolOutDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// /////////////初始化输出状态表
m_list_protcolout.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
m_list_protcolout.InsertColumn(0,"序号",LVCFMT_LEFT,50,50);
m_list_protcolout.InsertColumn(1," 货品编号",LVCFMT_LEFT,150,50);
m_list_protcolout.InsertColumn(2," 电 镀",LVCFMT_LEFT,150,50);
m_list_protcolout.InsertColumn(3," 数量(件)",LVCFMT_LEFT,150,50);
m_list_protcolout.InsertColumn(3," 单价(元)",LVCFMT_LEFT,150,50);
CMdbSaveDat MdbSaveDat;
CString goods_num[200];
CString goods_mode[200];
CString goods_maxno[200];
CString goods_unitprice[200];
char str[256];
int save2_maxno=0,no;
double max_price=0;
int trade_goods_max_no=0;
save2_maxno=MdbSaveDat.QueryMdbSave2(m_select_protcol,
goods_num,
goods_mode,
goods_maxno,
goods_unitprice);
m_list_protcolout.DeleteAllItems();
for (no=0;no<save2_maxno;no++)
{
trade_goods_max_no+=atoi(goods_maxno[no]);
max_price+=(atoi(goods_maxno[no])*atof(goods_unitprice[no]));
sprintf(str,"%05d",no);
m_list_protcolout.InsertItem(no,str);
sprintf(str,"%s",goods_num[no]);
m_list_protcolout.SetItemText(no,1,str);
sprintf(str,"%s",goods_mode[no]);
m_list_protcolout.SetItemText(no,2,str);
sprintf(str,"%s",goods_unitprice[no]);
m_list_protcolout.SetItemText(no,3,str);
sprintf(str,"%s",goods_maxno[no]);
m_list_protcolout.SetItemText(no,4,str);
}
// sprintf(str,"%05d",no);
// no+=2;
m_list_protcolout.InsertItem(no++,"");
m_list_protcolout.InsertItem(no++,"");
m_list_protcolout.InsertItem(no,"");
sprintf(str,"合同:%s",m_select_protcol);
m_list_protcolout.SetItemText(no,2,str);
sprintf(str,"数量:%d",trade_goods_max_no);
m_list_protcolout.SetItemText(no,3,str);
sprintf(str,"总金额:%1.2f",max_price);
m_list_protcolout.SetItemText(no,4,str);
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -