StoreHouseEditDlg.cpp
资源名称:SQLVC.rar [点击查看]
上传用户:biney012
上传日期:2022-05-09
资源大小:4592k
文件大小:1k
源码类别:
数据库系统
开发平台:
Visual C++
- // StoreHouseEditDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "Stock.h"
- #include "StoreHouseEditDlg.h"
- #include "Storehouse.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CStoreHouseEditDlg dialog
- CStoreHouseEditDlg::CStoreHouseEditDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CStoreHouseEditDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CStoreHouseEditDlg)
- m_Memo = _T("");
- m_Sname = _T("");
- //}}AFX_DATA_INIT
- }
- void CStoreHouseEditDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CStoreHouseEditDlg)
- DDX_Text(pDX, IDC_MEMO_EDIT, m_Memo);
- DDX_Text(pDX, IDC_SNAME_EDIT, m_Sname);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CStoreHouseEditDlg, CDialog)
- //{{AFX_MSG_MAP(CStoreHouseEditDlg)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CStoreHouseEditDlg message handlers
- void CStoreHouseEditDlg::OnOK()
- {
- // TODO: Add extra validation here
- UpdateData(TRUE);
- if (m_Sname == "")
- {
- MessageBox("请输入仓库名称");
- return;
- }
- CStorehouse sh;
- sh.SetSname(m_Sname); //仓库名称
- sh.SetMemo(m_Memo); //仓库说明
- if (cSid == "") //表示插入新记录
- sh.sql_insert();
- else
- sh.sql_update(cSid);
- CDialog::OnOK();
- }