?? rephinfodlg.cpp
字號:
// RepHInfoDlg.cpp : implementation file
//
#include "stdafx.h"
#include "tvnews.h"
#include "RepHInfoDlg.h"
#include "News.h"
#include "Channel.h"
#include "Column.h"
#include "NewsAudit.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRepHInfoDlg dialog
extern CTVNewsApp theApp;
CRepHInfoDlg::CRepHInfoDlg(CWnd* pParent /*=NULL*/)
: CDialog(CRepHInfoDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CRepHInfoDlg)
m_strPass = _T("");
m_strSent = _T("");
m_strTitle = _T("");
m_strDesc = _T("");
m_strState = _T("");
m_nFileSize = 0;
m_strFileName = _T("");
m_strColumn = _T("");
m_strChannel = _T("");
m_strZRDesc = _T("");
m_strTZDesc = _T("");
m_strZJDesc = _T("");
m_strReporter = _T("");
//}}AFX_DATA_INIT
}
void CRepHInfoDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRepHInfoDlg)
DDX_Control(pDX, IDC_EDITHINFO_TZDESC, m_TZDesc);
DDX_Control(pDX, IDC_EDITHINFO_ZJDESC, m_ZJDesc);
DDX_Control(pDX, IDC_EDITHINFO_ZRDESC, m_ZRDesc);
DDX_Text(pDX, IDC_EDITHINFO_PASS, m_strPass);
DDX_Text(pDX, IDC_EDITHINFO_SENT, m_strSent);
DDX_Text(pDX, IDC_EDITHINFO_TITLE, m_strTitle);
DDX_Text(pDX, IDC_EDITHINFO_DESC, m_strDesc);
DDX_Text(pDX, IDC_EDITHINFO_STATE, m_strState);
DDX_Text(pDX, IDC_EDITHINFO_FILESIZE, m_nFileSize);
DDX_Text(pDX, IDC_EDITHINFO_FILENAME, m_strFileName);
DDX_Text(pDX, IDC_EDITHINFO_COLUMN, m_strColumn);
DDX_Text(pDX, IDC_EDITHINFO_CHANNEL, m_strChannel);
DDX_Text(pDX, IDC_EDITHINFO_ZRDESC, m_strZRDesc);
DDX_Text(pDX, IDC_EDITHINFO_TZDESC, m_strTZDesc);
DDX_Text(pDX, IDC_EDITHINFO_ZJDESC, m_strZJDesc);
DDX_Text(pDX, IDC_EDITHINFO_REPORTER, m_strReporter);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CRepHInfoDlg, CDialog)
//{{AFX_MSG_MAP(CRepHInfoDlg)
ON_BN_CLICKED(IDC_BTNCANCEL_RINFO, OnBtncancelRinfo)
ON_BN_CLICKED(IDC_BTNCANCEL_RINFO3, OnBtncancelRinfo3)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRepHInfoDlg message handlers
BOOL CRepHInfoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
user=theApp.m_user;
if(2==user.GetRoleID())
{
m_ZRDesc.EnableWindow(TRUE);
}
if(3==user.GetRoleID())
{
m_ZJDesc.EnableWindow(TRUE);
}
if(4==user.GetRoleID())
{
m_TZDesc.EnableWindow(TRUE);
}
news.GetData(newsID);
m_strTitle=news.GetTitle();
//改成評審意見
CNewsAudit newsAudit;
m_strZRDesc=newsAudit.GetDesc(newsID,2);
m_strZJDesc=newsAudit.GetDesc(newsID,3);
m_strTZDesc=newsAudit.GetDesc(newsID,4);
m_strPass=news.GetPassTime();
m_strSent=news.GetSendTime();
m_strFileName=news.GetFileName();
m_nFileSize=news.GetFileSize();
m_strDesc=news.GetDesc();
if(0==news.GetState())
{
m_strState="審核通過";
}
else if(1==news.GetState())
{
m_strState="待審核";
}
else if(2==news.GetState())
{
m_strState="審核未通過";
}
else if(3==news.GetState())
{
m_strState="審核中";
}
int iChannelID=news.GetChannelID();
CChannel channel;
channel.GetData(iChannelID);
m_strChannel=channel.GetName();
int iColumnID=news.GetColumnID();
CColumn column;
column.GetData(iColumnID);
m_strColumn=column.GetName();
int iUserID=news.GetUserID();
CUsers Users;
Users.GetData(iUserID);
m_strReporter=Users.GetName();
UpdateData(false);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CRepHInfoDlg::OnBtncancelRinfo()
{
// TODO: Add your control notification handler code here
if(1==user.GetRoleID())
{
CDialog::OnOK();
}
else
{
CString strDesc;
UpdateData(true);
if(2==user.GetRoleID())
{
strDesc = m_strZRDesc;
}
if(3==user.GetRoleID())
{
strDesc = m_strZJDesc;
}
if(4==user.GetRoleID())
{
strDesc = m_strTZDesc;
}
strDesc.TrimRight();
strDesc.TrimLeft();
CNewsAudit NewsAudit;
long iFlg;
CString cMessage;
NewsAudit.EdtAudit(newsID,theApp.m_user.GetUID(),strDesc,iFlg,cMessage);
if(0==iFlg)
{
MessageBox(cMessage);
}
else
{
CDialog::OnOK();
}
}
}
BOOL CRepHInfoDlg::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_BTNCANCEL_RINFO)
{
OnBtncancelRinfo();
}
else if(pWnd->GetDlgCtrlID()==IDC_BTNCANCEL_RINFO3)
{
OnBtncancelRinfo3();
}
else
{
NextDlgCtrl();
return true;
}
}
}
return CDialog::PreTranslateMessage(pMsg);
}
void CRepHInfoDlg::OnBtncancelRinfo3()
{
// TODO: Add your control notification handler code here
CDialog::OnCancel();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -