⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 actorinfdlg.cpp

📁 一个电视台专用的信息管理软件源代码
💻 CPP
字号:
// ActorInfDlg.cpp : implementation file
//

#include "stdafx.h"
#include "tvnews.h"
#include "ActorInfDlg.h"
#include "Role.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CActorInfDlg dialog


CActorInfDlg::CActorInfDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CActorInfDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CActorInfDlg)
	m_Name = _T("");
	m_Desc = _T("");
	//}}AFX_DATA_INIT
}


void CActorInfDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CActorInfDlg)
	DDX_Text(pDX, IDC_EDIT1, m_Name);
	DDX_Text(pDX, IDC_EDIT3, m_Desc);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CActorInfDlg, CDialog)
	//{{AFX_MSG_MAP(CActorInfDlg)
	ON_BN_CLICKED(IDC_BTNUPDATE_RINFO4, OnBtnupdateRinfo4)
	ON_BN_CLICKED(IDC_BTNUPDATE_RINFO5, OnBtnupdateRinfo5)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CActorInfDlg message handlers

BOOL CActorInfDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	if(Type==1)
	{
		CRole Role;
		
		Role.GetData(iUID);
		CString cName = Role.GetName();
		m_Name=_T(cName);		
		m_Desc=_T(Role.GetDesc());
		
		UpdateData(false);
	
	}
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CActorInfDlg::OnBtnupdateRinfo4() 
{
	// TODO: Add your control notification handler code here
	CRole Role;
	UpdateData();
	long iFlg;
	CString cMessage;
	m_Name.TrimRight();
	m_Name.TrimLeft();
	Role.SetName(m_Name);
	m_Desc.TrimRight();
	m_Desc.TrimLeft();
	Role.SetDesc(m_Desc);

	if(Type==0)
	{

//		Role.sql_insert(Role.GetName(),Role.GetDesc(),iFlg,cMessage);
	}
	else
	{

		Role.sql_update(iUID,Role.GetName(),Role.GetDesc(),iFlg,cMessage);
	}
	if(1==iFlg)
	{

		CDialog::OnOK();
	}
	else
	{
		MessageBox(cMessage);
	}
	
}

void CActorInfDlg::OnBtnupdateRinfo5() 
{
	// TODO: Add your control notification handler code here
	CDialog::OnCancel();
	
}

BOOL CActorInfDlg::PreTranslateMessage(MSG* pMsg) 
{
	// TODO: Add your specialized code here and/or call the base class
	if(pMsg->message   ==   WM_KEYDOWN)   
     {   
           if(pMsg->wParam   ==   VK_RETURN)   
           {   
			    CWnd   *pWnd   =   GetFocus();   
                if(pWnd->GetDlgCtrlID()==IDC_BTNUPDATE_RINFO4)
				{
					OnBtnupdateRinfo4();
				}
				else if(pWnd->GetDlgCtrlID()==IDC_BTNUPDATE_RINFO5)
				{
					OnBtnupdateRinfo5();
				}
				else
				{
					NextDlgCtrl();

					return true;
				}
            }   
       } 
	
	return CDialog::PreTranslateMessage(pMsg);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -