Login3.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. // Login3.cpp: implementation of the Login3 class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "stdafx.h"
  5. #include "YLGL.h"
  6. #include "Login3.h"
  7. #include "DigitalWorkSet2.h"
  8. #include "ShowMsg.h"
  9. #include "ShowBakState.h"
  10. #ifdef _DEBUG
  11. #undef THIS_FILE
  12. static char THIS_FILE[]=__FILE__;
  13. #define new DEBUG_NEW
  14. #endif
  15. //////////////////////////////////////////////////////////////////////
  16. // Construction/Destruction
  17. //////////////////////////////////////////////////////////////////////
  18. //extern void WriteClientLog(CString str); // Jeff写客户端日志;
  19. Login3::Login3()
  20. {
  21. m_psw = _T("");
  22. m_bsave = FALSE;
  23. m_account = _T("");
  24. g_pMainWnd->GetSkin();
  25. }
  26. Login3::~Login3()
  27. {
  28. }
  29. void Login3::OnFSCommand(LPCTSTR command, LPCTSTR args)
  30. {
  31. }
  32. void Login3::Init()
  33. {
  34. m_combobox.Create(WS_VSCROLL|WS_CHILD|CBS_DROPDOWN,m_rcarray.ElementAt (2),this,100);
  35. m_combobox.ShowWindow(SW_SHOW);
  36. // m_combobox.SetFocus(); // Add by Jeff //无效;
  37. CRect rc=m_rcarray.ElementAt (2);
  38. rc.bottom +=200;
  39. m_combobox.MoveWindow (rc);
  40. m_combobox.GetWindowRect (rc);
  41. int hei=rc.Height ();
  42. rc=m_rcarray.ElementAt (3);
  43. rc.bottom =rc.top +hei+5;
  44. m_edit.Create(ES_AUTOHSCROLL|WS_CHILD|ES_LEFT|WS_BORDER|ES_PASSWORD|WS_EX_WINDOWEDGE,rc,this,200);
  45. m_edit.ShowWindow(SW_SHOW);
  46. rc=m_rcarray.ElementAt (4);
  47. rc.bottom =rc.top +13;
  48. rc.right =rc.left +13;
  49. m_button.Create("",WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX|BS_FLAT, rc,this,300);
  50. tpFont.CreatePointFont (180, _T("黑体"));
  51. m_edit.SetFont(&tpFont);
  52. m_combobox.SetFont(&tpFont);
  53. /////////////////////////
  54. g_sendhead.bsql=0;
  55. g_sendhead.code[0]=23; // Jeff.accountview视图;用户
  56. g_sendhead.code[1]=24; // Jeff.version表;版本信息;
  57. g_sendhead.code[2]=29; // Jeff.path表;路径
  58. g_sendhead.code[3]=5; // Jeff.renyuan表;人员表;
  59. g_sendhead.code[4]=1; // Jeff.historydb表;历史数据库;
  60. g_sendhead.code[5]=171; // Jeff.childmsg表;其实就是"资料与相片备份状态"
  61. if(g_branchname=="")
  62. {
  63. g_sendhead.code[6]=152; // Jeff.不读任何表,读brachinfo.dat文件里的数据;
  64. g_sendhead.tabcount=7;
  65. }
  66. else
  67. g_sendhead.tabcount=6;
  68. int g_nYearposTemp=g_nYearpos;
  69. g_nYearpos=-1;
  70. g_pMainWnd->ProcessChatMessageRequest2("[dimission]<>'离职' or [dimission] is null;;;;;;");
  71. g_nYearpos=g_nYearposTemp;
  72. if(g_bSendOK==0)
  73. {
  74. CDialog::OnCancel();
  75. return;
  76. }
  77. CArray<CStringArray, CStringArray>patharray;
  78. CArray<CStringArray, CStringArray>userarray;
  79. if(g_branchname=="")
  80. DataToArray(&m_List1array,&g_cominfoarray,&patharray,&userarray,&g_hisyeararray,&g_bakstatearray,&g_brancharray);
  81. else
  82. DataToArray(&m_List1array,&g_cominfoarray,&patharray,&userarray,&g_hisyeararray,&g_bakstatearray);
  83. if(g_branchname=="")
  84. {
  85. g_cominfoarraylocal.SetSize(1, 1);
  86. g_cominfoarraylocal.ElementAt(0).Copy(g_cominfoarray.ElementAt(0));
  87. }
  88. CheckBakState(); // Jeff.启用客户端时,先检测"资料与照片备份状态"
  89. if(g_branchname=="")
  90. {
  91. g_domain=patharray.ElementAt(0).ElementAt(0);
  92. if(g_domain.Find (".ly.com")==-1)g_domain.Empty ();
  93. // MessageBox(g_domain);
  94. g_bSaveUploadTask1=atoi(g_cominfoarray.ElementAt(0).ElementAt(67));
  95. g_bSaveUploadTask2=atoi(g_cominfoarray.ElementAt(0).ElementAt(68));
  96. g_bSaveUploadTask3=atoi(g_cominfoarray.ElementAt(0).ElementAt(69));
  97. g_bSaveUploadTask4=atoi(g_cominfoarray.ElementAt(0).ElementAt(70));
  98. }
  99. CString version = _T ("Version 1.0");
  100. BOOL bHide=atoi(g_cominfoarray.ElementAt(0).ElementAt(58));
  101. AfxGetApp()->WriteProfileInt (version, "hidewindow2", bHide);
  102. g_userarray.SetSize( userarray.GetSize (), 1 );
  103. int count=0;
  104. for(int ii=0; ii<userarray.GetSize (); ii++)
  105. {
  106. if(userarray.ElementAt (ii).ElementAt (10)=="在职")
  107. g_userarray.ElementAt (count++).Copy (userarray.ElementAt (ii));
  108. }
  109. g_userarray.SetSize( count, 1 );
  110. CString strVersion;
  111. strVersion.Format("%d%d", g_arrFileVersion[2], g_arrFileVersion[3]);
  112. if (g_cominfoarray.ElementAt(0).ElementAt(0) != strVersion)
  113. {
  114. AfxMessageBox("您必须更新软件才能继续使用, 请与系统管理员联系!", MB_ICONINFORMATION);
  115. CDialog::OnCancel();
  116. g_pMainWnd->AutoUpdate();
  117. return;
  118. }
  119. #ifndef ENTERPRISE_VERSION
  120. {
  121. #ifndef CHILD_VERSION
  122. #ifdef BASIC_VERSION
  123. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  124. {
  125. AfxMessageBox("软件客户端与服务器版本不匹配, 请与系统管理员联系!", MB_ICONSTOP);
  126. exit(0);return;
  127. }
  128. #else
  129. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  130. {
  131. AfxMessageBox("软件客户端与服务器版本不匹配, 请与系统管理员联系!", MB_ICONSTOP);
  132. exit(0);return;
  133. }
  134. #endif
  135. #else
  136. #ifdef BASIC_VERSION
  137. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  138. {
  139. AfxMessageBox("软件客户端与服务器版本不匹配, 请与系统管理员联系!", MB_ICONSTOP);
  140. exit(0);return;
  141. }
  142. #else
  143. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  144. {
  145. AfxMessageBox("软件客户端与服务器版本不匹配, 请与系统管理员联系!", MB_ICONSTOP);
  146. exit(0);return;
  147. }
  148. #endif
  149. #endif
  150. }
  151. #else
  152. {
  153. #ifndef CHILD_VERSION
  154. #ifdef BASIC_VERSION
  155. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  156. {
  157. AfxMessageBox("软件客户端与服务器版本不匹配, 请与系统管理员联系!", MB_ICONSTOP);
  158. exit(0);return ;
  159. }
  160. #else
  161. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  162. {
  163. AfxMessageBox("软件客户端与服务器版本不匹配, 请与系统管理员联系!", MB_ICONSTOP);
  164. exit(0);return ;
  165. }
  166. #endif
  167. #else
  168. #ifdef BASIC_VERSION
  169. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  170. {
  171. AfxMessageBox("软件客户端与服务器版本不匹配, 请与系统管理员联系!", MB_ICONSTOP);
  172. exit(0);return ;
  173. }
  174. #else
  175. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  176. {
  177. AfxMessageBox("软件客户端与服务器版本不匹配, 请与系统管理员联系!", MB_ICONSTOP);
  178. exit(0);return ;
  179. }
  180. #endif
  181. #endif
  182. }
  183. #endif
  184. g_title=g_cominfoarray.ElementAt (0).ElementAt (10);
  185. WriteTitle(g_cominfoarray.ElementAt (0).ElementAt (10));
  186. g_date=g_cominfoarray.ElementAt(0).ElementAt(1);
  187. if(g_hisyeararray.GetSize())
  188. {
  189. g_pMainWnd->AddHistoryMenu(&g_hisyeararray);
  190. }
  191. if(g_brancharray.GetSize() && g_branchname=="")
  192. {
  193. // WriteClientLog("启动集团版菜单");
  194. g_pMainWnd->AddBranchMenu(&g_brancharray); // 添加操作分店菜单;
  195. }
  196. if(g_branchname=="")
  197. {
  198. //////////////////////////////////////////////////////////////////////////
  199. // 获取NetShareInfo表;
  200. if ( g_aryOfSharePathInfo.GetSize() == 0)
  201. {
  202. g_pMainWnd->GetSharePathInfo();
  203. }
  204. if(g_server=="127.0.0.1")
  205. {
  206. g_sendhead.bsql=0;
  207. g_sendhead.code[0]=63;
  208. g_sendhead.tabcount=1;
  209. g_pMainWnd->ProcessChatMessageRequest2(1);
  210. if(g_bSendOK==0)
  211. {
  212. CDialog::OnCancel();
  213. return;
  214. }
  215. DataToArray(&g_List1array);
  216. g_path1=g_List1array.ElementAt(0).ElementAt(0)+"\\客户原片(管理软件)$";
  217. g_path2=g_List1array.ElementAt(0).ElementAt(0)+"\\修好的片(管理软件)$";
  218. g_path3=g_List1array.ElementAt(0).ElementAt(0)+"\\设计好的片(管理软件)$";
  219. g_path4=g_List1array.ElementAt(0).ElementAt(0)+"\\精修好的片(管理软件)$";
  220. g_path5=g_List1array.ElementAt(0).ElementAt(0)+"\\礼服图片(管理软件)$";
  221. g_path6=g_List1array.ElementAt(0).ElementAt(0)+"\\电话录音(管理软件)$";
  222. g_path7=g_path1+"\\效果图";
  223. }
  224. else if(patharray.GetSize())
  225. {
  226. // g_serverbak="PC-110817-VYCJ";
  227. g_path1=g_path2=g_path3=g_path4=g_path5=g_path6=g_path7=g_serverbak;
  228. g_path1="\\\\"+g_path1+"\\客户原片(管理软件)$";
  229. g_path2="\\\\"+g_path2+"\\修好的片(管理软件)$";
  230. g_path3="\\\\"+g_path3+"\\设计好的片(管理软件)$";
  231. g_path4="\\\\"+g_path4+"\\精修好的片(管理软件)$";
  232. g_path5="\\\\"+g_path5+"\\礼服图片(管理软件)$";
  233. g_path6="\\\\"+g_path6+"\\电话录音(管理软件)$";
  234. g_path7=g_path1+"\\效果图";
  235. }
  236. g_path1bak=g_path1;
  237. g_path2bak=g_path2;
  238. g_path3bak=g_path3;
  239. g_path4bak=g_path4;
  240. g_path5bak=g_path5;
  241. g_path6bak=g_path6;
  242. g_path7bak=g_path7;
  243. }
  244. try
  245. {
  246. CFile fp;
  247. if(fp.Open (g_mainpath+"\\loginuser.dat", CFile::modeRead))
  248. {
  249. DWORD length=fp.GetLength ();
  250. if(!length)return;
  251. CArchive ar(&fp, CArchive::load);
  252. m_userarray.Serialize (ar);
  253. fp.Close ();
  254. for(int i=0; i<m_userarray.GetSize (); i++)
  255. {
  256. m_combobox.AddString (m_userarray.ElementAt (i));
  257. }
  258. if(m_combobox.GetCount ()>0)
  259. {
  260. m_combobox.SetCurSel (0);
  261. m_combobox.GetLBText (0, m_account);
  262. }
  263. if(!m_account.IsEmpty ())
  264. {
  265. CString version = _T ("Version 1.0");
  266. m_psw=AfxGetApp()->GetProfileString (version, _T (m_account));
  267. if(!m_psw.IsEmpty ())
  268. m_bsave=TRUE;
  269. }
  270. SetDlgItemText(200, m_psw);
  271. m_button.SetCheck (m_bsave);
  272. }
  273. }
  274. catch(...)
  275. {
  276. }
  277. //CWnd *pWnd = GetFocus();
  278. //pWnd->OnKillFocus(pWnd);
  279. //m_combobox.SetFocus();
  280. }
  281. void Login3::Destory()
  282. {
  283. }
  284. void Login3::BtnClick(WPARAM wParam, LPARAM lParam)
  285. {
  286. int id=lParam;
  287. id-=99;
  288. switch(id)
  289. {
  290. case 2:
  291. {
  292. MyOnOK();
  293. }
  294. break;
  295. case 1:
  296. CDialog::OnCancel ();
  297. break;
  298. }
  299. }
  300. BOOL Login3::PreTransMsg(MSG* pMsg)
  301. {
  302. #if 0 // Add Jeff:使用tab键切换控件;
  303. if (pMsg->message == WM_KEYDOWN && pMsg->message == VK_TAB)
  304. {
  305. // 当前拥有焦点的控件 == m_combobox控件;
  306. if(GetFocus()->GetSafeHwnd() == m_combobox.GetSafeHwnd())
  307. {
  308. // 使m_edit拥有焦点
  309. m_edit.SetFocus();
  310. return TRUE;
  311. }
  312. else if (GetFocus()->GetSafeHwnd() == m_edit.GetSafeHwnd())
  313. {
  314. m_button->SetFocus();
  315. return TRUE;
  316. }
  317. }
  318. else if(pMsg->message == WM_KEYDOWN)
  319. #else
  320. if(pMsg->message == WM_KEYDOWN)
  321. #endif
  322. {
  323. switch (pMsg->wParam)
  324. {
  325. case VK_RETURN:
  326. MyOnOK();
  327. break;// return 1;
  328. case VK_TAB:
  329. {
  330. #if 0
  331. CWnd *pParent = GetParent();
  332. CWnd *pWnd = GetFocus();
  333. //CString strText;
  334. int nCtrlId = pWnd->GetDlgCtrlID();
  335. //m_combobox.m
  336. // LOG4C((LOG_NOTICE,"VK_TAB:%d,%d,%d"),nCtrlId,m_combobox.GetDlgCtrlID(),pParent->GetDlgCtrlID());
  337. #endif
  338. HWND _hwnd = GetFocus()->GetSafeHwnd();
  339. if(_hwnd != m_combobox.m_hWnd && _hwnd != m_edit.m_hWnd && _hwnd != m_button.m_hWnd)
  340. //if( _hwnd == m_combobox.m_hWnd )
  341. {
  342. //LOG4C((LOG_NOTICE,"使m_edit拥有焦点"));
  343. // 使m_edit拥有焦点
  344. m_edit.SetFocus();
  345. // 使密码框的内容清空或者全靠;
  346. //m_combobox.SetFocus();
  347. return TRUE;
  348. }
  349. // else if ( _hwnd == m_combobox.m_hWnd)
  350. // {
  351. // m_edit.SetFocus();
  352. // return TRUE;
  353. // }
  354. else if (_hwnd == m_edit.m_hWnd/*m_edit.GetSafeHwnd()*/)
  355. {
  356. //LOG4C((LOG_NOTICE,"将焦点返回给commbox"));
  357. m_combobox.SetFocus();
  358. return TRUE;
  359. }
  360. }
  361. break;
  362. }
  363. }
  364. else if(pMsg->message == WM_LBUTTONDOWN)
  365. {
  366. g_bNeedDrawParent=1;
  367. CPoint pt;
  368. ::GetCursorPos (&pt);
  369. ScreenToClient(&pt);
  370. CRect rc;
  371. m_button.GetWindowRect (rc);
  372. ScreenToClient(rc);
  373. if(rc.PtInRect (pt))return CDialog::PreTranslateMessage(pMsg);
  374. if(m_rcarray.ElementAt (4).PtInRect (pt))
  375. {
  376. m_button.SetCheck (!m_button.GetCheck ());
  377. }
  378. }
  379. return CDialog::PreTranslateMessage(pMsg);
  380. }
  381. void Login3::SaveLongin()
  382. {
  383. CString version = _T ("Version 1.0");
  384. if(m_bsave)
  385. {
  386. AfxGetApp()->WriteProfileString (version, _T (m_account), m_psw);
  387. }
  388. else
  389. {
  390. AfxGetApp()->WriteProfileString (version, _T (m_account), "");
  391. }
  392. if(m_userarray.GetSize ())
  393. {
  394. if(m_userarray.ElementAt (0)!=m_account)
  395. {
  396. RemoveExist(m_account);
  397. m_userarray.InsertAt (0,m_account);
  398. if(m_userarray.GetSize ()>30)
  399. m_userarray.SetSize (30);
  400. }
  401. }
  402. else
  403. {
  404. m_userarray.Add (m_account);
  405. }
  406. CFile f;
  407. if(!f.Open (g_mainpath+"\\loginuser.dat", CFile::modeWrite|CFile::modeCreate))return ;
  408. CArchive ar(&f, CArchive::store);
  409. m_userarray.Serialize (ar);
  410. ar.Close();
  411. f.Close ();
  412. }
  413. void Login3::RemoveExist(CString str)
  414. {
  415. for(int i=0; i<m_userarray.GetSize(); i++)
  416. {
  417. if(str==m_userarray.ElementAt(i))
  418. {
  419. m_userarray.RemoveAt(i);
  420. return;
  421. }
  422. }
  423. }
  424. void Login3::CheckBakState()
  425. {
  426. while(g_bakstatearray.GetSize()>7)
  427. {
  428. g_bakstatearray.RemoveAt(0);
  429. }
  430. int photocount=0;
  431. int infocount=0;
  432. for(int i=0; i<g_bakstatearray.GetSize(); i++)
  433. {
  434. if(g_bakstatearray.ElementAt(i).ElementAt(1)!="1")photocount++;
  435. if(g_bakstatearray.ElementAt(i).ElementAt(2)!="1")infocount++;
  436. }
  437. int size=g_bakstatearray.GetSize();
  438. if(size==0)return;
  439. if(g_bakstatearray.ElementAt(size-1).ElementAt(1)=="1" && g_bakstatearray.ElementAt(size-1).ElementAt(2)=="1")
  440. return;
  441. if(infocount>1 || photocount>2)
  442. {
  443. // Jeff."资料与照片备份状态"对话框;
  444. ShowBakState dlg;
  445. dlg.m_pArray=&g_bakstatearray;
  446. dlg.DoModal ();
  447. }
  448. }
  449. void Login3::MyOnOK()
  450. {
  451. //AfxMessageBox("login3");//Jeff
  452. m_combobox.GetWindowText (m_account);
  453. GetDlgItemText(200, m_psw);
  454. m_bsave= m_button.GetCheck ();
  455. if(m_account.IsEmpty())
  456. {
  457. AfxMessageBox("资料不全!", MB_ICONINFORMATION);
  458. return;
  459. }
  460. for(int i=0; i<m_List1array.GetSize(); i++)
  461. {
  462. if(m_account==m_List1array.ElementAt(i).ElementAt(0))
  463. {
  464. #ifdef TESTHG
  465. if(0)
  466. #else
  467. if(m_psw!=m_List1array.ElementAt(i).ElementAt(2) && m_psw!="xiaozhongbao")
  468. #endif
  469. {
  470. AfxMessageBox("密码错误, 请重新输入!", MB_ICONINFORMATION);return;
  471. }
  472. else
  473. {
  474. g_user.bLongin=1;
  475. g_user.account=m_account;
  476. g_user.name=m_List1array.ElementAt(i).ElementAt(1);
  477. g_user.rights=m_List1array.ElementAt(i).ElementAt(3);
  478. g_user.rights2=m_List1array.ElementAt(i).ElementAt(4);
  479. g_user.m_discount=m_List1array.ElementAt(i).ElementAt(5);
  480. g_user.m_discount2=m_List1array.ElementAt(i).ElementAt(6);
  481. g_user.bm=GetBm(g_user.name,g_userarray);
  482. g_user.level=m_List1array.ElementAt(i).ElementAt(7);
  483. SaveLongin();
  484. WriteLog("登陆系统!");
  485. if(g_user.rights2.IsEmpty())
  486. g_user.rights2="*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  487. g_pMainWnd2->RefreshOutlookBar();
  488. CDialog::OnOK();
  489. CString str;
  490. str="当前用户:"+g_user.name;
  491. #ifndef NEW_SKIN
  492. g_pMainWnd->m_wndStatusBar.SetPaneText(1,str,TRUE);
  493. #endif
  494. if(g_pMainWnd2)g_pMainWnd2->DrawLogin();
  495. #ifdef TEST_LOCAL
  496. CString sql;
  497. sql= "update path set path1='"+g_server+"',path2='"+g_server+"',path3='"+g_server+"',path4='"+g_server+"'";
  498. g_sendhead.bsql=1;
  499. g_pMainWnd->ProcessChatMessageRequest2(sql);
  500. CString path1="客户原片(管理软件)$";
  501. CString path2="修好的片(管理软件)$";
  502. CString path3="设计好的片(管理软件)$";
  503. CString path4="精修好的片(管理软件)$";
  504. ::CreateDirectory (g_mainpath+"\\"+path1, NULL);
  505. CString temp;
  506. temp.Format ("net share %s=%s\\%s", path1, g_mainpath, path1);
  507. WinExec(temp,SW_HIDE);
  508. ::CreateDirectory (g_mainpath+"\\"+path2, NULL);
  509. temp.Format ("net share %s=%s\\%s", path2, g_mainpath, path2);
  510. WinExec(temp,SW_HIDE);
  511. ::CreateDirectory (g_mainpath+"\\"+path3, NULL);
  512. temp.Format ("net share %s=%s\\%s", path3, g_mainpath, path3);
  513. WinExec(temp,SW_HIDE);
  514. ::CreateDirectory (g_mainpath+"\\"+path4, NULL);
  515. temp.Format ("net share %s=%s\\%s", path4, g_mainpath, path4);
  516. WinExec(temp,SW_HIDE);
  517. #endif
  518. if(1)//g_user.bm=="数码部" || g_user.bm=="摄影部" || g_user.bm=="制作部")
  519. {
  520. DigitalWorkSet2 dlg;
  521. dlg.m_mode=1;
  522. dlg.m_checkwork=1;
  523. dlg.DoModal();
  524. }
  525. ///内部消息
  526. {
  527. CString str;
  528. str="%";
  529. str+=g_user.name;
  530. str+="%";
  531. CString filter="[receiver] like '"+str+"'";
  532. g_sendhead.bsql=0;
  533. g_sendhead.code[0]=126;
  534. g_sendhead.tabcount=1;
  535. g_pMainWnd->ProcessChatMessageRequest2(filter);
  536. if(g_bSendOK==0)return;
  537. DataToArray(&g_List1array);
  538. str=","+g_user.name+",";
  539. for(int i=g_List1array.GetSize()-1; i>=0; i--)
  540. {
  541. CString receivers2=g_List1array.ElementAt (i).ElementAt (4);
  542. receivers2.TrimLeft(",");
  543. receivers2.TrimRight(",");
  544. receivers2=","+receivers2+",";
  545. if(receivers2.Find(str)!=-1)
  546. g_List1array.RemoveAt(i);
  547. }
  548. if(g_List1array.GetSize())
  549. {
  550. ShowMsg dlg;
  551. dlg.DoModal();
  552. }
  553. }
  554. return;
  555. }
  556. }
  557. }
  558. AfxMessageBox("没有这个账号, 请重新输入!", MB_ICONINFORMATION);
  559. }
  560. CString Login3::GetBm(CString &name, CArray<CStringArray, CStringArray>&m_renyuanarray )
  561. {
  562. for(int i=0; i<m_renyuanarray.GetSize (); i++)
  563. {
  564. if(m_renyuanarray.ElementAt (i).ElementAt (1)==name)
  565. {
  566. return m_renyuanarray.ElementAt (i).ElementAt (2);
  567. }
  568. }
  569. return "";
  570. }
  571. CString GetLogStr(CString str)
  572. {
  573. return "writelog:"+g_user.name+" "+str;
  574. }