place_order_dlg.h
2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#pragma once
#include "GridCtrl.h"
#include "resource.h"
#include "afxcmn.h"
#include "afxwin.h"
#include "afxbutton.h"
#include "../utility/win_http.h"
#include "etrade_edit_control.h"
#include <string>
#include "CellRange.h"
#include "GridCell.h"
#include <vector>
// PlaceOrderDlg 对话框
class PlaceOrderDlg : public CDialogEx
{
DECLARE_DYNAMIC(PlaceOrderDlg)
struct CardInfo
{
CString card_num;
CString card_name;
CString card_type;
};
struct CommInfo
{
int comm_id;
long product_id;
CString seller_card;
CString seller_name;
CString comm_name;
CString price;
CString count;
CString unit;
CString weight;
CString total_money;
};
public:
PlaceOrderDlg(CWnd* pParent = NULL); // 标准构造函数
virtual ~PlaceOrderDlg();
virtual BOOL OnInitDialog();
virtual BOOL Create(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
afx_msg void OnPaint();
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
afx_msg void OnBnClickedButtonPay();
virtual BOOL PreTranslateMessage(MSG* pMsg);
afx_msg void OnAcceleratorTab();
afx_msg void OnAcceleratorEnter();
afx_msg LRESULT OnEditKillFocus(WPARAM wParam, LPARAM lParam);
afx_msg void OnAcceleratorDown();
afx_msg void OnAcceleratorUp();
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnBnClickedButtonSwipCard();
afx_msg LRESULT DeleteComm(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnSessionExpired(WPARAM wParam, LPARAM lParam);
// 对话框数据
enum { IDD = IDD_DIALOG_PLACE_ORDER };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
private:
void SetCtrlPos();
void SetCtrlInitData();
void InitList();
void SortList();
void EmptyCtrl(bool is_empty_buyer, bool is_empty_saler = true);
void EnableCtrl(bool is_enable);
int GetCommIndex();
bool GetUserName(CString &name);
void SetErrorMsg(CString &error);
bool GetCardName(CString &num, CString &name, int type); //type =1是买家,2是买家
bool GetCommName(CString &num, CString& card, CString &name, long &product_id);
private:
CStatic owner_static_;
CEditBox card_edit_;
CEdit name_edit_;
CStatic comm_static_;
CEditBox comm_num_edit_;
CEdit comm_name_edit_;
CStatic unit_static_;
CEditBox unit_edit_;
CStatic real_unit_static;
CStatic heavy_static_;
CEditBox heavy_edit_;
CStatic price_static_;
CEditBox price_edit_;
CStatic count_static_;
CEditBox count_edit_;
CButton pay_button_;
CGridCtrl product_list_;
CStatic total_money_static_;
CStatic total_real_money_static_;
CStatic error_static_;
CStatic buyer_static_;
CEditBox buyer_card_edit_;
CEditBox buyer_name_edit_;
CPen line_pen_;
CPoint line_point_[3];
CBrush edit_brush_;
HACCEL acce_;
long product_id_;
int buyer_card_type_;
double stock_amount_;
std::vector<CommInfo> comm_vec_;
int comm_id_index_;
public:
CButton swip_card_button_;
};