// SetRate2.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "SetRate2.h" #include "SPLBDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // SetRate2 dialog SetRate2::SetRate2(CWnd* pParent /*=NULL*/) : CDialog(SetRate2::IDD, pParent) { //{{AFX_DATA_INIT(SetRate2) m_data1 = _T(""); //}}AFX_DATA_INIT } void SetRate2::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(SetRate2) DDX_Control(pDX, IDC_COMBO2, m_combo2); DDX_Control(pDX, IDC_EDIT1, m_editnum1); DDX_Text(pDX, IDC_EDIT1, m_data1); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(SetRate2, CDialog) //{{AFX_MSG_MAP(SetRate2) ON_CBN_SELCHANGE(IDC_COMBO2, OnSelchangeCombo2) ON_BN_CLICKED(IDC_BUTTON2, OnButton2) ON_WM_CTLCOLOR() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // SetRate2 message handlers BOOL SetRate2::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here if(IsHasRights2new(49)==0) { GetDlgItem(IDC_BUTTON2)->EnableWindow(0); } g_sendhead.bsql=0; g_sendhead.code[0]=146; g_sendhead.code[1]=159; g_sendhead.tabcount=2; CString sql; sql="type='数码师';"; g_pMainWnd->ProcessChatMessageRequest2(sql); if(g_bSendOK==0)return 1; CArraym_List1array; DataToArray(&g_List1array,&m_List1array); for(int i=0; iSetWindowText(str); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void SetRate2::OnOK() { // TODO: Add extra validation here UpdateData(); CString worktype; int pos=m_combo2.GetCurSel (); if(pos!=-1) m_combo2.GetLBText (pos, worktype); else worktype.Empty (); if(worktype.IsEmpty ()) { AfxMessageBox("资料不全!", MB_ICONINFORMATION); return; } CString sql; sql.Format ("delete from workrate where type='数码师' and data1='%s'***insert into workrate([type],[data1],[data2])values('%s','%s','%s')", worktype, "数码师", worktype, m_data1); g_sendhead.bsql=1; g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return; AfxMessageBox("保存成功!", MB_ICONINFORMATION); g_sendhead.bsql=0; g_sendhead.code[0]=146; g_sendhead.tabcount=1; sql="type='数码师'"; g_pMainWnd->ProcessChatMessageRequest2(sql); if(g_bSendOK==0)return; DataToArray(&g_List1array); // CDialog::OnOK(); } void SetRate2::OnSelchangeCombo2() { // TODO: Add your control notification handler code here CString worktype; int pos=m_combo2.GetCurSel (); if(pos!=-1) m_combo2.GetLBText (pos, worktype); else worktype.Empty (); if(worktype.IsEmpty ()) { return; } for(int i=0; iProcessChatMessageRequest2(sql); if(g_bSendOK==0)return; CArraym_List1array; DataToArray(&g_List1array,&m_List1array); m_combo2.ResetContent (); for(int i=0; iGetDlgCtrlID ()==IDC_STATIC2) { pDC-> SetBkMode(TRANSPARENT); //设置字体背景为透明 return (HBRUSH)::GetStockObject(WHITE_BRUSH); // 设置背景色 } // TODO: Return a different brush if the default is not desired return hbr; }