MsgSet.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. // MsgSet.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "MsgSet.h"
  6. #include "PhoneMsgSet.h"
  7. #include "SetChildMsg.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // MsgSet dialog IDC_EDITbalance
  15. MsgSet::MsgSet(CWnd* pParent /*=NULL*/)
  16. : CDialog(MsgSet::IDD, pParent)
  17. {
  18. //{{AFX_DATA_INIT(MsgSet)
  19. m_account = _T("");
  20. m_psw = _T("");
  21. m_balance = _T("");
  22. m_used = _T("");
  23. m_check1 = FALSE;
  24. m_msgsendtype = 0;
  25. m_check2 = FALSE;
  26. m_days1 = 0;
  27. m_days2 = 0;
  28. m_check3 = FALSE;
  29. m_msgcontent5 = _T("");
  30. m_msgcheck5 = FALSE;
  31. m_msgcheck13 = FALSE;
  32. m_msgcheck14 = FALSE;
  33. m_msgcheck15 = FALSE;
  34. m_msgcheck16 = FALSE;
  35. m_msgcheck17 = FALSE;
  36. m_msgcheck11 = FALSE;
  37. m_msgcheck12 = FALSE;
  38. m_msgcontent6 = _T("");
  39. m_content1 = _T("xxx先生/女士");
  40. m_content2 = _T("xxx先生/女士");
  41. m_content3 = _T("xxx先生/女士");
  42. m_msgcontent11 = _T("xxx先生/女士");
  43. m_msgcontent12 = _T("xxx先生/女士");
  44. m_msgcontent13 = _T("xxx先生/女士");
  45. m_msgcontent14 = _T("xxx先生/女士");
  46. m_msgcontent15 = _T("xxx先生/女士");
  47. m_msgcontent17 = _T("xxx先生/女士");
  48. m_msgcheck6 = FALSE;
  49. m_msgcheck7 = FALSE;
  50. m_check4 = FALSE;
  51. m_phones = _T("");
  52. m_msgphones2 = _T("");
  53. m_time = 22;
  54. m_companyname = _T("");
  55. //}}AFX_DATA_INIT
  56. #ifdef CHILD_VERSION
  57. m_content1 = _T("xxx小朋友");
  58. m_content2 = _T("xxx小朋友");
  59. m_content3 = _T("");
  60. m_msgcontent11 = _T("");
  61. m_msgcontent12 = _T("");
  62. m_msgcontent13 = _T("");
  63. m_msgcontent14 = _T("");
  64. m_msgcontent15 = _T("");
  65. m_msgcontent17 = _T("");
  66. #endif
  67. m_bMsgNotFinish=0;
  68. }
  69. void MsgSet::DoDataExchange(CDataExchange* pDX)
  70. {
  71. CDialog::DoDataExchange(pDX);
  72. //{{AFX_DATA_MAP(MsgSet)
  73. DDX_Control(pDX, IDC_SPIN4, m_spin4);
  74. DDX_Control(pDX, IDC_SPIN2, m_spin2);
  75. DDX_Control(pDX, IDC_SPIN1, m_spin1);
  76. DDX_Text(pDX, IDC_EDITaccount, m_account);
  77. DDX_Text(pDX, IDC_EDITpsw, m_psw);
  78. DDX_Text(pDX, IDC_EDITbalance, m_balance);
  79. DDX_Text(pDX, IDC_EDITused, m_used);
  80. DDX_Check(pDX, IDC_CHECK1, m_check1);
  81. DDX_Check(pDX, IDC_CHECK7, m_msgcheck7);
  82. DDX_Radio(pDX, IDC_RADIO1, m_msgsendtype);
  83. DDX_Check(pDX, IDC_CHECK2, m_check2);
  84. DDX_Text(pDX, IDC_EDITdays1, m_days1);
  85. DDX_Text(pDX, IDC_EDITdays2, m_days2);
  86. DDX_Text(pDX, IDC_EDITcontent1, m_content1);
  87. DDV_MaxChars(pDX, m_content1, 1000);
  88. DDX_Text(pDX, IDC_EDITcontent2, m_content2);
  89. DDV_MaxChars(pDX, m_content2, 1000);
  90. DDX_Check(pDX, IDC_CHECK3, m_check3);
  91. DDX_Check(pDX, IDC_CHECK11, m_msgcheck11);
  92. DDX_Check(pDX, IDC_CHECK12, m_msgcheck12);
  93. DDX_Check(pDX, IDC_CHECK13, m_msgcheck13);
  94. DDX_Check(pDX, IDC_CHECK14, m_msgcheck14);
  95. DDX_Check(pDX, IDC_CHECK15, m_msgcheck15);
  96. DDX_Check(pDX, IDC_CHECK16, m_msgcheck17);
  97. DDX_Check(pDX, IDC_CHECK8, m_msgcheck16);
  98. DDX_Text(pDX, IDC_EDITcontent3, m_content3);
  99. DDV_MaxChars(pDX, m_content3, 1000);
  100. DDX_Text(pDX, IDC_EDITcontent7, m_msgcontent5);
  101. DDV_MaxChars(pDX, m_msgcontent5, 1000);
  102. DDX_Check(pDX, IDC_CHECK5, m_msgcheck5);
  103. DDX_Text(pDX, IDC_EDITcontent8, m_msgcontent6);
  104. DDV_MaxChars(pDX, m_msgcontent6, 1000);
  105. DDX_Text(pDX, IDC_EDITcontent11, m_msgcontent11);
  106. DDV_MaxChars(pDX, m_msgcontent11, 1000);
  107. DDX_Text(pDX, IDC_EDITcontent12, m_msgcontent12);
  108. DDV_MaxChars(pDX, m_msgcontent12, 1000);
  109. DDX_Text(pDX, IDC_EDITcontent13, m_msgcontent13);
  110. DDV_MaxChars(pDX, m_msgcontent13, 1000);
  111. DDX_Text(pDX, IDC_EDITcontent14, m_msgcontent14);
  112. DDV_MaxChars(pDX, m_msgcontent14, 1000);
  113. DDX_Text(pDX, IDC_EDITcontent15, m_msgcontent15);
  114. DDV_MaxChars(pDX, m_msgcontent15, 1000);
  115. DDX_Text(pDX, IDC_EDITcontent16, m_msgcontent17);
  116. DDV_MaxChars(pDX, m_msgcontent17, 1000);
  117. DDX_Check(pDX, IDC_CHECK6, m_msgcheck6);
  118. DDX_Check(pDX, IDC_CHECK4, m_check4);
  119. DDX_Text(pDX, IDC_EDITcontent4, m_phones);
  120. DDX_Text(pDX, IDC_EDITcontent6, m_msgphones2);
  121. DDV_MaxChars(pDX, m_phones, 1000);
  122. DDV_MaxChars(pDX, m_msgphones2, 1000);
  123. DDX_Text(pDX, IDC_EDITdays3, m_time);
  124. DDX_Text(pDX, IDC_EDITcontent5, m_companyname);
  125. //}}AFX_DATA_MAP
  126. }
  127. BEGIN_MESSAGE_MAP(MsgSet, CDialog)
  128. //{{AFX_MSG_MAP(MsgSet)
  129. ON_EN_CHANGE(IDC_EDITcontent1, OnChangeEDITcontent1)
  130. ON_EN_CHANGE(IDC_EDITcontent2, OnChangeEDITcontent2)
  131. ON_EN_CHANGE(IDC_EDITcontent3, OnChangeEDITcontent3)
  132. ON_EN_CHANGE(IDC_EDITcontent11, OnChangeEDITcontent11)
  133. ON_EN_CHANGE(IDC_EDITcontent12, OnChangeEDITcontent12)
  134. ON_EN_CHANGE(IDC_EDITcontent13, OnChangeEDITcontent13)
  135. ON_EN_CHANGE(IDC_EDITcontent14, OnChangeEDITcontent14)
  136. ON_EN_CHANGE(IDC_EDITcontent15, OnChangeEDITcontent15)
  137. ON_EN_CHANGE(IDC_EDITcontent16, OnChangeEDITcontent17)
  138. ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
  139. ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
  140. ON_BN_CLICKED(IDC_CHECK7, OnCheck7)
  141. ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
  142. //}}AFX_MSG_MAP
  143. END_MESSAGE_MAP()
  144. /////////////////////////////////////////////////////////////////////////////
  145. // MsgSet message handlers
  146. void MsgSet::OnOK()
  147. {
  148. // TODO: Add extra validation here
  149. UpdateData();
  150. m_account.TrimLeft ();
  151. m_account.TrimRight ();
  152. m_psw.TrimLeft ();
  153. m_psw.TrimRight ();
  154. if(m_account.IsEmpty ()||m_psw.IsEmpty ())
  155. {
  156. AfxMessageBox("账号或密码不能为空!");
  157. return;
  158. }
  159. m_content1.TrimLeft ();
  160. m_content1.TrimRight ();
  161. m_content2.TrimLeft ();
  162. m_content2.TrimRight ();
  163. m_content3.TrimLeft ();
  164. m_content3.TrimRight ();
  165. m_msgcontent11.TrimLeft ();
  166. m_msgcontent11.TrimRight ();
  167. m_msgcontent12.TrimLeft ();
  168. m_msgcontent12.TrimRight ();
  169. m_msgcontent13.TrimLeft ();
  170. m_msgcontent13.TrimRight ();
  171. m_msgcontent14.TrimLeft ();
  172. m_msgcontent14.TrimRight ();
  173. m_msgcontent15.TrimLeft ();
  174. m_msgcontent15.TrimRight ();
  175. m_msgcontent17.TrimLeft ();
  176. m_msgcontent17.TrimRight ();
  177. m_msgcontent5.TrimLeft ();
  178. m_msgcontent5.TrimRight ();
  179. m_companyname.TrimLeft ();
  180. m_companyname.TrimRight ();
  181. if(CheckBadWords(m_content1)==0 || CheckBadWords2(m_content1)==0)
  182. {
  183. AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
  184. return;
  185. }
  186. if(CheckBadWords(m_content2)==0 || CheckBadWords2(m_content2)==0)
  187. {
  188. AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
  189. return;
  190. }
  191. if(CheckBadWords(m_content3)==0 || CheckBadWords2(m_content3)==0)
  192. {
  193. AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
  194. return;
  195. }
  196. if(CheckBadWords(m_msgcontent11)==0 || CheckBadWords2(m_msgcontent11)==0)
  197. {
  198. AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
  199. return;
  200. }
  201. if(CheckBadWords(m_msgcontent12)==0 || CheckBadWords2(m_msgcontent12)==0)
  202. {
  203. AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
  204. return;
  205. }
  206. if(CheckBadWords(m_msgcontent13)==0 || CheckBadWords2(m_msgcontent13)==0)
  207. {
  208. AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
  209. return;
  210. }
  211. if(CheckBadWords(m_msgcontent14)==0 || CheckBadWords2(m_msgcontent14)==0)
  212. {
  213. AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
  214. return;
  215. }
  216. if(CheckBadWords(m_msgcontent15)==0 || CheckBadWords2(m_msgcontent15)==0)
  217. {
  218. AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
  219. return;
  220. }
  221. if(CheckBadWords(m_companyname)==0 || CheckBadWords2(m_companyname)==0)
  222. {
  223. AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
  224. return;
  225. }
  226. if(CheckBadWords(m_msgcontent6)==0 || CheckBadWords2(m_msgcontent6)==0)
  227. {
  228. AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
  229. return;
  230. }
  231. if(CheckBadWords(m_msgcontent5)==0 || CheckBadWords2(m_msgcontent5)==0)
  232. {
  233. AfxMessageBox("信息服务商禁止的非法字符:("+g_temp+")希望您谅解!");
  234. return;
  235. }
  236. m_phones.TrimLeft ();
  237. m_phones.TrimRight ();
  238. m_phones.Replace (",", ",");
  239. m_msgphones2.TrimLeft ();
  240. m_msgphones2.TrimRight ();
  241. m_msgphones2.Replace (",", ",");
  242. #ifdef CHILD_VERSION
  243. m_content1.Replace("xxx先生/女士", "xxx小朋友");
  244. m_content2.Replace("xxx先生/女士", "xxx小朋友");
  245. m_content3.Replace("xxx先生/女士", "");
  246. m_msgcontent11.Replace("xxx先生/女士", "");
  247. m_msgcontent12.Replace("xxx先生/女士", "");
  248. m_msgcontent13.Replace("xxx先生/女士", "");
  249. m_msgcontent14.Replace("xxx先生/女士", "");
  250. m_msgcontent15.Replace("xxx先生/女士", "");
  251. m_content3.Replace("xxx小朋友", "");
  252. m_msgcontent11.Replace("xxx小朋友", "");
  253. m_msgcontent12.Replace("xxx小朋友", "");
  254. m_msgcontent13.Replace("xxx小朋友", "");
  255. m_msgcontent14.Replace("xxx小朋友", "");
  256. m_msgcontent15.Replace("xxx小朋友", "");
  257. m_msgcontent17.Replace("xxx小朋友", "");
  258. if(m_content1.Find ("xxx小朋友")==-1)
  259. {
  260. m_content1="xxx小朋友"+m_content1;
  261. AfxMessageBox("祝福语不合规范!");
  262. UpdateData(false);
  263. return;
  264. }
  265. if(m_content2.Find ("xxx小朋友")==-1)
  266. {
  267. m_content2="xxx小朋友"+m_content2;
  268. AfxMessageBox("祝福语不合规范!");
  269. UpdateData(false);
  270. return;
  271. }
  272. #else
  273. m_content1.Replace("xxx小朋友", "xxx先生/女士");
  274. m_content2.Replace("xxx小朋友", "xxx先生/女士");
  275. m_content3.Replace("xxx小朋友", "xxx先生/女士");
  276. m_msgcontent11.Replace("xxx小朋友", "xxx先生/女士");
  277. m_msgcontent12.Replace("xxx小朋友", "xxx先生/女士");
  278. m_msgcontent13.Replace("xxx小朋友", "xxx先生/女士");
  279. m_msgcontent14.Replace("xxx小朋友", "xxx先生/女士");
  280. m_msgcontent15.Replace("xxx小朋友", "xxx先生/女士");
  281. m_msgcontent17.Replace("xxx小朋友", "xxx先生/女士");
  282. if(m_content1.Find ("xxx先生/女士")==-1)
  283. {
  284. m_content1="xxx先生/女士"+m_content1;
  285. AfxMessageBox("祝福语不合规范!");
  286. UpdateData(false);
  287. return;
  288. }
  289. if(m_content2.Find ("xxx先生/女士")==-1)
  290. {
  291. m_content2="xxx先生/女士"+m_content2;
  292. AfxMessageBox("祝福语不合规范!");
  293. UpdateData(false);
  294. return;
  295. }
  296. if(m_content3.Find ("xxx先生/女士")==-1)
  297. {
  298. m_content3="xxx先生/女士"+m_content3;
  299. AfxMessageBox("祝福语不合规范!");
  300. UpdateData(false);
  301. return;
  302. }
  303. if(m_msgcontent11.Find ("xxx先生/女士")==-1)
  304. {
  305. m_msgcontent11="xxx先生/女士"+m_msgcontent11;
  306. AfxMessageBox("祝福语不合规范!");
  307. UpdateData(false);
  308. return;
  309. }
  310. if(m_msgcontent12.Find ("xxx先生/女士")==-1)
  311. {
  312. m_msgcontent12="xxx先生/女士"+m_msgcontent12;
  313. AfxMessageBox("祝福语不合规范!");
  314. UpdateData(false);
  315. return;
  316. }
  317. if(m_msgcontent13.Find ("xxx先生/女士")==-1)
  318. {
  319. m_msgcontent13="xxx先生/女士"+m_msgcontent13;
  320. AfxMessageBox("祝福语不合规范!");
  321. UpdateData(false);
  322. return;
  323. }
  324. if(m_msgcontent14.Find ("xxx先生/女士")==-1)
  325. {
  326. m_msgcontent14="xxx先生/女士"+m_msgcontent14;
  327. AfxMessageBox("祝福语不合规范!");
  328. UpdateData(false);
  329. return;
  330. }
  331. if(m_msgcontent15.Find ("xxx先生/女士")==-1)
  332. {
  333. m_msgcontent15="xxx先生/女士"+m_msgcontent15;
  334. AfxMessageBox("祝福语不合规范!");
  335. UpdateData(false);
  336. return;
  337. }
  338. if(m_msgcontent17.Find ("xxx先生/女士")==-1)
  339. {
  340. m_msgcontent17="xxx先生/女士"+m_msgcontent17;
  341. AfxMessageBox("祝福语不合规范!");
  342. UpdateData(false);
  343. return;
  344. }
  345. #endif
  346. CString str=m_phones;
  347. if(str.IsEmpty ()==0)
  348. {
  349. int pos=str.Find (",");
  350. if(pos!=-1)
  351. {
  352. while(pos!=-1)
  353. {
  354. if(CheckPhoneType(str.Left (pos))==-1)
  355. {
  356. AfxMessageBox("手机号错误!");
  357. return;
  358. }
  359. str=str.Right (str.GetLength ()-pos-1);
  360. pos=str.Find (",");
  361. }
  362. if(CheckPhoneType(str)==-1)
  363. {
  364. AfxMessageBox("手机号错误!");
  365. return;
  366. }
  367. }
  368. else if(CheckPhoneType(str)==-1)
  369. {
  370. AfxMessageBox("手机号错误!");
  371. return;
  372. }
  373. }
  374. str=m_msgphones2;
  375. if(str.IsEmpty ()==0)
  376. {
  377. int pos=str.Find (",");
  378. if(pos!=-1)
  379. {
  380. while(pos!=-1)
  381. {
  382. if(CheckPhoneType(str.Left (pos))==-1)
  383. {
  384. AfxMessageBox("手机号错误!");
  385. return;
  386. }
  387. str=str.Right (str.GetLength ()-pos-1);
  388. pos=str.Find (",");
  389. }
  390. if(CheckPhoneType(str)==-1)
  391. {
  392. AfxMessageBox("手机号错误!");
  393. return;
  394. }
  395. }
  396. else if(CheckPhoneType(str)==-1)
  397. {
  398. AfxMessageBox("手机号错误!");
  399. return;
  400. }
  401. }
  402. CString sql;
  403. 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);
  404. g_sendhead.bsql=1;
  405. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  406. AfxMessageBox("保存成功!", MB_ICONINFORMATION);
  407. g_sendhead.bsql=0;
  408. g_sendhead.code[0]=24;
  409. g_sendhead.tabcount=1;
  410. int g_nYearposTemp=g_nYearpos;
  411. g_nYearpos=-1;
  412. g_pMainWnd->ProcessChatMessageRequest2(1);
  413. g_nYearpos=g_nYearposTemp;
  414. if(g_bSendOK)
  415. DataToArray(&g_cominfoarray);
  416. CDialog::OnOK ();
  417. }
  418. BOOL MsgSet::OnInitDialog()
  419. {
  420. CDialog::OnInitDialog();
  421. // TODO: Add extra initialization here
  422. CString filter="[status]<>'OK';";
  423. g_sendhead.bsql=0;
  424. g_sendhead.code[0]=67;
  425. g_sendhead.code[1]=24;
  426. g_sendhead.tabcount=2;
  427. int g_nYearposTemp=g_nYearpos;
  428. g_nYearpos=-1;
  429. g_pMainWnd->ProcessChatMessageRequest2(filter);
  430. g_nYearpos=g_nYearposTemp;
  431. if(g_bSendOK==0)
  432. {
  433. CDialog::OnCancel ();
  434. return 1;
  435. }
  436. CArray<CStringArray, CStringArray>m_List1array;
  437. DataToArray(&m_List1array,&g_cominfoarray);
  438. if(m_List1array.GetSize ())m_bMsgNotFinish=1;
  439. m_account = g_cominfoarray.ElementAt(0).ElementAt(27);
  440. m_psw = g_cominfoarray.ElementAt(0).ElementAt(28);
  441. m_used = g_cominfoarray.ElementAt(0).ElementAt(29);
  442. m_balance = g_cominfoarray.ElementAt(0).ElementAt(30);
  443. m_check1 = atoi(g_cominfoarray.ElementAt(0).ElementAt(31));
  444. m_check2 = atoi(g_cominfoarray.ElementAt(0).ElementAt(32));
  445. m_days1 = atoi(g_cominfoarray.ElementAt(0).ElementAt(33));
  446. m_days2 = atoi(g_cominfoarray.ElementAt(0).ElementAt(34));
  447. m_content1 = g_cominfoarray.ElementAt(0).ElementAt(35);
  448. m_content2 = g_cominfoarray.ElementAt(0).ElementAt(36);
  449. m_check3 = atoi(g_cominfoarray.ElementAt(0).ElementAt(39));
  450. m_content3 = g_cominfoarray.ElementAt(0).ElementAt(40);
  451. m_check4 = atoi(g_cominfoarray.ElementAt(0).ElementAt(43));
  452. m_time = atoi(g_cominfoarray.ElementAt(0).ElementAt(44));
  453. m_phones = g_cominfoarray.ElementAt(0).ElementAt(45);
  454. m_companyname = g_cominfoarray.ElementAt(0).ElementAt(47);
  455. m_msgsendtype = atoi(g_cominfoarray.ElementAt(0).ElementAt(49));
  456. m_msgphones2 = g_cominfoarray.ElementAt(0).ElementAt(50);
  457. m_msgcheck5 = atoi(g_cominfoarray.ElementAt(0).ElementAt(51));
  458. m_msgcontent5 = g_cominfoarray.ElementAt(0).ElementAt(52);
  459. m_msgcheck6 = atoi(g_cominfoarray.ElementAt(0).ElementAt(53));
  460. m_msgcontent6 = g_cominfoarray.ElementAt(0).ElementAt(54);
  461. m_msgcheck7 = atoi(g_cominfoarray.ElementAt(0).ElementAt(88));
  462. m_msgcheck11 = atoi(g_cominfoarray.ElementAt(0).ElementAt(101));
  463. m_msgcheck12 = atoi(g_cominfoarray.ElementAt(0).ElementAt(102));
  464. m_msgcheck13 = atoi(g_cominfoarray.ElementAt(0).ElementAt(103));
  465. m_msgcheck14 = atoi(g_cominfoarray.ElementAt(0).ElementAt(104));
  466. m_msgcontent11 = g_cominfoarray.ElementAt(0).ElementAt(105);
  467. m_msgcontent12 = g_cominfoarray.ElementAt(0).ElementAt(106);
  468. m_msgcontent13 = g_cominfoarray.ElementAt(0).ElementAt(107);
  469. m_msgcontent14 = g_cominfoarray.ElementAt(0).ElementAt(108);
  470. m_msgcheck15 = atoi(g_cominfoarray.ElementAt(0).ElementAt(110));
  471. m_msgcheck16 = atoi(g_cominfoarray.ElementAt(0).ElementAt(122));
  472. m_msgcontent15 = g_cominfoarray.ElementAt(0).ElementAt(111);
  473. m_msgcheck17 = atoi(g_cominfoarray.ElementAt(0).ElementAt(128));
  474. m_msgcontent17 = g_cominfoarray.ElementAt(0).ElementAt(129);
  475. if(m_time==0)m_time=22;
  476. #ifdef CHILD_VERSION
  477. if(m_content1.IsEmpty())m_content1="xxx小朋友";
  478. if(m_content2.IsEmpty())m_content2="xxx小朋友";
  479. m_content1.Replace("xxx先生/女士", "xxx小朋友");
  480. m_content2.Replace("xxx先生/女士", "xxx小朋友");
  481. m_content3.Replace("xxx先生/女士", "");
  482. m_msgcontent11.Replace("xxx先生/女士", "");
  483. m_msgcontent12.Replace("xxx先生/女士", "");
  484. m_msgcontent13.Replace("xxx先生/女士", "");
  485. m_msgcontent14.Replace("xxx先生/女士", "");
  486. m_msgcontent15.Replace("xxx先生/女士", "");
  487. m_msgcontent17.Replace("xxx先生/女士", "");
  488. #else
  489. if(m_content1.IsEmpty())m_content1="xxx先生/女士";
  490. if(m_content2.IsEmpty())m_content2="xxx先生/女士";
  491. if(m_content3.IsEmpty())m_content3="xxx先生/女士";
  492. if(m_msgcontent11.IsEmpty())m_msgcontent11="xxx先生/女士";
  493. if(m_msgcontent12.IsEmpty())m_msgcontent12="xxx先生/女士";
  494. if(m_msgcontent13.IsEmpty())m_msgcontent13="xxx先生/女士";
  495. if(m_msgcontent14.IsEmpty())m_msgcontent14="xxx先生/女士";
  496. if(m_msgcontent15.IsEmpty())m_msgcontent15="xxx先生/女士";
  497. if(m_msgcontent17.IsEmpty())m_msgcontent17="xxx先生/女士";
  498. m_content1.Replace("xxx小朋友", "xxx先生/女士");
  499. m_content2.Replace("xxx小朋友", "xxx先生/女士");
  500. m_content3.Replace("xxx小朋友", "xxx先生/女士");
  501. m_msgcontent11.Replace("xxx小朋友", "xxx先生/女士");
  502. m_msgcontent12.Replace("xxx小朋友", "xxx先生/女士");
  503. m_msgcontent13.Replace("xxx小朋友", "xxx先生/女士");
  504. m_msgcontent14.Replace("xxx小朋友", "xxx先生/女士");
  505. m_msgcontent15.Replace("xxx小朋友", "xxx先生/女士");
  506. m_msgcontent17.Replace("xxx小朋友", "xxx先生/女士");
  507. #endif
  508. UpdateData(false);
  509. CenterWindow();
  510. m_spin1.SetRange (0, 100);
  511. m_spin2.SetRange (0, 100);
  512. m_spin4.SetRange (20, 24);
  513. return TRUE;
  514. }
  515. void MsgSet::OnChangeEDITcontent1()
  516. {
  517. UpdateData();
  518. m_content1.Replace ("'", "'");
  519. m_content1.Replace ("(", "(");
  520. m_content1.Replace (")", ")");
  521. UpdateData(false);
  522. CString str;
  523. int count=0;
  524. int leng=GetLengthEx(m_content1);
  525. count+=(leng/MSG_LENGTH);
  526. if(leng%MSG_LENGTH)
  527. count+=1;
  528. str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH, leng,count);
  529. GetDlgItem(IDC_STATIC1)->SetWindowText(str);
  530. }
  531. void MsgSet::OnChangeEDITcontent2()
  532. {
  533. UpdateData();
  534. m_content2.Replace ("'", "'");
  535. m_content2.Replace ("(", "(");
  536. m_content2.Replace (")", ")");
  537. UpdateData(false);
  538. CString str;
  539. int count=0;
  540. int leng=GetLengthEx(m_content2);
  541. count+=(leng/MSG_LENGTH);
  542. if(leng%MSG_LENGTH)
  543. count+=1;
  544. str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
  545. GetDlgItem(IDC_STATIC2)->SetWindowText(str);
  546. }
  547. void MsgSet::OnChangeEDITcontent3()
  548. {
  549. UpdateData();
  550. m_content3.Replace ("'", "'");
  551. m_content3.Replace ("(", "(");
  552. m_content3.Replace (")", ")");
  553. UpdateData(false);
  554. CString str;
  555. int count=0;
  556. int leng=GetLengthEx(m_content3);
  557. count+=(leng/MSG_LENGTH);
  558. if(leng%MSG_LENGTH)
  559. count+=1;
  560. str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
  561. GetDlgItem(IDC_STATIC3)->SetWindowText(str);
  562. }
  563. void MsgSet::OnRadio1()
  564. {
  565. BOOL bTemp=m_msgsendtype;
  566. UpdateData();
  567. if(m_bMsgNotFinish && bTemp!=m_msgsendtype)
  568. {
  569. AfxMessageBox("原发送平台有未发完的短信,您必须等待短信发完或手工删除未发完的短信后再试!", MB_ICONINFORMATION);
  570. m_msgsendtype=bTemp;
  571. UpdateData(false);
  572. }
  573. }
  574. void MsgSet::OnRadio2()
  575. {
  576. OnRadio1();
  577. }
  578. void MsgSet::OnCheck7()
  579. {
  580. UpdateData();
  581. if(m_msgcheck7)
  582. {
  583. PhoneMsgSet dlg;
  584. dlg.DoModal ();
  585. }
  586. }
  587. void MsgSet::OnButton4()
  588. {
  589. SetChildMsg dlg;
  590. dlg.DoModal ();
  591. }
  592. void MsgSet::OnChangeEDITcontent11()
  593. {
  594. UpdateData();
  595. m_msgcontent11.Replace ("'", "'");
  596. m_msgcontent11.Replace ("(", "(");
  597. m_msgcontent11.Replace (")", ")");
  598. UpdateData(false);
  599. CString str;
  600. int count=0;
  601. int leng=GetLengthEx(m_msgcontent11);
  602. count+=(leng/MSG_LENGTH);
  603. if(leng%MSG_LENGTH)
  604. count+=1;
  605. str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
  606. GetDlgItem(IDC_STATIC4)->SetWindowText(str);
  607. }
  608. void MsgSet::OnChangeEDITcontent12()
  609. {
  610. UpdateData();
  611. m_msgcontent12.Replace ("'", "'");
  612. m_msgcontent12.Replace ("(", "(");
  613. m_msgcontent12.Replace (")", ")");
  614. UpdateData(false);
  615. CString str;
  616. int count=0;
  617. int leng=GetLengthEx(m_msgcontent12);
  618. count+=(leng/MSG_LENGTH);
  619. if(leng%MSG_LENGTH)
  620. count+=1;
  621. str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
  622. GetDlgItem(IDC_STATIC5)->SetWindowText(str);
  623. }
  624. void MsgSet::OnChangeEDITcontent13()
  625. {
  626. UpdateData();
  627. m_msgcontent13.Replace ("'", "'");
  628. m_msgcontent13.Replace ("(", "(");
  629. m_msgcontent13.Replace (")", ")");
  630. UpdateData(false);
  631. CString str;
  632. int count=0;
  633. int leng=GetLengthEx(m_msgcontent13);
  634. count+=(leng/MSG_LENGTH);
  635. if(leng%MSG_LENGTH)
  636. count+=1;
  637. str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
  638. GetDlgItem(IDC_STATIC6)->SetWindowText(str);
  639. }
  640. void MsgSet::OnChangeEDITcontent14()
  641. {
  642. UpdateData();
  643. m_msgcontent14.Replace ("'", "'");
  644. m_msgcontent14.Replace ("(", "(");
  645. m_msgcontent14.Replace (")", ")");
  646. UpdateData(false);
  647. CString str;
  648. int count=0;
  649. int leng=GetLengthEx(m_msgcontent14);
  650. count+=(leng/MSG_LENGTH);
  651. if(leng%MSG_LENGTH)
  652. count+=1;
  653. str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
  654. GetDlgItem(IDC_STATIC7)->SetWindowText(str);
  655. }
  656. void MsgSet::OnChangeEDITcontent15()
  657. {
  658. UpdateData();
  659. m_msgcontent15.Replace ("'", "'");
  660. m_msgcontent15.Replace ("(", "(");
  661. m_msgcontent15.Replace (")", ")");
  662. UpdateData(false);
  663. CString str;
  664. int count=0;
  665. int leng=GetLengthEx(m_msgcontent15);
  666. count+=(leng/MSG_LENGTH);
  667. if(leng%MSG_LENGTH)
  668. count+=1;
  669. str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
  670. GetDlgItem(IDC_STATIC8)->SetWindowText(str);
  671. }
  672. void MsgSet::OnChangeEDITcontent17()
  673. {
  674. UpdateData();
  675. m_msgcontent17.Replace ("'", "'");
  676. m_msgcontent17.Replace ("(", "(");
  677. m_msgcontent17.Replace (")", ")");
  678. UpdateData(false);
  679. CString str;
  680. int count=0;
  681. int leng=GetLengthEx(m_msgcontent17);
  682. count+=(leng/MSG_LENGTH);
  683. if(leng%MSG_LENGTH)
  684. count+=1;
  685. str.Format ("%d字/条,现%d字,共%d条)", MSG_LENGTH,leng,count);
  686. GetDlgItem(IDC_STATIC9)->SetWindowText(str);
  687. }