123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733 |
- // MsgSet.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "MsgSet.h"
- #include "PhoneMsgSet.h"
- #include "SetChildMsg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // MsgSet dialog IDC_EDITbalance
- MsgSet::MsgSet(CWnd* pParent /*=NULL*/)
- : CDialog(MsgSet::IDD, pParent)
- {
- //{{AFX_DATA_INIT(MsgSet)
- m_account = _T("");
- m_psw = _T("");
- m_balance = _T("");
- m_used = _T("");
- m_check1 = FALSE;
- m_msgsendtype = 0;
- m_check2 = FALSE;
- m_days1 = 0;
- m_days2 = 0;
- m_check3 = FALSE;
- m_msgcontent5 = _T("");
- m_msgcheck5 = FALSE;
- m_msgcheck13 = FALSE;
- m_msgcheck14 = FALSE;
- m_msgcheck15 = FALSE;
- m_msgcheck16 = FALSE;
- m_msgcheck17 = FALSE;
- m_msgcheck11 = FALSE;
- m_msgcheck12 = FALSE;
- m_msgcontent6 = _T("");
- m_content1 = _T("xxx先生/女士");
- m_content2 = _T("xxx先生/女士");
- m_content3 = _T("xxx先生/女士");
- m_msgcontent11 = _T("xxx先生/女士");
- m_msgcontent12 = _T("xxx先生/女士");
- m_msgcontent13 = _T("xxx先生/女士");
- m_msgcontent14 = _T("xxx先生/女士");
- m_msgcontent15 = _T("xxx先生/女士");
- m_msgcontent17 = _T("xxx先生/女士");
- m_msgcheck6 = FALSE;
- m_msgcheck7 = FALSE;
- m_check4 = FALSE;
- m_phones = _T("");
- m_msgphones2 = _T("");
- m_time = 22;
- m_companyname = _T("");
- //}}AFX_DATA_INIT
- #ifdef CHILD_VERSION
- m_content1 = _T("xxx小朋友");
- m_content2 = _T("xxx小朋友");
- m_content3 = _T("");
- m_msgcontent11 = _T("");
- m_msgcontent12 = _T("");
- m_msgcontent13 = _T("");
- m_msgcontent14 = _T("");
- m_msgcontent15 = _T("");
- m_msgcontent17 = _T("");
- #endif
- m_bMsgNotFinish=0;
- }
-
- void MsgSet::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(MsgSet)
- DDX_Control(pDX, IDC_SPIN4, m_spin4);
- DDX_Control(pDX, IDC_SPIN2, m_spin2);
- DDX_Control(pDX, IDC_SPIN1, m_spin1);
- DDX_Text(pDX, IDC_EDITaccount, m_account);
- DDX_Text(pDX, IDC_EDITpsw, m_psw);
- DDX_Text(pDX, IDC_EDITbalance, m_balance);
- DDX_Text(pDX, IDC_EDITused, m_used);
- DDX_Check(pDX, IDC_CHECK1, m_check1);
- DDX_Check(pDX, IDC_CHECK7, m_msgcheck7);
- DDX_Radio(pDX, IDC_RADIO1, m_msgsendtype);
- DDX_Check(pDX, IDC_CHECK2, m_check2);
- DDX_Text(pDX, IDC_EDITdays1, m_days1);
- DDX_Text(pDX, IDC_EDITdays2, m_days2);
- DDX_Text(pDX, IDC_EDITcontent1, m_content1);
- DDV_MaxChars(pDX, m_content1, 1000);
- DDX_Text(pDX, IDC_EDITcontent2, m_content2);
- DDV_MaxChars(pDX, m_content2, 1000);
- DDX_Check(pDX, IDC_CHECK3, m_check3);
- DDX_Check(pDX, IDC_CHECK11, m_msgcheck11);
- DDX_Check(pDX, IDC_CHECK12, m_msgcheck12);
- DDX_Check(pDX, IDC_CHECK13, m_msgcheck13);
- DDX_Check(pDX, IDC_CHECK14, m_msgcheck14);
- DDX_Check(pDX, IDC_CHECK15, m_msgcheck15);
- DDX_Check(pDX, IDC_CHECK16, m_msgcheck17);
- DDX_Check(pDX, IDC_CHECK8, m_msgcheck16);
- DDX_Text(pDX, IDC_EDITcontent3, m_content3);
- DDV_MaxChars(pDX, m_content3, 1000);
- DDX_Text(pDX, IDC_EDITcontent7, m_msgcontent5);
- DDV_MaxChars(pDX, m_msgcontent5, 1000);
- DDX_Check(pDX, IDC_CHECK5, m_msgcheck5);
- DDX_Text(pDX, IDC_EDITcontent8, m_msgcontent6);
- DDV_MaxChars(pDX, m_msgcontent6, 1000);
- DDX_Text(pDX, IDC_EDITcontent11, m_msgcontent11);
- DDV_MaxChars(pDX, m_msgcontent11, 1000);
- DDX_Text(pDX, IDC_EDITcontent12, m_msgcontent12);
- DDV_MaxChars(pDX, m_msgcontent12, 1000);
- DDX_Text(pDX, IDC_EDITcontent13, m_msgcontent13);
- DDV_MaxChars(pDX, m_msgcontent13, 1000);
- DDX_Text(pDX, IDC_EDITcontent14, m_msgcontent14);
- DDV_MaxChars(pDX, m_msgcontent14, 1000);
- DDX_Text(pDX, IDC_EDITcontent15, m_msgcontent15);
- DDV_MaxChars(pDX, m_msgcontent15, 1000);
- DDX_Text(pDX, IDC_EDITcontent16, m_msgcontent17);
- DDV_MaxChars(pDX, m_msgcontent17, 1000);
- DDX_Check(pDX, IDC_CHECK6, m_msgcheck6);
- DDX_Check(pDX, IDC_CHECK4, m_check4);
- DDX_Text(pDX, IDC_EDITcontent4, m_phones);
- DDX_Text(pDX, IDC_EDITcontent6, m_msgphones2);
- DDV_MaxChars(pDX, m_phones, 1000);
- DDV_MaxChars(pDX, m_msgphones2, 1000);
- DDX_Text(pDX, IDC_EDITdays3, m_time);
- DDX_Text(pDX, IDC_EDITcontent5, m_companyname);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(MsgSet, CDialog)
- //{{AFX_MSG_MAP(MsgSet)
- ON_EN_CHANGE(IDC_EDITcontent1, OnChangeEDITcontent1)
- ON_EN_CHANGE(IDC_EDITcontent2, OnChangeEDITcontent2)
- ON_EN_CHANGE(IDC_EDITcontent3, OnChangeEDITcontent3)
- ON_EN_CHANGE(IDC_EDITcontent11, OnChangeEDITcontent11)
- ON_EN_CHANGE(IDC_EDITcontent12, OnChangeEDITcontent12)
- ON_EN_CHANGE(IDC_EDITcontent13, OnChangeEDITcontent13)
- ON_EN_CHANGE(IDC_EDITcontent14, OnChangeEDITcontent14)
- ON_EN_CHANGE(IDC_EDITcontent15, OnChangeEDITcontent15)
- ON_EN_CHANGE(IDC_EDITcontent16, OnChangeEDITcontent17)
- ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
- ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
- ON_BN_CLICKED(IDC_CHECK7, OnCheck7)
- ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // MsgSet message handlers
- void MsgSet::OnOK()
- {
- // TODO: Add extra validation here
- UpdateData();
- m_account.TrimLeft ();
- m_account.TrimRight ();
- m_psw.TrimLeft ();
- m_psw.TrimRight ();
- if(m_account.IsEmpty ()||m_psw.IsEmpty ())
- {
- AfxMessageBox("账号或密码不能为空!");
- return;
- }
- m_content1.TrimLeft ();
- m_content1.TrimRight ();
- m_content2.TrimLeft ();
- m_content2.TrimRight ();
- m_content3.TrimLeft ();
- m_content3.TrimRight ();
- m_msgcontent11.TrimLeft ();
- m_msgcontent11.TrimRight ();
- m_msgcontent12.TrimLeft ();
- m_msgcontent12.TrimRight ();
- m_msgcontent13.TrimLeft ();
- m_msgcontent13.TrimRight ();
- m_msgcontent14.TrimLeft ();
- m_msgcontent14.TrimRight ();
- m_msgcontent15.TrimLeft ();
- m_msgcontent15.TrimRight ();
- m_msgcontent17.TrimLeft ();
- m_msgcontent17.TrimRight ();
- m_msgcontent5.TrimLeft ();
- m_msgcontent5.TrimRight ();
- m_companyname.TrimLeft ();
- m_companyname.TrimRight ();
- if(CheckBadWords(m_content1)==0 || CheckBadWords2(m_content1)==0)
- {
- AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
- return;
- }
- if(CheckBadWords(m_content2)==0 || CheckBadWords2(m_content2)==0)
- {
- AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
- return;
- }
- if(CheckBadWords(m_content3)==0 || CheckBadWords2(m_content3)==0)
- {
- AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
- return;
- }
- if(CheckBadWords(m_msgcontent11)==0 || CheckBadWords2(m_msgcontent11)==0)
- {
- AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
- return;
- }
- if(CheckBadWords(m_msgcontent12)==0 || CheckBadWords2(m_msgcontent12)==0)
- {
- AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
- return;
- }
- if(CheckBadWords(m_msgcontent13)==0 || CheckBadWords2(m_msgcontent13)==0)
- {
- AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
- return;
- }
- if(CheckBadWords(m_msgcontent14)==0 || CheckBadWords2(m_msgcontent14)==0)
- {
- AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
- return;
- }
- if(CheckBadWords(m_msgcontent15)==0 || CheckBadWords2(m_msgcontent15)==0)
- {
- AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
- return;
- }
- if(CheckBadWords(m_companyname)==0 || CheckBadWords2(m_companyname)==0)
- {
- AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
- return;
- }
- if(CheckBadWords(m_msgcontent6)==0 || CheckBadWords2(m_msgcontent6)==0)
- {
- AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
- return;
- }
- if(CheckBadWords(m_msgcontent5)==0 || CheckBadWords2(m_msgcontent5)==0)
- {
- AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
- return;
- }
- m_phones.TrimLeft ();
- m_phones.TrimRight ();
- m_phones.Replace (",", ",");
- m_msgphones2.TrimLeft ();
- m_msgphones2.TrimRight ();
- m_msgphones2.Replace (",", ",");
- #ifdef CHILD_VERSION
- m_content1.Replace("xxx先生/女士", "xxx小朋友");
- m_content2.Replace("xxx先生/女士", "xxx小朋友");
- m_content3.Replace("xxx先生/女士", "");
- m_msgcontent11.Replace("xxx先生/女士", "");
- m_msgcontent12.Replace("xxx先生/女士", "");
- m_msgcontent13.Replace("xxx先生/女士", "");
- m_msgcontent14.Replace("xxx先生/女士", "");
- m_msgcontent15.Replace("xxx先生/女士", "");
- m_content3.Replace("xxx小朋友", "");
- m_msgcontent11.Replace("xxx小朋友", "");
- m_msgcontent12.Replace("xxx小朋友", "");
- m_msgcontent13.Replace("xxx小朋友", "");
- m_msgcontent14.Replace("xxx小朋友", "");
- m_msgcontent15.Replace("xxx小朋友", "");
- m_msgcontent17.Replace("xxx小朋友", "");
- if(m_content1.Find ("xxx小朋友")==-1)
- {
- m_content1="xxx小朋友"+m_content1;
- AfxMessageBox("祝福语不合规范!");
- UpdateData(false);
- return;
- }
- if(m_content2.Find ("xxx小朋友")==-1)
- {
- m_content2="xxx小朋友"+m_content2;
- AfxMessageBox("祝福语不合规范!");
- UpdateData(false);
- return;
- }
- #else
- m_content1.Replace("xxx小朋友", "xxx先生/女士");
- m_content2.Replace("xxx小朋友", "xxx先生/女士");
- m_content3.Replace("xxx小朋友", "xxx先生/女士");
- m_msgcontent11.Replace("xxx小朋友", "xxx先生/女士");
- m_msgcontent12.Replace("xxx小朋友", "xxx先生/女士");
- m_msgcontent13.Replace("xxx小朋友", "xxx先生/女士");
- m_msgcontent14.Replace("xxx小朋友", "xxx先生/女士");
- m_msgcontent15.Replace("xxx小朋友", "xxx先生/女士");
- m_msgcontent17.Replace("xxx小朋友", "xxx先生/女士");
- if(m_content1.Find ("xxx先生/女士")==-1)
- {
- m_content1="xxx先生/女士"+m_content1;
- AfxMessageBox("祝福语不合规范!");
- UpdateData(false);
- return;
- }
- if(m_content2.Find ("xxx先生/女士")==-1)
- {
- m_content2="xxx先生/女士"+m_content2;
- AfxMessageBox("祝福语不合规范!");
- UpdateData(false);
- return;
- }
- if(m_content3.Find ("xxx先生/女士")==-1)
- {
- m_content3="xxx先生/女士"+m_content3;
- AfxMessageBox("祝福语不合规范!");
- UpdateData(false);
- return;
- }
- if(m_msgcontent11.Find ("xxx先生/女士")==-1)
- {
- m_msgcontent11="xxx先生/女士"+m_msgcontent11;
- AfxMessageBox("祝福语不合规范!");
- UpdateData(false);
- return;
- }
- if(m_msgcontent12.Find ("xxx先生/女士")==-1)
- {
- m_msgcontent12="xxx先生/女士"+m_msgcontent12;
- AfxMessageBox("祝福语不合规范!");
- UpdateData(false);
- return;
- }
- if(m_msgcontent13.Find ("xxx先生/女士")==-1)
- {
- m_msgcontent13="xxx先生/女士"+m_msgcontent13;
- AfxMessageBox("祝福语不合规范!");
- UpdateData(false);
- return;
- }
- if(m_msgcontent14.Find ("xxx先生/女士")==-1)
- {
- m_msgcontent14="xxx先生/女士"+m_msgcontent14;
- AfxMessageBox("祝福语不合规范!");
- UpdateData(false);
- return;
- }
- if(m_msgcontent15.Find ("xxx先生/女士")==-1)
- {
- m_msgcontent15="xxx先生/女士"+m_msgcontent15;
- AfxMessageBox("祝福语不合规范!");
- UpdateData(false);
- return;
- }
- if(m_msgcontent17.Find ("xxx先生/女士")==-1)
- {
- m_msgcontent17="xxx先生/女士"+m_msgcontent17;
- AfxMessageBox("祝福语不合规范!");
- UpdateData(false);
- return;
- }
- #endif
- CString str=m_phones;
- if(str.IsEmpty ()==0)
- {
- int pos=str.Find (",");
- if(pos!=-1)
- {
- while(pos!=-1)
- {
- if(CheckPhoneType(str.Left (pos))==-1)
- {
- AfxMessageBox("手机号错误!");
- return;
- }
-
- str=str.Right (str.GetLength ()-pos-1);
- pos=str.Find (",");
- }
- if(CheckPhoneType(str)==-1)
- {
- AfxMessageBox("手机号错误!");
- return;
- }
- }
- else if(CheckPhoneType(str)==-1)
- {
- AfxMessageBox("手机号错误!");
- return;
- }
- }
- str=m_msgphones2;
- if(str.IsEmpty ()==0)
- {
- int pos=str.Find (",");
- if(pos!=-1)
- {
- while(pos!=-1)
- {
- if(CheckPhoneType(str.Left (pos))==-1)
- {
- AfxMessageBox("手机号错误!");
- return;
- }
-
- str=str.Right (str.GetLength ()-pos-1);
- pos=str.Find (",");
- }
- if(CheckPhoneType(str)==-1)
- {
- AfxMessageBox("手机号错误!");
- return;
- }
- }
- else if(CheckPhoneType(str)==-1)
- {
- AfxMessageBox("手机号错误!");
- return;
- }
- }
- CString sql;
- sql.Format("update version set [msgaccount]='"+m_account+"',[msgpsw]='"+m_psw+"',[msgcheck1]='%d',[msgcheck2]='%d',[msgcheck3]='%d',[msgcheck11]='%d',[msgcheck12]='%d',[msgcheck13]='%d',[msgcheck14]='%d',[msgcheck15]='%d',[msgcheck16]='%d',[msgcheck17]='%d',[msgdays1]='%d',[msgdays2]='%d',[msgcontent1]='"+m_content1+"',[msgcontent2]='"+m_content2+"',[msgcontent3]='"+m_content3+"',[msgcontent11]='"+m_msgcontent11+"',[msgcontent12]='"+m_msgcontent12+"',[msgcontent13]='"+m_msgcontent13+"',[msgcontent14]='"+m_msgcontent14+"',[msgcontent15]='"+m_msgcontent15+"',[msgcontent17]='"+m_msgcontent17+"',[msgcontent5]='"+m_msgcontent5+"',[msgcontent6]='"+m_msgcontent6+"',[msgcheck4]='%d',[msgcheck5]='%d',[msgcheck6]='%d',[msgcheck7]='%d',[msgtime]='%d',[msgphones]='"+m_phones+"',[msgphones2]='"+m_msgphones2+"',[msgcompanyname]='"+m_companyname+"',[msgsendtype]='%d'",m_check1, m_check2, m_check3, m_msgcheck11, m_msgcheck12, m_msgcheck13, m_msgcheck14, m_msgcheck15, m_msgcheck16, m_msgcheck17, m_days1, m_days2, m_check4, m_msgcheck5, m_msgcheck6, m_msgcheck7, m_time, m_msgsendtype);
-
- g_sendhead.bsql=1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- AfxMessageBox("保存成功!", MB_ICONINFORMATION);
- g_sendhead.bsql=0;
- g_sendhead.code[0]=24;
- g_sendhead.tabcount=1;
- int g_nYearposTemp=g_nYearpos;
- g_nYearpos=-1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos=g_nYearposTemp;
- if(g_bSendOK)
- DataToArray(&g_cominfoarray);
- CDialog::OnOK ();
- }
- BOOL MsgSet::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- CString filter="[status]<>'OK';";
- g_sendhead.bsql=0;
- g_sendhead.code[0]=67;
- g_sendhead.code[1]=24;
- g_sendhead.tabcount=2;
- int g_nYearposTemp=g_nYearpos;
- g_nYearpos=-1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- g_nYearpos=g_nYearposTemp;
- if(g_bSendOK==0)
- {
- CDialog::OnCancel ();
- return 1;
- }
- CArray<CStringArray, CStringArray>m_List1array;
- DataToArray(&m_List1array,&g_cominfoarray);
- if(m_List1array.GetSize ())m_bMsgNotFinish=1;
- m_account = g_cominfoarray.ElementAt(0).ElementAt(27);
- m_psw = g_cominfoarray.ElementAt(0).ElementAt(28);
- m_used = g_cominfoarray.ElementAt(0).ElementAt(29);
- m_balance = g_cominfoarray.ElementAt(0).ElementAt(30);
- m_check1 = atoi(g_cominfoarray.ElementAt(0).ElementAt(31));
- m_check2 = atoi(g_cominfoarray.ElementAt(0).ElementAt(32));
- m_days1 = atoi(g_cominfoarray.ElementAt(0).ElementAt(33));
- m_days2 = atoi(g_cominfoarray.ElementAt(0).ElementAt(34));
- m_content1 = g_cominfoarray.ElementAt(0).ElementAt(35);
- m_content2 = g_cominfoarray.ElementAt(0).ElementAt(36);
- m_check3 = atoi(g_cominfoarray.ElementAt(0).ElementAt(39));
- m_content3 = g_cominfoarray.ElementAt(0).ElementAt(40);
- m_check4 = atoi(g_cominfoarray.ElementAt(0).ElementAt(43));
- m_time = atoi(g_cominfoarray.ElementAt(0).ElementAt(44));
- m_phones = g_cominfoarray.ElementAt(0).ElementAt(45);
- m_companyname = g_cominfoarray.ElementAt(0).ElementAt(47);
- m_msgsendtype = atoi(g_cominfoarray.ElementAt(0).ElementAt(49));
- m_msgphones2 = g_cominfoarray.ElementAt(0).ElementAt(50);
- m_msgcheck5 = atoi(g_cominfoarray.ElementAt(0).ElementAt(51));
- m_msgcontent5 = g_cominfoarray.ElementAt(0).ElementAt(52);
- m_msgcheck6 = atoi(g_cominfoarray.ElementAt(0).ElementAt(53));
- m_msgcontent6 = g_cominfoarray.ElementAt(0).ElementAt(54);
- m_msgcheck7 = atoi(g_cominfoarray.ElementAt(0).ElementAt(88));
- m_msgcheck11 = atoi(g_cominfoarray.ElementAt(0).ElementAt(101));
- m_msgcheck12 = atoi(g_cominfoarray.ElementAt(0).ElementAt(102));
- m_msgcheck13 = atoi(g_cominfoarray.ElementAt(0).ElementAt(103));
- m_msgcheck14 = atoi(g_cominfoarray.ElementAt(0).ElementAt(104));
- m_msgcontent11 = g_cominfoarray.ElementAt(0).ElementAt(105);
- m_msgcontent12 = g_cominfoarray.ElementAt(0).ElementAt(106);
- m_msgcontent13 = g_cominfoarray.ElementAt(0).ElementAt(107);
- m_msgcontent14 = g_cominfoarray.ElementAt(0).ElementAt(108);
- m_msgcheck15 = atoi(g_cominfoarray.ElementAt(0).ElementAt(110));
- m_msgcheck16 = atoi(g_cominfoarray.ElementAt(0).ElementAt(122));
- m_msgcontent15 = g_cominfoarray.ElementAt(0).ElementAt(111);
- m_msgcheck17 = atoi(g_cominfoarray.ElementAt(0).ElementAt(128));
- m_msgcontent17 = g_cominfoarray.ElementAt(0).ElementAt(129);
- if(m_time==0)m_time=22;
- #ifdef CHILD_VERSION
- if(m_content1.IsEmpty())m_content1="xxx小朋友";
- if(m_content2.IsEmpty())m_content2="xxx小朋友";
- m_content1.Replace("xxx先生/女士", "xxx小朋友");
- m_content2.Replace("xxx先生/女士", "xxx小朋友");
- m_content3.Replace("xxx先生/女士", "");
- m_msgcontent11.Replace("xxx先生/女士", "");
- m_msgcontent12.Replace("xxx先生/女士", "");
- m_msgcontent13.Replace("xxx先生/女士", "");
- m_msgcontent14.Replace("xxx先生/女士", "");
- m_msgcontent15.Replace("xxx先生/女士", "");
- m_msgcontent17.Replace("xxx先生/女士", "");
- #else
- if(m_content1.IsEmpty())m_content1="xxx先生/女士";
- if(m_content2.IsEmpty())m_content2="xxx先生/女士";
- if(m_content3.IsEmpty())m_content3="xxx先生/女士";
- if(m_msgcontent11.IsEmpty())m_msgcontent11="xxx先生/女士";
- if(m_msgcontent12.IsEmpty())m_msgcontent12="xxx先生/女士";
- if(m_msgcontent13.IsEmpty())m_msgcontent13="xxx先生/女士";
- if(m_msgcontent14.IsEmpty())m_msgcontent14="xxx先生/女士";
- if(m_msgcontent15.IsEmpty())m_msgcontent15="xxx先生/女士";
- if(m_msgcontent17.IsEmpty())m_msgcontent17="xxx先生/女士";
- m_content1.Replace("xxx小朋友", "xxx先生/女士");
- m_content2.Replace("xxx小朋友", "xxx先生/女士");
- m_content3.Replace("xxx小朋友", "xxx先生/女士");
- m_msgcontent11.Replace("xxx小朋友", "xxx先生/女士");
- m_msgcontent12.Replace("xxx小朋友", "xxx先生/女士");
- m_msgcontent13.Replace("xxx小朋友", "xxx先生/女士");
- m_msgcontent14.Replace("xxx小朋友", "xxx先生/女士");
- m_msgcontent15.Replace("xxx小朋友", "xxx先生/女士");
- m_msgcontent17.Replace("xxx小朋友", "xxx先生/女士");
- #endif
- UpdateData(false);
- CenterWindow();
- m_spin1.SetRange (0, 100);
- m_spin2.SetRange (0, 100);
- m_spin4.SetRange (20, 24);
- return TRUE;
- }
- void MsgSet::OnChangeEDITcontent1()
- {
- UpdateData();
- m_content1.Replace ("'", "'");
- m_content1.Replace ("(", "(");
- m_content1.Replace (")", ")");
- UpdateData(false);
- CString str;
- int count=0;
- int leng=GetLengthEx(m_content1);
- count+=(leng/MSG_LENGTH);
- if(leng%MSG_LENGTH)
- count+=1;
- str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH, leng,count);
- GetDlgItem(IDC_STATIC1)->SetWindowText(str);
- }
- void MsgSet::OnChangeEDITcontent2()
- {
- UpdateData();
- m_content2.Replace ("'", "'");
- m_content2.Replace ("(", "(");
- m_content2.Replace (")", ")");
- UpdateData(false);
- CString str;
- int count=0;
- int leng=GetLengthEx(m_content2);
- count+=(leng/MSG_LENGTH);
- if(leng%MSG_LENGTH)
- count+=1;
- str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
- GetDlgItem(IDC_STATIC2)->SetWindowText(str);
- }
- void MsgSet::OnChangeEDITcontent3()
- {
- UpdateData();
- m_content3.Replace ("'", "'");
- m_content3.Replace ("(", "(");
- m_content3.Replace (")", ")");
- UpdateData(false);
- CString str;
- int count=0;
- int leng=GetLengthEx(m_content3);
- count+=(leng/MSG_LENGTH);
- if(leng%MSG_LENGTH)
- count+=1;
- str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
- GetDlgItem(IDC_STATIC3)->SetWindowText(str);
- }
-
- void MsgSet::OnRadio1()
- {
- BOOL bTemp=m_msgsendtype;
- UpdateData();
- if(m_bMsgNotFinish && bTemp!=m_msgsendtype)
- {
- AfxMessageBox("原发送平台有未发完的短信,您必须等待短信发完或手工删除未发完的短信后再试!", MB_ICONINFORMATION);
- m_msgsendtype=bTemp;
- UpdateData(false);
- }
- }
- void MsgSet::OnRadio2()
- {
- OnRadio1();
- }
- void MsgSet::OnCheck7()
- {
- UpdateData();
- if(m_msgcheck7)
- {
- PhoneMsgSet dlg;
- dlg.DoModal ();
- }
- }
- void MsgSet::OnButton4()
- {
- SetChildMsg dlg;
- dlg.DoModal ();
- }
- void MsgSet::OnChangeEDITcontent11()
- {
- UpdateData();
- m_msgcontent11.Replace ("'", "'");
- m_msgcontent11.Replace ("(", "(");
- m_msgcontent11.Replace (")", ")");
- UpdateData(false);
- CString str;
- int count=0;
- int leng=GetLengthEx(m_msgcontent11);
- count+=(leng/MSG_LENGTH);
- if(leng%MSG_LENGTH)
- count+=1;
- str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
- GetDlgItem(IDC_STATIC4)->SetWindowText(str);
- }
- void MsgSet::OnChangeEDITcontent12()
- {
- UpdateData();
- m_msgcontent12.Replace ("'", "'");
- m_msgcontent12.Replace ("(", "(");
- m_msgcontent12.Replace (")", ")");
- UpdateData(false);
- CString str;
- int count=0;
- int leng=GetLengthEx(m_msgcontent12);
- count+=(leng/MSG_LENGTH);
- if(leng%MSG_LENGTH)
- count+=1;
- str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
- GetDlgItem(IDC_STATIC5)->SetWindowText(str);
- }
- void MsgSet::OnChangeEDITcontent13()
- {
- UpdateData();
- m_msgcontent13.Replace ("'", "'");
- m_msgcontent13.Replace ("(", "(");
- m_msgcontent13.Replace (")", ")");
- UpdateData(false);
- CString str;
- int count=0;
- int leng=GetLengthEx(m_msgcontent13);
- count+=(leng/MSG_LENGTH);
- if(leng%MSG_LENGTH)
- count+=1;
- str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
- GetDlgItem(IDC_STATIC6)->SetWindowText(str);
- }
- void MsgSet::OnChangeEDITcontent14()
- {
- UpdateData();
- m_msgcontent14.Replace ("'", "'");
- m_msgcontent14.Replace ("(", "(");
- m_msgcontent14.Replace (")", ")");
- UpdateData(false);
- CString str;
- int count=0;
- int leng=GetLengthEx(m_msgcontent14);
- count+=(leng/MSG_LENGTH);
- if(leng%MSG_LENGTH)
- count+=1;
- str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
- GetDlgItem(IDC_STATIC7)->SetWindowText(str);
- }
- void MsgSet::OnChangeEDITcontent15()
- {
- UpdateData();
- m_msgcontent15.Replace ("'", "'");
- m_msgcontent15.Replace ("(", "(");
- m_msgcontent15.Replace (")", ")");
- UpdateData(false);
- CString str;
- int count=0;
- int leng=GetLengthEx(m_msgcontent15);
- count+=(leng/MSG_LENGTH);
- if(leng%MSG_LENGTH)
- count+=1;
- str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
- GetDlgItem(IDC_STATIC8)->SetWindowText(str);
- }
- void MsgSet::OnChangeEDITcontent17()
- {
- UpdateData();
- m_msgcontent17.Replace ("'", "'");
- m_msgcontent17.Replace ("(", "(");
- m_msgcontent17.Replace (")", ")");
- UpdateData(false);
- CString str;
- int count=0;
- int leng=GetLengthEx(m_msgcontent17);
- count+=(leng/MSG_LENGTH);
- if(leng%MSG_LENGTH)
- count+=1;
- str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
- GetDlgItem(IDC_STATIC9)->SetWindowText(str);
- }
|