// InputGoods.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "InputGoods.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // InputGoods dialog InputGoods::InputGoods(CWnd* pParent /*=NULL*/) : CDialog(InputGoods::IDD, pParent) { //{{AFX_DATA_INIT(InputGoods) m_id = _T(""); m_count = _T(""); m_clerk = g_user.name ; m_date = g_date; m_remark = _T(""); //}}AFX_DATA_INIT m_mode=0; } void InputGoods::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(InputGoods) DDX_Control(pDX, IDC_EDITcount, m_editnum); DDX_Control(pDX, IDC_COMBOname, m_comboname); DDX_Control(pDX, IDC_COMBOtype, m_combotype); DDX_Text(pDX, IDC_EDITid, m_id); DDX_Text(pDX, IDC_EDITcount, m_count); DDX_Text(pDX, IDC_EDITclerk, m_clerk); DDX_Text(pDX, IDC_EDITdate, m_date); DDX_Text(pDX, IDC_EDITremark, m_remark); DDV_MaxChars(pDX, m_remark, 1000); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(InputGoods, CDialog) //{{AFX_MSG_MAP(InputGoods) ON_CBN_SELCHANGE(IDC_COMBOtype, OnSelchangeCOMBOtype) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // InputGoods message handlers BOOL InputGoods::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here CString sql="select max(id) as cot from storeinfo where [date]='"+g_date+"'"; if(m_mode) sql="select max(id) as cot from storeinfo2 where [date]='"+g_date+"'"; g_sendhead.bsql=1; g_pMainWnd->ProcessChatMessageRequest2(sql); if(g_bSendOK==0) { CDialog::OnCancel (); return false; } CString date=g_date; date.Replace ("-", ""); if(m_mode==0) m_id.Format ("%s-(rk)%03d", date, g_ncount+1); else { m_id.Format ("%s-(ck)%03d", date, g_ncount+1); GetDlgItem(IDC_STATIC1)->SetWindowText("出库资料"); SetWindowText("出库单"); } UpdateData(false); g_sendhead.bsql=0; g_sendhead.code[0]=8; g_sendhead.code[1]=2; g_sendhead.tabcount=2; CString filter="hide<>'下架' or hide is null;"; g_pMainWnd->ProcessChatMessageRequest2(filter); if(g_bSendOK==0) { CDialog::OnCancel (); return false; } DataToArray(&m_List1array,&m_List2array); for(int i=0; iProcessChatMessageRequest2(sql);if(g_bSendOK==0)return; AfxMessageBox("保存成功!", MB_ICONINFORMATION); //////////////////// sql="select max(id) as cot from storeinfo where [date]='"+g_date+"'"; if(m_mode) sql="select max(id) as cot from storeinfo2 where [date]='"+g_date+"'"; g_sendhead.bsql=1; g_pMainWnd->ProcessChatMessageRequest2(sql); if(g_bSendOK==0) { CDialog::OnCancel (); return; } CString date=g_date; date.Replace ("-", ""); if(m_mode==0) m_id.Format ("%s-(rk)%03d", date, g_ncount+1); else { m_id.Format ("%s-(ck)%03d", date, g_ncount+1); } m_comboname.SetCurSel(-1); m_count = _T(""); m_remark = _T(""); UpdateData(false); // CDialog::OnOK(); }