// UploadDes.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "UploadDes.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // UploadDes dialog UploadDes::UploadDes(CWnd* pParent /*=NULL*/) : CDialog(UploadDes::IDD, pParent) { //{{AFX_DATA_INIT(UploadDes) // NOTE: the ClassWizard will add member initialization here m_mode=0; //}}AFX_DATA_INIT } void UploadDes::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(UploadDes) DDX_Control(pDX, IDC_LIST1, m_list1); DDX_Control(pDX, IDC_COMBO2, m_combodes); DDX_Control(pDX, IDC_COMBO1, m_combofrom); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(UploadDes, CDialog) //{{AFX_MSG_MAP(UploadDes) ON_BN_CLICKED(IDC_BUTTON1, OnButton1) ON_BN_CLICKED(IDC_BUTTON2, OnButton2) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // UploadDes message handlers BOOL UploadDes::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here m_rule= g_cominfoarray.ElementAt(0).ElementAt(116); if(m_mode==0) { m_header="type0@:"; SetWindowText("自动传片设置-原片"); } else if(m_mode==1) { m_header="type1@:"; SetWindowText("自动传片设置-初修片"); } else if(m_mode==2) { m_header="type2@:"; SetWindowText("自动传片设置-精修片"); } else if(m_mode==3) { m_header="type3@:"; SetWindowText("自动传片设置-设计片"); } int pos=m_rule.Find (m_header); if(pos!=-1) { m_left=m_rule.Left (pos); //MessageBox(m_left); m_rule=m_rule.Right (m_rule.GetLength ()-pos); m_rule.Delete (0, m_header.GetLength ()); pos=m_rule.Find ("@:"); if(pos!=-1) { m_right=m_rule.Right (m_rule.GetLength ()-pos+5);//MessageBox(m_right); m_rule=m_rule.Left (pos-5); } m_currule=m_rule;m_rule.Empty (); m_currule.TrimLeft ("%$"); m_currule.TrimRight ("%$"); if(m_currule.Find ("%$")!=-1) { pos=m_currule.Find ("%$"); while(pos!=-1) { if(m_currule.Left (pos)!="") m_list1.AddString(m_currule.Left (pos)); m_currule=m_currule.Right (m_currule.GetLength ()-pos-2); pos=m_currule.Find ("%$"); } } if(m_currule!="")m_list1.AddString(m_currule); } // m_currule for(int i=0; iProcessChatMessageRequest2(sql);if(g_bSendOK==0)return; AfxMessageBox("保存成功!", MB_ICONINFORMATION); g_cominfoarray.ElementAt(0).SetAt (116, m_rule); CDialog::OnOK(); } void UploadDes::OnButton1() { // TODO: Add your control notification handler code here CString str,from,des; int pos=m_combofrom.GetCurSel (); if(pos==-1) { AfxMessageBox("请先选中项目!", MB_ICONINFORMATION); return; } m_combofrom.GetLBText (pos, from); pos=m_combodes.GetCurSel (); if(pos==-1) { AfxMessageBox("请先选中项目!", MB_ICONINFORMATION); return; } m_combodes.GetLBText (pos, des); int i = 0; for( i=0; i"+des) ) { AfxMessageBox("已有此规则!", MB_ICONINFORMATION); return; } } for( i=0; i")!=-1) { if(AfxMessageBox("警告: 传向多个分店将影响速度, 是否继续?", MB_YESNO|MB_ICONSTOP)!=IDYES)return; break; } } m_list1.AddString (from+"->"+des); } // void UploadDes::OnButton2() { // TODO: Add your control notification handler code here int pos=m_list1.GetCurSel (); if(pos==-1) { AfxMessageBox("请先选中项目!", MB_ICONINFORMATION); return; } m_list1.DeleteString (pos); }