📄 modplandlg.cpp
字号:
// ModPlanDlg.cpp : implementation file
//
#include "stdafx.h"
#include "ordermanagement.h"
#include "ModPlanDlg.h"
#include "ADOConn.h"
#include "MakeEditDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// ModPlanDlg dialog
ModPlanDlg::ModPlanDlg(CWnd* pParent /*=NULL*/)
: CDialog(ModPlanDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(ModPlanDlg)
m_str1 = _T("");
m_str2 = _T("");
m_str3 = _T("");
m_str4 = _T("");
m_str5 = _T("");
m_str6 = _T("");
//}}AFX_DATA_INIT
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void ModPlanDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(ModPlanDlg)
DDX_Text(pDX, IDC_EDIT1, m_str1);
DDX_Text(pDX, IDC_EDIT2, m_str2);
DDX_Text(pDX, IDC_EDIT3, m_str3);
DDX_Text(pDX, IDC_EDIT4, m_str4);
DDX_Text(pDX, IDC_EDIT5, m_str5);
DDX_Text(pDX, IDC_EDIT6, m_str6);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(ModPlanDlg, CDialog)
//{{AFX_MSG_MAP(ModPlanDlg)
ON_WM_CTLCOLOR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// ModPlanDlg message handlers
MakeEditDlg *pPl;
BOOL ModPlanDlg::OnInitDialog()
{
CDialog::OnInitDialog();
//添加窗口图标
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
m_str1 = s[0];
m_str2 = s[1];
m_str3 = s[2];
m_str4 = s[3];
m_str5 = s[4];
m_str6 = s[5];
UpdateData(false);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void ModPlanDlg::OnOK()
{
UpdateData(true);
ADOConn mPconn;
_bstr_t mSQL;
try{
//如果Concection对象为空,则重新连接
if(mPconn.m_pConn == NULL)
mPconn.OnInitADOConn();
if(MessageBox("是否确定更改?","请确认",MB_YESNO) == IDYES)
{
mSQL ="UPDATE PlanFormMessage SET produceNum='"+m_str4+"',limitedTime='"+m_str5+"' WHERE planID='"+m_str1+"'";
if(mPconn.ExecuteSQL(mSQL))
{
AfxMessageBox("更改成功!");
CDialog::OnOK();
MakeEditDlg *p;
/* p->m_nSearch = -1;
p->m_nSort = -1;
p->m_kstr = "";
p->UpdateData(false);
*/ p->m_nSechType = 0;
p->oSBindList();
}
}
}
catch(_com_error e)
{
AfxMessageBox(e.ErrorMessage());
}
CDialog::OnOK();
}
HBRUSH ModPlanDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
//HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
COLORREF backColor = RGB(231, 231, 231); //office 2003背景色
pDC->SetBkMode(TRANSPARENT); //设置控件背景透明
return CreateSolidBrush(backColor); //创建背景刷子
// TODO: Return a different brush if the default is not desired
//return hbr;
//HBRUSH hbr = CDialog::OnCtlColor(pDC,pWnd,nCtlColor);
//pDC->SetBkMode(TRANSPARENT);
//return (HBRUSH)GetStockObject(NULL_BRUSH);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -