123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- #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::SetRate2(CWnd* pParent )
- : CDialog(SetRate2::IDD, pParent)
- {
-
- m_data1 = _T("");
-
- }
- void SetRate2::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
-
- DDX_Control(pDX, IDC_COMBO2, m_combo2);
- DDX_Control(pDX, IDC_EDIT1, m_editnum1);
- DDX_Text(pDX, IDC_EDIT1, m_data1);
-
- }
- BEGIN_MESSAGE_MAP(SetRate2, CDialog)
-
- ON_CBN_SELCHANGE(IDC_COMBO2, OnSelchangeCombo2)
- ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
- ON_WM_CTLCOLOR()
-
- END_MESSAGE_MAP()
- BOOL SetRate2::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- 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;
- CArray<CStringArray, CStringArray>m_List1array;
- DataToArray(&g_List1array, &m_List1array);
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- m_combo2.AddString(m_List1array.ElementAt(i).ElementAt(0));
- }
-
- CenterWindow();
- CString str;
- str = "\r\n\r\n 1. 先点设置按钮对工作内容进行设置(如修片,设计相册,装框等..)\r\n 2. 选择每一项工作内容,设置提成后点保存";
- GetDlgItem(IDC_STATIC2)->SetWindowText(str);
- return TRUE;
-
- }
- void SetRate2::OnOK()
- {
-
- 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);
-
- }
- void SetRate2::OnSelchangeCombo2()
- {
-
- 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; i < g_List1array.GetSize(); i++)
- {
- if (g_List1array.ElementAt(i).ElementAt(1) == worktype)
- {
- m_data1 = g_List1array.ElementAt(i).ElementAt(2);
- UpdateData(false);
- return;
- }
- }
- m_data1 = "";
- UpdateData(false);
- }
- void SetRate2::OnButton2()
- {
-
- SPLBDlg dlg;
- dlg.m_mode = 5;
- dlg.DoModal();
- 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;
- CArray<CStringArray, CStringArray>m_List1array;
- DataToArray(&g_List1array, &m_List1array);
- m_combo2.ResetContent();
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- m_combo2.AddString(m_List1array.ElementAt(i).ElementAt(0));
- }
- }
- HBRUSH SetRate2::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
- {
- HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
-
- if (nCtlColor == CTLCOLOR_STATIC && pWnd->GetDlgCtrlID() == IDC_STATIC2)
- {
- pDC->SetBkMode(TRANSPARENT);
- return (HBRUSH)::GetStockObject(WHITE_BRUSH);
- }
-
- return hbr;
- }
|