// HospitalClient.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "HospitalClient.h" #include "MyMdi.H" #include "ModifyDinDan.h" #include "InputPsw.h" #include "TakeMoney2.h" #include "NeroDlg.h" #include "ClientRequirement.h" #include "ChoosePhotoSkin2.h" #include "./helper/ffsco.h" #include "AddHospitalClient.h" #include "SendMsgDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif #pragma comment(lib, "Shlwapi.lib") ///////////////////////////////////////////////////////////////////////////// // HospitalClient IMPLEMENT_DYNCREATE(HospitalClient, MyFormView) HospitalClient::HospitalClient() : MyFormView(HospitalClient::IDD) { m_datetype = 0; m_date2 = GetTmFromStr(g_date); m_date1 = m_date2 - CTimeSpan(30, 0, 0, 0); m_addr = _T(""); m_phone = _T(""); m_bSearchAll = 0; m_id = _T(""); m_name = _T(""); //}}AFX_DATA_INIT } HospitalClient::~HospitalClient() { } void HospitalClient::DoDataExchange(CDataExchange* pDX) { MyFormView::DoDataExchange(pDX); //{{AFX_DATA_MAP(HospitalClient) DDX_Control(pDX, IDC_COMBOclerk, clerkCombo); DDX_Control(pDX, IDC_COMBOtype, typeCombo); DDX_Control(pDX, IDC_COMBOfrom, fromCombo); DDX_Control(pDX, IDC_COMBOhospital, hospitalCombo); DDX_Control(pDX, IDC_COMBObusinessintention, businessintentionCombo); DDX_Control(pDX, IDC_COMBObusinesstype, businesstypeCombo); DDX_Control(pDX, IDC_LIST2, m_List1); DDX_Control(pDX, IDC_STATIC1, m_static1); DDX_Radio(pDX, IDC_RADIO1, m_datetype); DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKERdate1, m_date1); DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKERdate2, m_date2); DDX_Text(pDX, IDC_EDITaddr1, m_addr); DDX_Text(pDX, IDC_EDITphone1, m_phone); DDX_Text(pDX, IDC_EDITid, m_id); DDX_Text(pDX, IDC_EDITname, m_name); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(HospitalClient, MyFormView) //{{AFX_MSG_MAP(HospitalClient) ON_BN_CLICKED(IDC_BUTclose, OnBUTclose) ON_BN_CLICKED(IDC_BUTTON1, OnButton1) ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1) ON_WM_TIMER() ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto) ON_BN_CLICKED(IDC_BUTTON2, OnButton2) ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2) ON_BN_CLICKED(IDC_BUTburncd, OnBUTHospitalClient) ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2) ON_BN_CLICKED(IDC_BUTburncd2, OnBUTburncd2) ON_BN_CLICKED(IDC_BUTburncd3, OnBUTburncd3) ON_BN_CLICKED(IDC_BUTsendmsg, OnBUTsendmsg) ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // HospitalClient diagnostics #ifdef _DEBUG void HospitalClient::AssertValid() const { MyFormView::AssertValid(); } void HospitalClient::Dump(CDumpContext& dc) const { MyFormView::Dump(dc); } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // HospitalClient message handlers void HospitalClient::OnInitialUpdate() { //AfxMessageBox("�����ѯ");//Jeff MyFormView::OnInitialUpdate(); // GetDlgItem(IDC_BUTburncd)->EnableWindow(IsHasRights2new(0)); // GetDlgItem(IDC_BUTburncd2)->EnableWindow(IsHasRights2new(0)); GetDlgItem(IDC_BUTburncd3)->EnableWindow(IsHasRights2new(49)); GetDlgItem(IDC_BUTprint3)->EnableWindow(IsHasRights2new(49)); // TODO: Add your specialized code here and/or call the base class CMyMdi Mdi; Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this); // Here we create the outbar control using the splitter as its parent // and setting its id to the first pane. CRect rc2; GetWindowRect(rc2); ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE); EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0); int idarray[] = { IDC_BUTburncd, IDC_BUTburncd2, IDC_BUTburncd3, IDC_BUTsendmsg, IDC_BUTprint3, IDC_BUTclose }; int idcount = 6; int btnwid; CRect prerc; for (int a = idcount - 2; a >= 0; a--) { GetDlgItem(idarray[a + 1])->GetWindowRect(prerc); ScreenToClient(prerc); GetDlgItem(idarray[a])->GetWindowRect(rc2); ScreenToClient(rc2); btnwid = rc2.Width(); rc2.right = prerc.left; rc2.left = rc2.right - btnwid; GetDlgItem(idarray[a])->MoveWindow(rc2); } m_static1.SetFont(&g_titlefont); #if 0 // Jeff 2014.05.19 m_List1.SetHeadings("��������,100;�ͻ�����,100;��������,100;�����Ա�,100;����,100;���,100;ҽԺ,100;�绰1,100;�绰2,100;QQ,100;��ַ1,100;��ַ2,100;��ַ3,100;¼������,100;����,100;¼��Ա,100;ҵ������,100;ҵ������,100;ԤԼ����,100;���ŵ�ַ,100;��ע,100" ); #else m_List1.SetHeadings("��������,100;�ͻ�����,100;��������,100;�����Ա�,100;��������,100;��������,100;����,100;���,100;ҽԺ,100;�绰1,100;�绰2,100;QQ,100;��ַ1,100;��ַ2,100;��ַ3,100;¼������,100;����,100;¼��Ա,100;ҵ������,100;ҵ������,100;ԤԼ����,100;���ŵ�ַ,100;��ע,100"); #endif m_List1.LoadColumnInfo(144); m_List1.m_bSortSupport = 0; g_sendhead.bsql = 0; g_sendhead.code[0] = 200; g_sendhead.code[1] = 201; g_sendhead.code[2] = 202; g_sendhead.code[3] = 203; g_sendhead.code[4] = 82; g_sendhead.tabcount = 5; //LOG4C((LOG_NOTICE,"ProcessChatMessageRequest2=3")); g_pMainWnd->ProcessChatMessageRequest2(3); if (g_bSendOK) { CArray<CStringArray, CStringArray>List1array; CArray<CStringArray, CStringArray>List2array; CArray<CStringArray, CStringArray>List3array; CArray<CStringArray, CStringArray>List4array; CArray<CStringArray, CStringArray>List5array; DataToArray(&List1array, &List2array, &List3array, &List4array, &List5array); for (int ii = 0; ii < List1array.GetSize(); ii++) businesstypeCombo.AddString(List1array.ElementAt(ii).ElementAt(0)); for (ii = 0; ii < List2array.GetSize(); ii++) businessintentionCombo.AddString(List2array.ElementAt(ii).ElementAt(0)); for (ii = 0; ii < List3array.GetSize(); ii++) typeCombo.AddString(List3array.ElementAt(ii).ElementAt(0)); for (ii = 0; ii < List4array.GetSize(); ii++) hospitalCombo.AddString(List4array.ElementAt(ii).ElementAt(0)); for (ii = 0; ii < List5array.GetSize(); ii++) fromCombo.AddString(List5array.ElementAt(ii).ElementAt(0)); businesstypeCombo.AddString(""); businessintentionCombo.AddString(""); typeCombo.AddString(""); hospitalCombo.AddString(""); fromCombo.AddString(""); } GetData(); /* m_combo1.GetWindowRect (rc2); ScreenToClient(rc2); rc2.bottom +=200; m_combo1.MoveWindow (rc2); GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2); SetComboHei(&m_combo1, rc2.Height ());*/ } void HospitalClient::OnBUTclose() { // TODO: Add your control notification handler code here GetParent()->SendMessage(WM_CLOSE); } void HospitalClient::OnSelchangeCombo1() { // TODO: Add your control notification handler code here SetTimer(1, 100, NULL); } void HospitalClient::OnTimer(UINT nIDEvent) { // TODO: Add your message handler code here and/or call default KillTimer(nIDEvent); OnButton1(); } BOOL HospitalClient::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class try { if (pMsg->message == WM_KEYDOWN) { switch (pMsg->wParam) { case VK_RETURN: OnButton1(); return 1; case 0x43: // copy if ((GetKeyState(VK_CONTROL) & 0x80)) { GetFocus()->SendMessage(WM_COPY); return TRUE; } break; case 0x56: //Ctrl + V: if ((GetKeyState(VK_CONTROL) & 0x80)) { GetFocus()->SendMessage(WM_PASTE); return TRUE; } break; case 0x58: // cut if ((GetKeyState(VK_CONTROL) & 0x80)) { GetFocus()->SendMessage(WM_CUT); return TRUE; } break; case 0x5A: //undo case 0x59: //redo if ((GetKeyState(VK_CONTROL) & 0x80)) { GetFocus()->SendMessage(WM_UNDO); return TRUE; } break; } } return MyFormView::PreTranslateMessage(pMsg); } catch (...) { } } extern int CALLBACK BrowseProc(HWND hwnd, UINT msg, LPARAM lParam, LPARAM lpData); /*{ switch(msg) { case BFFM_INITIALIZED: SendMessage(hwnd, BFFM_SETSELECTION, TRUE, NULL); break; case BFFM_SELCHANGED: { char szFileName[MAX_PATH]; LPITEMIDLIST pidlCurrent = (LPITEMIDLIST)lParam; SHGetPathFromIDList(pidlCurrent, szFileName); SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM)szFileName); } break; } return 0; }*/ void HospitalClient::GetSavePath(CString &path) { char lpszDisplayName[MAX_PATH], szFileName[MAX_PATH]; LPITEMIDLIST pidlDesktop, pidlCurrent; if (SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidlDesktop) == NOERROR) { BROWSEINFO bi; bi.hwndOwner = this->m_hWnd; bi.pidlRoot = pidlDesktop; bi.pszDisplayName = lpszDisplayName; bi.lpszTitle = "\n�ĵ������Ŀ¼:"; bi.ulFlags = BIF_STATUSTEXT&BIF_RETURNONLYFSDIRS; bi.lpfn = BrowseProc; bi.lParam = 0; bi.iImage = 0; pidlCurrent = SHBrowseForFolder(&bi); SHGetPathFromIDList(pidlCurrent, szFileName); path = szFileName; } } int HospitalClient::FindArray(CStringArray *pArray, CString Str) { for (int i = 0; i < pArray->GetSize(); i++) { if (pArray->ElementAt(i) == Str) return i; } return -1; } void HospitalClient::GetNo(CString str, CStringArray &array) { if (!str.IsEmpty()) { int pos = str.Find(","); while (pos != -1) { if (FindArray(&array, str.Left(pos)) == -1) array.Add(str.Left(pos)); str = str.Right(str.GetLength() - pos - 1); pos = str.Find(","); } if (FindArray(&array, str) == -1) array.Add(str); } } CString HospitalClient::GetSelName(CString name, CArray<CStringArray, CStringArray>&spnamearray) { CString ret; name = "," + name + ","; CString str; for (int i = 0; i < spnamearray.GetSize(); i++) { str = "," + spnamearray.ElementAt(i).ElementAt(6) + ","; if (str.Find(name) != -1) { ret += spnamearray.ElementAt(i).ElementAt(5); ret += ";"; } } ret.TrimRight(";"); ret.Replace("*", "x"); return ret; } void HospitalClient::OnBUTshowphoto() { // TODO: Add your control notification handler code here POSITION pos; pos = m_List1.GetFirstSelectedItemPosition(); if (pos == NULL) { AfxMessageBox("����ѡ����Ҫ�鿴�Ķ���!", MB_ICONINFORMATION); return; } int iItem = m_List1.GetNextSelectedItem(pos); CString status = m_List1.GetItemText(iItem, 4); CString id = m_List1.GetItemText(iItem, 0); if (status == "δ���") { AfxMessageBox("�˵�δ��Ƭ!", MB_ICONINFORMATION); return; } /* ShowPic dlg; dlg.m_path=g_path3+"\\"; dlg.m_path+=id; dlg.m_path +="\\"; dlg.DoModal ();*/ ChoosePhotoSkin2 dlg; dlg.m_Runingmode = 1; dlg.SetLiaPath("3.lia"); dlg.m_strOrderNumber = id; dlg.m_path = g_path3 + "\\"; dlg.m_path += id; dlg.m_path += "\\"; dlg.DoModal(); for (int i = 0; i < m_List1array.GetSize(); i++) { if (id == m_List1array.ElementAt(i).ElementAt(0)) { m_List1array.ElementAt(i).SetAt(7, dlg.m_bz2); // FillGrid(); break; } } } // Jeff 2014.05.20:��ʼ��ѯ��ť�� void HospitalClient::OnButton1() // ��ʼ��ѯ��ť; { // TODO: Add your control notification handler code here m_bSearchAll = 0; FillGrid(); } // ȫ����ѯ��ť; void HospitalClient::OnButton2()// ȫ����ѯ��ť; { // TODO: Add your control notification handler code here m_bSearchAll = 1; FillGrid(); } void HospitalClient::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult) { NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; // TODO: Add your control notification handler code here *pResult = 0; } void HospitalClient::OnBUTHospitalClient() { // TODO: Add your control notification handler code here AddHospitalClient dlg; dlg.DoModal(); GetData(); } void HospitalClient::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here POSITION pos; pos = m_List1.GetFirstSelectedItemPosition(); if (pos == NULL)return; OnBUTburncd2(); *pResult = 0; } void HospitalClient::OnBUTburncd2() // �İ�ť; { // TODO: Add your control notification handler code here POSITION pos; pos = m_List1.GetFirstSelectedItemPosition(); if (pos == NULL) { AfxMessageBox("����ѡ����Ҫ�ĵĿͻ�!", MB_ICONINFORMATION); return; } int iItem = m_List1.GetNextSelectedItem(pos); CString id = m_List1.GetItemText(iItem, 0); while (id == "") { iItem--; id = m_List1.GetItemText(iItem, 0); } AddHospitalClient dlg; dlg.bAdd = 0; dlg.no = id; dlg.DoModal(); GetData(); } void HospitalClient::OnBUTburncd3() { // TODO: Add your control notification handler code here POSITION pos; pos = m_List1.GetFirstSelectedItemPosition(); if (pos == NULL) { AfxMessageBox("����ѡ����Ҫɾ���Ŀͻ�!", MB_ICONINFORMATION); return; } int iItem = m_List1.GetNextSelectedItem(pos); CString id = m_List1.GetItemText(iItem, 0); while (id == "") { iItem--; id = m_List1.GetItemText(iItem, 0); } if (AfxMessageBox("ȷ��ɾ����?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return; CString sql; sql.Format("delete from hospitalclient where id='%s'***delete from hospitalclientcontactreg where id='%s'", id, id); g_sendhead.bsql = 1; g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return; GetData(); } void HospitalClient::OnBUTsendmsg() // ������ ��ť; { // TODO: Add your control notification handler code here POSITION pos; pos = m_List1.GetFirstSelectedItemPosition(); if (pos == NULL) { AfxMessageBox("����ѡ����Ҫ���Ͷ��ŵĿ���!", MB_ICONINFORMATION); return; } int iItem; CStringArray array; while (pos) { iItem = m_List1.GetNextSelectedItem(pos); // ��ȡ�ֻ�����; if (!m_List1.GetItemText(iItem, 9).IsEmpty()) array.Add(m_List1.GetItemText(iItem, 9)); if (!m_List1.GetItemText(iItem, 10).IsEmpty()) array.Add(m_List1.GetItemText(iItem, 10)); } SendMsgDlg dlg; dlg.m_mode = 2; dlg.m_pArray = &array; dlg.DoModal(); } void HospitalClient::OnBUTprint3() // ������ť; { ListToXLS(&m_List1, "c:\\�����б�.xls", 0); } // ��ȡ���� void HospitalClient::GetData() { g_sendhead.bsql = 0; g_sendhead.code[0] = 205; g_sendhead.tabcount = 1; g_pMainWnd->ProcessChatMessageRequest2(1); if (g_bSendOK == 0) return; DataToArray(&m_List1array); if (m_List1array.GetSize()) { CString id = m_List1array.ElementAt(0).ElementAt(0); for (int ii = 1; ii < m_List1array.GetSize(); ii++) { if (m_List1array.ElementAt(ii).ElementAt(0) == id) { m_List1array.ElementAt(ii).SetAt(0, ""); m_List1array.ElementAt(ii).SetAt(1, ""); m_List1array.ElementAt(ii).SetAt(2, ""); m_List1array.ElementAt(ii).SetAt(3, ""); m_List1array.ElementAt(ii).SetAt(4, ""); m_List1array.ElementAt(ii).SetAt(5, ""); m_List1array.ElementAt(ii).SetAt(6, ""); m_List1array.ElementAt(ii).SetAt(7, ""); m_List1array.ElementAt(ii).SetAt(8, ""); m_List1array.ElementAt(ii).SetAt(9, ""); m_List1array.ElementAt(ii).SetAt(10, ""); m_List1array.ElementAt(ii).SetAt(11, ""); m_List1array.ElementAt(ii).SetAt(12, ""); m_List1array.ElementAt(ii).SetAt(13, ""); m_List1array.ElementAt(ii).SetAt(14, ""); m_List1array.ElementAt(ii).SetAt(15, ""); m_List1array.ElementAt(ii).SetAt(21, ""); m_List1array.ElementAt(ii).SetAt(22, ""); m_List1array.ElementAt(ii).SetAt(23, ""); // Jeff Add 20014.05.20 m_List1array.ElementAt(ii).SetAt(24, ""); // Jeff Add 20014.05.20 } else id = m_List1array.ElementAt(ii).ElementAt(0); } } FillGrid(); } void HospitalClient::FillGrid() { UpdateData(); m_List1.DeleteAllItems2(); int ii = 0; int maxsize = m_List1array.GetSize(); m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1); CArray<int, int>signarray; for (int i = 0; i < maxsize; i++) signarray.Add(1); int count = 0; CArray<int, int>posarray; if (m_bSearchAll) // ��ѯȫ��hostpitalview�ļ�¼; { for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++) { #if 0 // Jeff; // LOG4C((LOG_NOTICE,"�������ͣ�%s",m_List1array.ElementAt(ii).ElementAt(4))); if ( m_List1array.ElementAt(ii).ElementAt(4) == "0") m_List1array.ElementAt(ii).SetAt(4,"��������"); else m_List1array.ElementAt(ii).SetAt(4,"Ԥ����"); #endif m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii)); } } else { CString date1 = m_date1.Format("%Y-%m-%d"); CString date2 = m_date2.Format("%Y-%m-%d"); CString type, hospital, from, clerk, businesstype, businessintention; // �ͻ����; int pos = typeCombo.GetCurSel(); if (pos != -1) { typeCombo.GetLBText(pos, type); } // ����ҽԺ; pos = hospitalCombo.GetCurSel(); if (pos != -1) { hospitalCombo.GetLBText(pos, hospital); } // �ͻ�����; pos = fromCombo.GetCurSel(); if (pos != -1) { fromCombo.GetLBText(pos, from); } // ����; pos = clerkCombo.GetCurSel(); if (pos != -1) { clerkCombo.GetLBText(pos, clerk); } // ҵ������; pos = businesstypeCombo.GetCurSel(); if (pos != -1) { businesstypeCombo.GetLBText(pos, businesstype); } // ҵ������; pos = businessintentionCombo.GetCurSel(); if (pos != -1) { businessintentionCombo.GetLBText(pos, businessintention); } // ����ʱ��; if (m_datetype) { BOOL bFinded = 0; for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++) { if (bFinded && m_List1array.ElementAt(ii).ElementAt(0).IsEmpty()) { continue; } //if(m_List1array.ElementAt (ii).ElementAt (13)<date1 || m_List1array.ElementAt (ii).ElementAt (13)>date2)//Jeff:hostpitalview���������ֶ�,���ﲻ��13 if (m_List1array.ElementAt(ii).ElementAt(15) < date1 || m_List1array.ElementAt(ii).ElementAt(15) > date2) { signarray.SetAt(ii, 0); bFinded = 0; continue; } bFinded = 1; } } // �ͻ�����; if (from != "") { BOOL bFinded = 0; for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++) { if (bFinded && m_List1array.ElementAt(ii).ElementAt(0).IsEmpty()) { continue; } //if(m_List1array.ElementAt (ii).ElementAt (4)!=from)////Jeff:hostpitalview���������ֶΣ����ﲻΪ4 if (m_List1array.ElementAt(ii).ElementAt(6) != from) { signarray.SetAt(ii, 0); bFinded = 0; continue; } bFinded = 1; } } // �ͻ����; if (type != "") { BOOL bFinded = 0; for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++) { if (bFinded && m_List1array.ElementAt(ii).ElementAt(0).IsEmpty()) { continue; } //if(m_List1array.ElementAt (ii).ElementAt (5)!=type)//Jeff:hostpitalview���������ֶΣ����ﲻΪ5 if (m_List1array.ElementAt(ii).ElementAt(7) != type) { signarray.SetAt(ii, 0); bFinded = 0; continue; } bFinded = 1; } } // ����ҽԺ; if (hospital != "") { BOOL bFinded = 0; for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++) { if (bFinded && m_List1array.ElementAt(ii).ElementAt(0).IsEmpty()) { continue; } //if(m_List1array.ElementAt (ii).ElementAt (6)!=hospital)//Jeff:hostpitalview���������ֶΣ����ﲻΪ6 if (m_List1array.ElementAt(ii).ElementAt(8) != hospital) { signarray.SetAt(ii, 0); bFinded = 0; continue; } bFinded = 1; } } // ����; if (clerk != "") { BOOL bFinded = 0; for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++) { if (bFinded && m_List1array.ElementAt(ii).ElementAt(0).IsEmpty()) { continue; } //if(m_List1array.ElementAt (ii).ElementAt (14)!=clerk)//Jeff:hostpitalview���������ֶΣ����ﲻΪ14 if (m_List1array.ElementAt(ii).ElementAt(16) != clerk)// { signarray.SetAt(ii, 0); bFinded = 0; continue; } bFinded = 1; } } // �ֻ�; if (m_phone != "") { BOOL bFinded = 0; for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++) { if (bFinded && m_List1array.ElementAt(ii).ElementAt(0).IsEmpty()) { continue; } //Jeff:hostpitalview���������ֶΣ����ﲻΪ7/8 //if(m_List1array.ElementAt (ii).ElementAt (7).Find(m_phone)==-1 && m_List1array.ElementAt (ii).ElementAt (8).Find(m_phone)==-1) if (m_List1array.ElementAt(ii).ElementAt(9).Find(m_phone) == -1 && m_List1array.ElementAt(ii).ElementAt(10).Find(m_phone) == -1) { signarray.SetAt(ii, 0); bFinded = 0; continue; } bFinded = 1; } } // ��ַ; if (m_addr != "") { BOOL bFinded = 0; for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++) { if (bFinded && m_List1array.ElementAt(ii).ElementAt(0).IsEmpty()) { continue; } //Jeff:hostpitalview���������ֶΣ����ﲻΪ10/11/12 //if(m_List1array.ElementAt (ii).ElementAt (10).Find(m_addr)==-1 && m_List1array.ElementAt (ii).ElementAt (11).Find(m_addr)==-1 && m_List1array.ElementAt (ii).ElementAt (12).Find(m_addr)==-1) if (m_List1array.ElementAt(ii).ElementAt(12).Find(m_addr) == -1 && m_List1array.ElementAt(ii).ElementAt(13).Find(m_addr) == -1 && m_List1array.ElementAt(ii).ElementAt(14).Find(m_addr) == -1) { signarray.SetAt(ii, 0); bFinded = 0; continue; } bFinded = 1; } } // ����; if (m_id != "") { BOOL bFinded = 0; for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++) { if (bFinded && m_List1array.ElementAt(ii).ElementAt(0).IsEmpty()) { continue; } if (m_List1array.ElementAt(ii).ElementAt(0).Find(m_id) == -1) { signarray.SetAt(ii, 0); bFinded = 0; continue; } bFinded = 1; } } // ����; if (m_name != "") { m_name.MakeUpper(); BOOL bFinded = 0; for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++) { if (bFinded && m_List1array.ElementAt(ii).ElementAt(0).IsEmpty()) { continue; } //Jeff:hostpitalview���������ֶΣ����ﲻΪ21/22 //if(m_List1array.ElementAt (ii).ElementAt (1).Find(m_name)==-1 && m_List1array.ElementAt (ii).ElementAt (2).Find(m_name)==-1 && m_List1array.ElementAt (ii).ElementAt (21).Find(m_name)==-1 && m_List1array.ElementAt (ii).ElementAt (22).Find(m_name)==-1) if (m_List1array.ElementAt(ii).ElementAt(1).Find(m_name) == -1 && m_List1array.ElementAt(ii).ElementAt(2).Find(m_name) == -1 && m_List1array.ElementAt(ii).ElementAt(23).Find(m_name) == -1 && m_List1array.ElementAt(ii).ElementAt(24).Find(m_name) == -1) { signarray.SetAt(ii, 0); bFinded = 0; continue; } bFinded = 1; } } // ��������; if (m_datetype == 0) { BOOL bFinded = 0; for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++) { if (0)//bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ()) { continue; } //Jeff:hostpitalview���������ֶΣ����ﲻΪ18 //if(m_List1array.ElementAt (ii).ElementAt (18)<date1 || m_List1array.ElementAt (ii).ElementAt (18)>date2) if (m_List1array.ElementAt(ii).ElementAt(20) < date1 || m_List1array.ElementAt(ii).ElementAt(20) > date2) { signarray.SetAt(ii, 0); bFinded = 0; continue; } bFinded = 1; } } // ҵ������; if (businesstype != "") { BOOL bFinded = 0; for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++) { if (0)//bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ()) { continue; } //Jeff:hostpitalview���������ֶΣ����ﲻΪ16 //if(m_List1array.ElementAt (ii).ElementAt (16)!=businesstype) if (m_List1array.ElementAt(ii).ElementAt(18) != businesstype) { signarray.SetAt(ii, 0); bFinded = 0; continue; } bFinded = 1; } } // ҵ������; if (businessintention != "") { BOOL bFinded = 0; for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++) { if (0)//bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ()) { continue; } //Jeff:hostpitalview���������ֶΣ����ﲻΪ17 //if(m_List1array.ElementAt (ii).ElementAt (17)!=businessintention) if (m_List1array.ElementAt(ii).ElementAt(19) != businessintention) { signarray.SetAt(ii, 0); bFinded = 0; continue; } bFinded = 1; } } for (ii = 0; ii < signarray.GetSize(); ii++) { if (signarray.ElementAt(ii)) { m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii)); posarray.Add(ii); } } } m_List1.m_arLabels.SetSize(count, 1); // ��ȫ����ѯ; if (m_bSearchAll == 0) { for (int i = 0; i < posarray.GetSize(); i++) { int pos = posarray.ElementAt(i); CString id = m_List1array.ElementAt(pos).ElementAt(0); while (id == "") { pos--; id = m_List1array.ElementAt(pos).ElementAt(0); } posarray.SetAt(i, pos); } for (i = 0; i < count; i++) { if (m_List1.m_arLabels.ElementAt(i).ElementAt(0) == "") { int pos = posarray.ElementAt(i); m_List1.m_arLabels.ElementAt(i).SetAt(0, m_List1array.ElementAt(pos).ElementAt(0)); m_List1.m_arLabels.ElementAt(i).SetAt(1, m_List1array.ElementAt(pos).ElementAt(1)); m_List1.m_arLabels.ElementAt(i).SetAt(2, m_List1array.ElementAt(pos).ElementAt(2)); m_List1.m_arLabels.ElementAt(i).SetAt(3, m_List1array.ElementAt(pos).ElementAt(3)); #if 0 // Jeff // LOG4C((LOG_NOTICE,"�������ͣ�%s",m_List1array.ElementAt(pos).ElementAt(4))); // �������ͣ�Ԥ���ڡ� CString strBirthdayType = ""; if ( m_List1array.ElementAt(pos).ElementAt(4) == "0") { strBirthdayType = "��������"; } else { strBirthdayType = "Ԥ����"; } m_List1.m_arLabels.ElementAt (i).SetAt (4, strBirthdayType ); #else m_List1.m_arLabels.ElementAt(i).SetAt(4, m_List1array.ElementAt(pos).ElementAt(4)); #endif m_List1.m_arLabels.ElementAt(i).SetAt(5, m_List1array.ElementAt(pos).ElementAt(5)); m_List1.m_arLabels.ElementAt(i).SetAt(6, m_List1array.ElementAt(pos).ElementAt(6)); m_List1.m_arLabels.ElementAt(i).SetAt(7, m_List1array.ElementAt(pos).ElementAt(7)); m_List1.m_arLabels.ElementAt(i).SetAt(8, m_List1array.ElementAt(pos).ElementAt(8)); m_List1.m_arLabels.ElementAt(i).SetAt(9, m_List1array.ElementAt(pos).ElementAt(9)); m_List1.m_arLabels.ElementAt(i).SetAt(10, m_List1array.ElementAt(pos).ElementAt(10)); m_List1.m_arLabels.ElementAt(i).SetAt(11, m_List1array.ElementAt(pos).ElementAt(11)); m_List1.m_arLabels.ElementAt(i).SetAt(12, m_List1array.ElementAt(pos).ElementAt(12)); m_List1.m_arLabels.ElementAt(i).SetAt(13, m_List1array.ElementAt(pos).ElementAt(13)); m_List1.m_arLabels.ElementAt(i).SetAt(14, m_List1array.ElementAt(pos).ElementAt(14)); m_List1.m_arLabels.ElementAt(i).SetAt(15, m_List1array.ElementAt(pos).ElementAt(15)); m_List1.m_arLabels.ElementAt(i).SetAt(21, m_List1array.ElementAt(pos).ElementAt(21)); m_List1.m_arLabels.ElementAt(i).SetAt(22, m_List1array.ElementAt(pos).ElementAt(22)); m_List1.m_arLabels.ElementAt(i).SetAt(23, m_List1array.ElementAt(pos).ElementAt(21));// add Jeff 0214.05.21 m_List1.m_arLabels.ElementAt(i).SetAt(24, m_List1array.ElementAt(pos).ElementAt(22));// add Jeff 0214.05.21 } } if (m_List1.m_arLabels.GetSize()) { CString id = m_List1.m_arLabels.ElementAt(0).ElementAt(0); for (int ii = 1; ii < m_List1.m_arLabels.GetSize(); ii++) { if (m_List1.m_arLabels.ElementAt(ii).ElementAt(0) == id) { m_List1.m_arLabels.ElementAt(ii).SetAt(0, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(1, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(2, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(3, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(4, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(5, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(6, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(7, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(8, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(9, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(10, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(11, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(12, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(13, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(14, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(15, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(21, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(22, ""); m_List1.m_arLabels.ElementAt(ii).SetAt(23, "");// add by Jeff 2014.05.21 m_List1.m_arLabels.ElementAt(ii).SetAt(24, "");// add by Jeff 2014.05.21 } else id = m_List1.m_arLabels.ElementAt(ii).ElementAt(0); } } } ii = count; m_List1.m_LabelCount = ii; m_List1.SetItemCountEx(ii); CString str; str.Format("��Ŀ:%d", ii); SetDlgItemText(IDC_STATIC2, str); }