// TodayForm2.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "TodayForm2.h" #include "MyMdi.H" #include "TakeControlDlg1.h" #include "TakeControlDlg2.h" #include "TakeControlDlg3.h" #include "TakeControlDlg4.h" #include "TakeControlDlg9.h" #include "SendMsgDlg.h" #include "SearchTake.h" #include "ChooseDesignSkin.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif extern CTime g_todaytm; extern int g_todayradio; extern int g_todaycheck; ///////////////////////////////////////////////////////////////////////////// // TodayForm2 IDC_STATIC2 IMPLEMENT_DYNCREATE(TodayForm2, MyFormView) TodayForm2::TodayForm2() : MyFormView(TodayForm2::IDD) { //{{AFX_DATA_INIT(TodayForm2) m_radio = g_todayradio; m_check = FALSE; m_check2 = FALSE; m_nscrollpos = 0; //}}AFX_DATA_INIT m_mode = 0; m_year = g_todaytm.GetYear(); m_month = g_todaytm.GetMonth(); m_day = g_todaytm.GetDay(); m_bInit = 0; if (g_todaycheck == 1) m_check = 1; else if (g_todaycheck == 2) m_check2 = 1; } TodayForm2::~TodayForm2() { } void TodayForm2::DoDataExchange(CDataExchange* pDX) { MyFormView::DoDataExchange(pDX); //{{AFX_DATA_MAP(TodayForm2) DDX_Control(pDX, IDC_COMBO6, m_combo1); DDX_Control(pDX, IDC_SCROLLBAR1, m_scrollbar); DDX_Control(pDX, IDC_LIST10, m_List6); DDX_Control(pDX, IDC_LIST8, m_List5); DDX_Control(pDX, IDC_LIST7, m_List4); DDX_Control(pDX, IDC_LIST4, m_List3); DDX_Control(pDX, IDC_LIST3, m_List2); DDX_Control(pDX, IDC_LIST2, m_List1); DDX_Control(pDX, IDC_SPIN3, m_spinday); DDX_Control(pDX, IDC_SPIN2, m_spinmonth); DDX_Control(pDX, IDC_SPIN1, m_spinyear); DDX_Control(pDX, IDC_STATIC1, m_static1); DDX_Text(pDX, IDC_EDITyear, m_year); DDV_MinMaxUInt(pDX, m_year, 1900, 3000); DDX_Text(pDX, IDC_EDITmonth, m_month); DDV_MinMaxUInt(pDX, m_month, 1, 12); DDX_Text(pDX, IDC_EDITday, m_day); DDV_MinMaxUInt(pDX, m_day, 1, 31); DDX_Radio(pDX, IDC_RADIO3, m_radio); DDX_Check(pDX, IDC_CHECK1, m_check); DDX_Check(pDX, IDC_CHECK2, m_check2); DDX_Scroll(pDX, IDC_SCROLLBAR1, m_nscrollpos); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(TodayForm2, MyFormView) //{{AFX_MSG_MAP(TodayForm2) ON_BN_CLICKED(IDC_BUTclose, OnBUTclose) ON_BN_CLICKED(IDC_BUTtake, OnBUTtake) ON_BN_CLICKED(IDC_BUTchoose, OnBUTchoose) ON_BN_CLICKED(IDC_BUTtakeaway, OnBUTtakeaway) ON_BN_CLICKED(IDC_BUTall, OnBUTall) ON_BN_CLICKED(IDC_BUTchoose3, OnBUTchoose3) ON_BN_CLICKED(IDC_CHECK1, OnCheck1) ON_EN_CHANGE(IDC_EDITyear, OnChangeEDITyear) ON_EN_CHANGE(IDC_EDITmonth, OnChangeEDITmonth) ON_EN_CHANGE(IDC_EDITday, OnChangeEDITday) ON_BN_CLICKED(IDC_RADIO3, OnRadio3) ON_BN_CLICKED(IDC_RADIO4, OnRadio4) ON_BN_CLICKED(IDC_RADIO5, OnRadio5) ON_BN_CLICKED(IDC_RADIO6, OnRadio6) ON_BN_CLICKED(IDC_CHECK2, OnCheck2) ON_BN_CLICKED(IDC_BUTmsg, OnBUTmsg) ON_BN_CLICKED(IDC_RADIO7, OnRadio7) ON_BN_CLICKED(IDC_BUTtake3, OnBUTtake3) ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2) ON_NOTIFY(NM_CLICK, IDC_LIST3, OnClickList3) ON_NOTIFY(NM_CLICK, IDC_LIST4, OnClickList4) ON_NOTIFY(NM_CLICK, IDC_LIST7, OnClickList7) ON_NOTIFY(NM_CLICK, IDC_LIST8, OnClickList8) ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2) ON_NOTIFY(NM_DBLCLK, IDC_LIST3, OnDblclkList3) ON_NOTIFY(NM_DBLCLK, IDC_LIST4, OnDblclkList4) ON_NOTIFY(NM_DBLCLK, IDC_LIST7, OnDblclkList7) ON_BN_CLICKED(IDC_RADIO8, OnRadio8) ON_NOTIFY(NM_CLICK, IDC_LIST10, OnClickList10) ON_WM_VSCROLL() ON_WM_MOUSEWHEEL() //}}AFX_MSG_MAP ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST7, OnCustomdrawList4) ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST4, OnCustomdrawList3) ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST2, OnCustomdrawList1) ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST3, OnCustomdrawList2) ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST8, OnCustomdrawList5) ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST10, OnCustomdrawList6) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // TodayForm2 diagnostics #ifdef _DEBUG void TodayForm2::AssertValid() const { MyFormView::AssertValid(); } void TodayForm2::Dump(CDumpContext& dc) const { MyFormView::Dump(dc); } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // TodayForm2 message handlers void TodayForm2::OnInitialUpdate() { MyFormView::OnInitialUpdate(); m_List5.m_bSortSupport = 0; m_List2.ShowWindow(SW_HIDE); m_List3.ShowWindow(SW_HIDE); m_List4.ShowWindow(SW_HIDE); m_List5.ShowWindow(SW_HIDE); m_List6.ShowWindow(SW_HIDE); // TODO: Add your specialized code here and/or call the base class GetDlgItem(IDC_BUTtake)->EnableWindow(IsHasRights2new(2)); GetDlgItem(IDC_BUTtake3)->EnableWindow(IsHasRights2new(2)); GetDlgItem(IDC_BUTchoose)->EnableWindow(IsHasRights2new(2)); 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_BUTtake3, IDC_BUTtake, IDC_BUTchoose, IDC_BUTmsg, IDC_BUTclose }; int idcount = 5; 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_spinyear.SetRange(1900, 3000); m_spinmonth.SetRange(1, 12); m_spinday.SetRange(1, 31); m_static1.SetFont(&g_titlefont); #ifdef CHILD_VERSION GetDlgItem(IDC_RADIO7)->ShowWindow(SW_HIDE); m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;景点,100;拍照日期,100;时间,100;摄影师,100;化妆师,100;状态,100;接单人,100;套系名称,100;套系价格,100"); m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;接单人,100;套系名称,100;套系价格,100"); m_List3.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;看设计日期,100;时间,100;状态,100;设计,100;接单人,100;套系名称,100;套系价格,100"); m_List4.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;取件日期,100;时间,100;状态,100;是否OK,100;接单人,100;套系名称,100;套系价格,100"); #else m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;景点,100;拍照日期,100;时间,100;婚期,100;摄影师,100;化妆师,100;状态,100;接单人,100;套系名称,100;套系价格,100" ); m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;接单人,100;套系名称,100;套系价格,100" ); m_List3.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;看设计日期,100;时间,100;婚期,100;状态,100;设计,100;接单人,100;套系名称,100;套系价格,100" ); m_List4.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;取件日期,100;时间,100;婚期,100;状态,100;是否OK,100;接单人,100;套系名称,100;套系价格,100" ); m_List5.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚庆内容,100;婚庆日期,100;时间,100;婚期,100;摄影师,100;化妆师,100;接单人,100;套系名称,100;套系价格,100" ); m_List5.LoadColumnInfo (172); #endif #ifdef CHILD_VERSION m_List6.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100"); #else m_List6.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100" ); #endif m_List6.LoadColumnInfo(169); m_List1.LoadColumnInfo(110); m_List2.LoadColumnInfo(161); m_List3.LoadColumnInfo(162); m_List4.LoadColumnInfo(163); m_List1.ShowWindow(0); m_List1.GetWindowRect(rc2); ScreenToClient(rc2); m_childdlg.Create(IDD_DLGTodayFormChild, this); rc2.right -= 20; CRect rc = rc2; rc2.top += 30; rc2.bottom += 256 * 19 - 30; m_childdlg.List1array = &m_List1array; m_childdlg.pClientarray = &m_Clientarray; m_childdlg.pTxtypearray = &m_Txtypearray; m_childdlg.MoveWindow(rc2); m_childdlg.ShowWindow(SW_SHOW); m_bInit = 1; DateChange(); rc2.top -= 30; rc2.right += 20; rc2.left = rc2.right - 20; rc2.bottom -= 256 * 19 - 30; m_scrollbar.MoveWindow(rc2); rc.bottom = rc.top + 30; m_table.Create(rc, this, WS_HSCROLL); m_table.m_bFocusFrame = 0; m_table.Test2(); m_page = rc2.Height() - 40; m_scrollbar.SetScrollRange(0, 256 * 20); m_scrollbar.SetScrollPos(0); if (m_radio == 0 || m_radio == 1 || m_radio == 2 || m_radio == 3 || m_radio == 4) { m_childdlg.m_table.ModeChange(m_radio); m_table.ModeChange(m_radio); m_table.Test2(); m_table.ShowWindow(SW_SHOW); m_childdlg.ShowWindow(SW_SHOW); m_combo1.m_mode = 1; m_combo1.m_pMsgParent = &(m_childdlg.m_table); m_childdlg.m_table.m_pComboBox = &m_combo1; m_scrollbar.ShowWindow(SW_SHOW); GetDlgItem(IDC_BUTtake3)->ShowWindow(SW_HIDE); GetDlgItem(IDC_BUTtake)->ShowWindow(SW_HIDE); GetDlgItem(IDC_BUTchoose)->SetWindowText("另约日期"); GetDlgItem(IDC_BUTmsg)->SetWindowText("删除"); GetDlgItem(IDC_BUTchoose)->Invalidate(); GetDlgItem(IDC_BUTmsg)->Invalidate(); } else { m_table.ShowWindow(SW_HIDE); m_childdlg.ShowWindow(SW_HIDE); m_scrollbar.ShowWindow(SW_HIDE); // GetDlgItem(IDC_BUTtake3)->ShowWindow(SW_SHOW); // GetDlgItem(IDC_BUTtake)->ShowWindow(SW_SHOW); // GetDlgItem(IDC_BUTchoose)->SetWindowText("重新安排"); // GetDlgItem(IDC_BUTmsg)->SetWindowText("发送短信"); GetDlgItem(IDC_BUTchoose)->Invalidate(); GetDlgItem(IDC_BUTmsg)->Invalidate(); } } void TodayForm2::FillGrid() { UpdateData(); int ii = 0; if (m_radio == 0) { // m_List1.ShowWindow (SW_SHOW); m_List2.ShowWindow(SW_HIDE); m_List3.ShowWindow(SW_HIDE); m_List4.ShowWindow(SW_HIDE); m_List5.ShowWindow(SW_HIDE); m_List6.ShowWindow(SW_HIDE); return; m_List1.DeleteAllItems2(); m_datearray1.RemoveAll(); m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1); int count = 0; for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++) { m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii)); if (::FindArray(&m_datearray1, m_List1array.ElementAt(ii).ElementAt(6)) == -1) m_datearray1.Add(m_List1array.ElementAt(ii).ElementAt(6)); } m_List1.m_arLabels.SetSize(count, 1); ii = count; m_List1.m_LabelCount = ii; m_List1.SetItemCountEx(ii); } else if (m_radio == 1) { // m_List2.ShowWindow (SW_SHOW); m_List1.ShowWindow(SW_HIDE); m_List3.ShowWindow(SW_HIDE); m_List4.ShowWindow(SW_HIDE); m_List5.ShowWindow(SW_HIDE); m_List6.ShowWindow(SW_HIDE); return; m_List2.DeleteAllItems2(); m_datearray2.RemoveAll(); m_List2.m_arLabels.SetSize(m_List2array.GetSize(), 1); int count = 0; for (ii = 0; ii < m_List2.m_arLabels.GetSize(); ii++) { m_List2.m_arLabels.ElementAt(count++).Copy(m_List2array.ElementAt(ii)); if (::FindArray(&m_datearray2, m_List2array.ElementAt(ii).ElementAt(5)) == -1) m_datearray2.Add(m_List2array.ElementAt(ii).ElementAt(5)); } m_List2.m_arLabels.SetSize(count, 1); ii = count; m_List2.m_LabelCount = ii; m_List2.SetItemCountEx(ii); } else if (m_radio == 2) { // m_List3.ShowWindow (SW_SHOW); m_List2.ShowWindow(SW_HIDE); m_List1.ShowWindow(SW_HIDE); m_List4.ShowWindow(SW_HIDE); m_List5.ShowWindow(SW_HIDE); m_List6.ShowWindow(SW_HIDE); return; m_List3.DeleteAllItems2(); m_datearray3.RemoveAll(); m_List3.m_arLabels.SetSize(m_List3array.GetSize(), 1); int count = 0; for (ii = 0; ii < m_List3.m_arLabels.GetSize(); ii++) { m_List3.m_arLabels.ElementAt(count++).Copy(m_List3array.ElementAt(ii)); if (::FindArray(&m_datearray3, m_List3array.ElementAt(ii).ElementAt(5)) == -1) m_datearray3.Add(m_List3array.ElementAt(ii).ElementAt(5)); } m_List3.m_arLabels.SetSize(count, 1); ii = count; m_List3.m_LabelCount = ii; m_List3.SetItemCountEx(ii); } else if (m_radio == 3) { // m_List4.ShowWindow (SW_SHOW); m_List2.ShowWindow(SW_HIDE); m_List3.ShowWindow(SW_HIDE); m_List1.ShowWindow(SW_HIDE); m_List5.ShowWindow(SW_HIDE); m_List6.ShowWindow(SW_HIDE); return; m_List4.DeleteAllItems2(); m_datearray4.RemoveAll(); m_List4.m_arLabels.SetSize(m_List4array.GetSize(), 1); int count = 0; for (ii = 0; ii < m_List4.m_arLabels.GetSize(); ii++) { m_List4.m_arLabels.ElementAt(count++).Copy(m_List4array.ElementAt(ii)); if (::FindArray(&m_datearray4, m_List4array.ElementAt(ii).ElementAt(5)) == -1) m_datearray4.Add(m_List4array.ElementAt(ii).ElementAt(5)); } m_List4.m_arLabels.SetSize(count, 1); ii = count; m_List4.m_LabelCount = ii; m_List4.SetItemCountEx(ii); } else if (m_radio == 4) { // m_List5.ShowWindow (SW_SHOW); m_List2.ShowWindow(SW_HIDE); m_List3.ShowWindow(SW_HIDE); m_List4.ShowWindow(SW_HIDE); m_List1.ShowWindow(SW_HIDE); m_List6.ShowWindow(SW_HIDE); return; m_List5.DeleteAllItems2(); m_datearray5.RemoveAll(); m_List5.m_arLabels.SetSize(m_List5array.GetSize(), 1); int count = 0; for (ii = 0; ii < m_List5.m_arLabels.GetSize(); ii++) { m_List5.m_arLabels.ElementAt(count++).Copy(m_List5array.ElementAt(ii)); if (::FindArray(&m_datearray5, m_List5array.ElementAt(ii).ElementAt(6)) == -1) m_datearray5.Add(m_List5array.ElementAt(ii).ElementAt(6)); } m_List5.m_arLabels.SetSize(count, 1); ii = count; m_List5.m_LabelCount = ii; m_List5.SetItemCountEx(ii); } else if (m_radio == 5) { m_List6.ShowWindow(SW_SHOW); m_List2.ShowWindow(SW_HIDE); m_List3.ShowWindow(SW_HIDE); m_List4.ShowWindow(SW_HIDE); m_List1.ShowWindow(SW_HIDE); m_List5.ShowWindow(SW_HIDE); m_List6.DeleteAllItems2(); m_datearray6.RemoveAll(); m_List6.m_arLabels.SetSize(m_List6array.GetSize(), 1); int count = 0; for (ii = 0; ii < m_List6.m_arLabels.GetSize(); ii++) { m_List6.m_arLabels.ElementAt(count++).Copy(m_List6array.ElementAt(ii)); if (::FindArray(&m_datearray6, m_List6array.ElementAt(ii).ElementAt(9)) == -1) m_datearray6.Add(m_List6array.ElementAt(ii).ElementAt(9)); } m_List6.m_arLabels.SetSize(count, 1); ii = count; m_List6.m_LabelCount = ii; m_List6.SetItemCountEx(ii); } // CString str; // str.Format ("单数:%d", ii); // SetDlgItemText(IDC_STATIC2, str); } void TodayForm2::OnBUTclose() { // TODO: Add your control notification handler code here GetParent()->SendMessage(WM_CLOSE); } void TodayForm2::OnBUTchoose3() //看设计 { // TODO: Add your control notification handler code here m_mode = 3; FillGrid(); } void TodayForm2::OnBUTtakeaway() { // TODO: Add your control notification handler code here m_mode = 4; FillGrid(); /* CRect rc; m_static1.GetWindowRect (rc); ScreenToClient(rc); InvalidateRect(rc); m_static1.SetWindowText ("今天取件客户");*/ } void TodayForm2::OnBUTall() { // TODO: Add your control notification handler code here m_mode = 0; FillGrid(); /* CRect rc; m_static1.GetWindowRect (rc); ScreenToClient(rc); InvalidateRect(rc); m_static1.SetWindowText ("今拍,今选,今取"); */ } extern int __cdecl CompareByLabel3(const void *elem1, const void *elem2); void TodayForm2::DateChange() { if (m_bInit == 0)return; m_spinyear.EnableWindow(0); m_spinmonth.EnableWindow(0); m_spinday.EnableWindow(0); UpdateData(); if (m_radio == 0 || m_radio == 1 || m_radio == 2 || m_radio == 3 || m_radio == 4) { m_childdlg.m_table.ModeChange(m_radio); m_table.ModeChange(m_radio); m_table.Test2(); m_table.ShowWindow(SW_SHOW); m_childdlg.ShowWindow(SW_SHOW); m_scrollbar.ShowWindow(SW_SHOW); GetDlgItem(IDC_BUTtake3)->ShowWindow(SW_HIDE); GetDlgItem(IDC_BUTtake)->ShowWindow(SW_HIDE); GetDlgItem(IDC_BUTchoose)->SetWindowText("另约日期"); GetDlgItem(IDC_BUTmsg)->SetWindowText("删除"); GetDlgItem(IDC_BUTchoose)->Invalidate(); GetDlgItem(IDC_BUTmsg)->Invalidate(); } else { m_table.ShowWindow(SW_HIDE); m_childdlg.ShowWindow(SW_HIDE); m_scrollbar.ShowWindow(SW_HIDE); // GetDlgItem(IDC_BUTtake3)->ShowWindow(SW_SHOW); // GetDlgItem(IDC_BUTtake)->ShowWindow(SW_SHOW); // GetDlgItem(IDC_BUTchoose)->SetWindowText("重新安排"); // GetDlgItem(IDC_BUTmsg)->SetWindowText("发送短信"); GetDlgItem(IDC_BUTchoose)->Invalidate(); GetDlgItem(IDC_BUTmsg)->Invalidate(); } if (m_radio == 5) { GetDlgItem(IDC_CHECK1)->SetWindowText("近半个月"); GetDlgItem(IDC_CHECK2)->SetWindowText("近一个月"); } else { GetDlgItem(IDC_CHECK1)->SetWindowText("近一个星期"); GetDlgItem(IDC_CHECK2)->SetWindowText("近半个月"); } // if(m_radio==0) // GetDlgItem(IDC_BUTtake3)->ShowWindow(1); // else GetDlgItem(IDC_BUTtake3)->ShowWindow(0); g_todayradio = m_radio; g_todaycheck = 0; CTime tm = CTime(m_year, m_month, m_day, 0, 0, 0); g_todaytm = tm; CString strdate, strdate2; strdate.Format("%04d-%02d-%02d", m_year, m_month, m_day); if (m_check) { CTime tm = CTime(m_year, m_month, m_day, 0, 0, 0); if (m_radio == 5) tm += CTimeSpan(15, 0, 0, 0); else tm += CTimeSpan(7, 0, 0, 0); strdate2 = tm.Format("%Y-%m-%d"); g_todaycheck = 1; } else if (m_check2) { CTime tm = CTime(m_year, m_month, m_day, 0, 0, 0); if (m_radio == 5) tm += CTimeSpan(31, 0, 0, 0); else tm += CTimeSpan(15, 0, 0, 0); strdate2 = tm.Format("%Y-%m-%d"); g_todaycheck = 2; } else strdate2 = strdate; COleDateTime dtDay(m_year, m_month, m_day, 0, 0, 0); int nDayWeek = dtDay.GetDayOfWeek() - 1; //得到星期几,1=Sunday, 2=Monday, CString DayOfWeek[7] = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; CString sdate; if (nDayWeek >= 0 && nDayWeek <= 6) sdate = DayOfWeek[nDayWeek]; else sdate = "无效日期"; //LOG4C((LOG_NOTICE,"TodayForm2:%s,%s",strdate,sdate)); m_static1.SetWindowText(strdate + "(" + sdate + ")小秘书"); if (m_radio == 0) { m_List1array.RemoveAll(); g_sendhead.code[0] = 178; g_sendhead.code[1] = 179; g_sendhead.code[2] = 157; g_sendhead.tabcount = 3; g_sendhead.bsql = 0; CString sql; sql.Format("date>='" + strdate + "' and date<='" + strdate2 + "' and mode='0';;"); g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0) { m_childdlg.ShowTable(); return; } DataToArray(&m_List1array, &m_Clientarray, &m_Txtypearray); m_childdlg.ShowTable(); int temp = m_nscrollpos; int nscrollpos = m_scrollbar.GetScrollPos(); m_nscrollpos = 0; m_scrollbar.SetScrollPos(m_nscrollpos); m_childdlg.ScrollWindow(0, temp - m_nscrollpos); } else if (m_radio == 1) { m_List1array.RemoveAll(); g_sendhead.code[0] = 178; g_sendhead.code[1] = 179; g_sendhead.code[2] = 157; g_sendhead.tabcount = 3; g_sendhead.bsql = 0; CString sql; sql.Format("date>='" + strdate + "' and date<='" + strdate2 + "' and mode='1';;"); g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0) { m_childdlg.ShowTable(); return; } DataToArray(&m_List1array, &m_Clientarray, &m_Txtypearray); m_childdlg.ShowTable(); int temp = m_nscrollpos; int nscrollpos = m_scrollbar.GetScrollPos(); m_nscrollpos = 0; m_scrollbar.SetScrollPos(m_nscrollpos); m_childdlg.ScrollWindow(0, temp - m_nscrollpos); } else if (m_radio == 2) { m_List1array.RemoveAll(); g_sendhead.code[0] = 178; g_sendhead.code[1] = 179; g_sendhead.code[2] = 157; g_sendhead.tabcount = 3; g_sendhead.bsql = 0; CString sql; sql.Format("date>='" + strdate + "' and date<='" + strdate2 + "' and mode='2';;"); g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0) { m_childdlg.ShowTable(); return; } DataToArray(&m_List1array, &m_Clientarray, &m_Txtypearray); m_childdlg.ShowTable(); int temp = m_nscrollpos; int nscrollpos = m_scrollbar.GetScrollPos(); m_nscrollpos = 0; m_scrollbar.SetScrollPos(m_nscrollpos); m_childdlg.ScrollWindow(0, temp - m_nscrollpos); } else if (m_radio == 3) { m_List1array.RemoveAll(); g_sendhead.code[0] = 178; g_sendhead.code[1] = 179; g_sendhead.code[2] = 157; g_sendhead.tabcount = 3; g_sendhead.bsql = 0; CString sql; sql.Format("date>='" + strdate + "' and date<='" + strdate2 + "' and mode='3';;"); g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0) { m_childdlg.ShowTable(); return; } DataToArray(&m_List1array, &m_Clientarray, &m_Txtypearray); m_childdlg.ShowTable(); int temp = m_nscrollpos; int nscrollpos = m_scrollbar.GetScrollPos(); m_nscrollpos = 0; m_scrollbar.SetScrollPos(m_nscrollpos); m_childdlg.ScrollWindow(0, temp - m_nscrollpos); } else if (m_radio == 4) { m_List1array.RemoveAll(); g_sendhead.code[0] = 180; g_sendhead.code[1] = 179; g_sendhead.code[2] = 157; g_sendhead.tabcount = 3; g_sendhead.bsql = 0; CString sql; sql.Format("date>='" + strdate + "' and date<='" + strdate2 + "' and mode='4';;"); g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0) { m_childdlg.ShowTable(); return; } DataToArray(&m_List1array, &m_Clientarray, &m_Txtypearray); m_childdlg.ShowTable(); int temp = m_nscrollpos; int nscrollpos = m_scrollbar.GetScrollPos(); m_nscrollpos = 0; m_scrollbar.SetScrollPos(m_nscrollpos); m_childdlg.ScrollWindow(0, temp - m_nscrollpos); } else if (m_radio == 5) { int i = 0; g_sendhead.bsql = 0; g_sendhead.code[0] = 135; g_sendhead.code[1] = 136; g_sendhead.tabcount = 2; CString sql; sql.Format("time5>='" + strdate + "' and time5<='" + strdate2 + "' and [status3]='未取'"); g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return; DataToArray(&m_List6array, &g_List1array); for ( i = 0; i < g_List1array.GetSize(); i++) { for (int j = 0; j < m_List6array.GetSize(); j++) { if (g_List1array.ElementAt(i).ElementAt(0) == m_List6array.ElementAt(j).ElementAt(0)) { if (g_List1array.ElementAt(i).ElementAt(1) != "" && g_List1array.ElementAt(i).ElementAt(3) != "" && g_List1array.ElementAt(i).ElementAt(5) != "") { m_List6array.ElementAt(j).SetAt(4, "已安排"); } else { m_List6array.ElementAt(j).SetAt(4, m_List6array.ElementAt(j).ElementAt(4) + g_List1array.ElementAt(i).ElementAt(1)); m_List6array.ElementAt(j).SetAt(6, m_List6array.ElementAt(j).ElementAt(6) + g_List1array.ElementAt(i).ElementAt(3)); m_List6array.ElementAt(j).SetAt(7, m_List6array.ElementAt(j).ElementAt(7) + g_List1array.ElementAt(i).ElementAt(5)); } } } } for (i = m_List6array.GetSize() - 1; i >= 0; i--) { if (m_List6array.ElementAt(i).ElementAt(4) == "已安排") m_List6array.RemoveAt(i); } qsort(static_cast(&m_List6array[0]), m_List6array.GetSize(), sizeof(m_List6array[0]), CompareByLabel3); } FillGrid(); m_spinyear.EnableWindow(1); m_spinmonth.EnableWindow(1); m_spinday.EnableWindow(1); } void TodayForm2::OnCheck1() { // TODO: Add your control notification handler code here UpdateData(); m_check2 = 0; UpdateData(false); DateChange(); } void TodayForm2::OnCheck2() { // TODO: Add your control notification handler code here UpdateData(); m_check = 0; UpdateData(false); DateChange(); } void TodayForm2::OnChangeEDITyear() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the MyFormView::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. DateChange(); // TODO: Add your control notification handler code here } void TodayForm2::OnChangeEDITmonth() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the MyFormView::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. DateChange(); // TODO: Add your control notification handler code here } void TodayForm2::OnChangeEDITday() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the MyFormView::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. DateChange(); // TODO: Add your control notification handler code her } void TodayForm2::OnRadio3() { // TODO: Add your control notification handler code here DateChange(); } void TodayForm2::OnRadio4() { // TODO: Add your control notification handler code here DateChange(); } void TodayForm2::OnRadio5() { // TODO: Add your control notification handler code here DateChange(); } void TodayForm2::OnRadio6() { // TODO: Add your control notification handler code here DateChange(); } void TodayForm2::OnRadio7() { // TODO: Add your control notification handler code here DateChange(); } void TodayForm2::OnRadio8() { // TODO: Add your control notification handler code here DateChange(); } void TodayForm2::OnBUTtake() { // TODO: Add your control notification handler code here if (IsHasRights2new(2) == 0)return; UpdateData(); if (m_radio == 0) { TakeControlDlg1 dlg; dlg.DoModal(); DateChange(); } else if (m_radio == 1) { TakeControlDlg2 dlg; if (dlg.DoModal() == IDOK)DateChange(); } else if (m_radio == 2) { TakeControlDlg3 dlg; if (dlg.DoModal() == IDOK)DateChange(); } else if (m_radio == 3) { TakeControlDlg4 dlg; if (dlg.DoModal() == IDOK)DateChange(); } else if (m_radio == 4) { TakeControlDlg9 dlg; dlg.DoModal(); DateChange(); } } void TodayForm2::OnBUTchoose() { // TODO: Add your control notification handler code here UpdateData(); if (m_radio == 0) { if (IsHasRightsnew(2) == 0)return; m_childdlg.OtherDate(); return; } if (m_radio == 1) { if (IsHasRightsnew(2) == 0)return; m_childdlg.OtherDate(); return; } else if (m_radio == 2) { if (IsHasRightsnew(2) == 0)return; m_childdlg.OtherDate(); return; } else if (m_radio == 3) { if (IsHasRightsnew(2) == 0)return; m_childdlg.OtherDate(); return; } else if (m_radio == 4) { if (IsHasRightsnew(2) == 0)return; m_childdlg.OtherDate(); return; } } void TodayForm2::OnCustomdrawList4(NMHDR* pNMHDR, LRESULT* pResult) { NMLVCUSTOMDRAW* pLVCD = reinterpret_cast(pNMHDR); // Take the default processing unless we set this to something else below. *pResult = 0; // First thing - check the draw stage. If it's the control's prepaint // stage, then tell Windows we want messages for every item. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage) { *pResult = CDRF_NOTIFYITEMDRAW; } else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage) { // This is the prepaint stage for an item. Here's where we set the // item's text color. Our return value will tell Windows to draw the // item itself, but it will use the new color we set here. // We'll cycle the colors through red, green, and light blue. #ifdef CHILD_VERSION if (m_List4.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8) != "OK") #else if(m_List4.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (9)!="OK") #endif pLVCD->clrText = RGB(220, 0, 0); else pLVCD->clrText = RGB(20, 133, 20); if (pLVCD->nmcd.dwItemSpec % 2) pLVCD->clrTextBk = g_gridcol1; else pLVCD->clrTextBk = g_gridcol2; // Store the color back in the NMLVCUSTOMDRAW struct. // Tell Windows to paint the control itself. *pResult = CDRF_DODEFAULT; } } void TodayForm2::OnCustomdrawList3(NMHDR* pNMHDR, LRESULT* pResult) { NMLVCUSTOMDRAW* pLVCD = reinterpret_cast(pNMHDR); // Take the default processing unless we set this to something else below. *pResult = 0; // First thing - check the draw stage. If it's the control's prepaint // stage, then tell Windows we want messages for every item. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage) { *pResult = CDRF_NOTIFYITEMDRAW; } else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage) { // This is the prepaint stage for an item. Here's where we set the // item's text color. Our return value will tell Windows to draw the // item itself, but it will use the new color we set here. // We'll cycle the colors through red, green, and light blue. #ifdef CHILD_VERSION if (m_List3.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8) != "OK" && m_List3.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(7) != "OK") #else if(m_List3.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (9)!="OK" && m_List3.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (8)!="OK") #endif { pLVCD->clrText = RGB(220, 0, 0); } else { pLVCD->clrText = RGB(20, 133, 20); } if (pLVCD->nmcd.dwItemSpec % 2) pLVCD->clrTextBk = g_gridcol1; else pLVCD->clrTextBk = g_gridcol2; // Store the color back in the NMLVCUSTOMDRAW struct. // Tell Windows to paint the control itself. *pResult = CDRF_DODEFAULT; } } void TodayForm2::OnBUTmsg() { // TODO: Add your control notification handler code here UpdateData(); POSITION pos; CStringArray array; if (m_radio == 0) { if (IsHasRightsnew(2) == 0)return; m_childdlg.DeleteCur(); return; } else if (m_radio == 1) { if (IsHasRightsnew(2) == 0)return; m_childdlg.DeleteCur(); return; } else if (m_radio == 2) { if (IsHasRightsnew(2) == 0)return; m_childdlg.DeleteCur(); return; } else if (m_radio == 3) { if (IsHasRightsnew(2) == 0)return; m_childdlg.DeleteCur(); return; } else if (m_radio == 4) { if (IsHasRightsnew(2) == 0)return; m_childdlg.DeleteCur(); return; } else if (m_radio == 5) { return; pos = m_List6.GetFirstSelectedItemPosition(); if (pos == NULL) { AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION); return; } int iItem; while (pos) { iItem = m_List6.GetNextSelectedItem(pos); array.Add(m_List6.GetItemText(iItem, 16)); array.Add(m_List6.GetItemText(iItem, 17)); } } SendMsgDlg dlg; dlg.m_pArray = &array; dlg.DoModal(); } void TodayForm2::OnBUTtake3() { // TODO: Add your control notification handler code here if (IsHasRights2new(2) == 0)return; SearchTake dlg; dlg.DoModal(); DateChange(); } void TodayForm2::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here POSITION pos; pos = m_List1.GetFirstSelectedItemPosition(); if (pos == NULL)return; int iItem = m_List1.GetNextSelectedItem(pos); g_id = m_List1.GetItemText(iItem, 0); *pResult = 0; } void TodayForm2::OnClickList3(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here POSITION pos; pos = m_List2.GetFirstSelectedItemPosition(); if (pos == NULL)return; int iItem = m_List2.GetNextSelectedItem(pos); g_id = m_List2.GetItemText(iItem, 0); *pResult = 0; } void TodayForm2::OnClickList4(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here POSITION pos; pos = m_List3.GetFirstSelectedItemPosition(); if (pos == NULL)return; int iItem = m_List3.GetNextSelectedItem(pos); g_id = m_List3.GetItemText(iItem, 0); *pResult = 0; } void TodayForm2::OnClickList7(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here POSITION pos; pos = m_List4.GetFirstSelectedItemPosition(); if (pos == NULL)return; int iItem = m_List4.GetNextSelectedItem(pos); g_id = m_List4.GetItemText(iItem, 0); *pResult = 0; } void TodayForm2::OnClickList8(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here POSITION pos; pos = m_List5.GetFirstSelectedItemPosition(); if (pos == NULL)return; int iItem = m_List5.GetNextSelectedItem(pos); g_id = m_List5.GetItemText(iItem, 0); *pResult = 0; } void TodayForm2::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here if (IsHasRights2new(1) == 0)return; g_pMainWnd->OnOutbarNotify("拍照"); *pResult = 0; } void TodayForm2::OnDblclkList3(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here if (IsHasRights2new(15) == 0)return; // TODO: Add your control notification handler code here POSITION pos; pos = m_List2.GetFirstSelectedItemPosition(); if (pos == NULL) { return; } int iItem = m_List2.GetNextSelectedItem(pos); CString id = m_List2.GetItemText(iItem, 0); ChooseDesignSkin dlg; dlg.SetLiaPath("3.lia"); dlg.m_strOrderNumber = id; dlg.m_path = g_path2 + "\\"; dlg.m_path += dlg.m_strOrderNumber; dlg.m_path += "\\"; dlg.DoModal(); *pResult = 0; } void TodayForm2::OnDblclkList4(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here if (IsHasRights2new(15) == 0)return; // TODO: Add your control notification handler code here POSITION pos; pos = m_List3.GetFirstSelectedItemPosition(); if (pos == NULL) { return; } int iItem = m_List3.GetNextSelectedItem(pos); CString id = m_List3.GetItemText(iItem, 0); ChooseDesignSkin dlg; dlg.SetLiaPath("3.lia"); dlg.m_strOrderNumber = id; dlg.m_path = g_path3 + "\\"; dlg.m_path += id; dlg.m_path += "\\"; dlg.DoModal(); *pResult = 0; } void TodayForm2::OnDblclkList7(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here if (IsHasRights2new(3) == 0)return; g_pMainWnd->OnOutbarNotify("发片/取件"); *pResult = 0; } void TodayForm2::OnCustomdrawList1(NMHDR* pNMHDR, LRESULT* pResult) { NMLVCUSTOMDRAW* pLVCD = reinterpret_cast(pNMHDR); // Take the default processing unless we set this to something else below. *pResult = 0; // First thing - check the draw stage. If it's the control's prepaint // stage, then tell Windows we want messages for every item. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage) { *pResult = CDRF_NOTIFYITEMDRAW; } else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage) { // This is the prepaint stage for an item. Here's where we set the // item's text color. Our return value will tell Windows to draw the // item itself, but it will use the new color we set here. // We'll cycle the colors through red, green, and light blue. if (::FindArray(&m_datearray1, m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(6)) % 2) pLVCD->clrText = RGB(0, 0, 220); else pLVCD->clrText = RGB(0, 0, 50); if (pLVCD->nmcd.dwItemSpec % 2) pLVCD->clrTextBk = g_gridcol1; else pLVCD->clrTextBk = g_gridcol2; // Store the color back in the NMLVCUSTOMDRAW struct. // Tell Windows to paint the control itself. *pResult = CDRF_DODEFAULT; } } void TodayForm2::OnCustomdrawList2(NMHDR* pNMHDR, LRESULT* pResult) { NMLVCUSTOMDRAW* pLVCD = reinterpret_cast(pNMHDR); // Take the default processing unless we set this to something else below. *pResult = 0; // First thing - check the draw stage. If it's the control's prepaint // stage, then tell Windows we want messages for every item. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage) { *pResult = CDRF_NOTIFYITEMDRAW; } else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage) { // This is the prepaint stage for an item. Here's where we set the // item's text color. Our return value will tell Windows to draw the // item itself, but it will use the new color we set here. // We'll cycle the colors through red, green, and light blue. if (::FindArray(&m_datearray2, m_List2.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(5)) % 2) pLVCD->clrText = RGB(0, 0, 220); else pLVCD->clrText = RGB(0, 0, 50); if (pLVCD->nmcd.dwItemSpec % 2) pLVCD->clrTextBk = g_gridcol1; else pLVCD->clrTextBk = g_gridcol2; // Store the color back in the NMLVCUSTOMDRAW struct. // Tell Windows to paint the control itself. *pResult = CDRF_DODEFAULT; } } void TodayForm2::OnCustomdrawList5(NMHDR* pNMHDR, LRESULT* pResult) { NMLVCUSTOMDRAW* pLVCD = reinterpret_cast(pNMHDR); // Take the default processing unless we set this to something else below. *pResult = 0; // First thing - check the draw stage. If it's the control's prepaint // stage, then tell Windows we want messages for every item. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage) { *pResult = CDRF_NOTIFYITEMDRAW; } else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage) { // This is the prepaint stage for an item. Here's where we set the // item's text color. Our return value will tell Windows to draw the // item itself, but it will use the new color we set here. // We'll cycle the colors through red, green, and light blue. if (::FindArray(&m_datearray5, m_List5.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(6)) % 2) pLVCD->clrText = RGB(0, 0, 220); else pLVCD->clrText = RGB(0, 0, 50); if (pLVCD->nmcd.dwItemSpec % 2) pLVCD->clrTextBk = g_gridcol1; else pLVCD->clrTextBk = g_gridcol2; // Store the color back in the NMLVCUSTOMDRAW struct. // Tell Windows to paint the control itself. *pResult = CDRF_DODEFAULT; } } void TodayForm2::OnCustomdrawList6(NMHDR* pNMHDR, LRESULT* pResult) { NMLVCUSTOMDRAW* pLVCD = reinterpret_cast(pNMHDR); // Take the default processing unless we set this to something else below. *pResult = 0; // First thing - check the draw stage. If it's the control's prepaint // stage, then tell Windows we want messages for every item. if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage) { *pResult = CDRF_NOTIFYITEMDRAW; } else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage) { // This is the prepaint stage for an item. Here's where we set the // item's text color. Our return value will tell Windows to draw the // item itself, but it will use the new color we set here. // We'll cycle the colors through red, green, and light blue. if (::FindArray(&m_datearray6, m_List6.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9)) % 2) pLVCD->clrText = RGB(0, 0, 220); else pLVCD->clrText = RGB(0, 0, 50); if (pLVCD->nmcd.dwItemSpec % 2) pLVCD->clrTextBk = g_gridcol1; else pLVCD->clrTextBk = g_gridcol2; // Store the color back in the NMLVCUSTOMDRAW struct. // Tell Windows to paint the control itself. *pResult = CDRF_DODEFAULT; } } BOOL TodayForm2::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if (pMsg->message == WM_KEYDOWN) { switch (pMsg->wParam) { case VK_F9: GetClientPhone(); 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); } void TodayForm2::GetClientPhone() { UpdateData(); if (m_radio == 1) { GetClientPhone2(); return; } else if (m_radio == 2) { GetClientPhone3(); return; } else if (m_radio == 3) { GetClientPhone4(); return; } else if (m_radio == 4) { GetClientPhone5(); return; } CString path; if (m_radio == 0) path = "c:\\拍照客人.txt"; else if (m_radio == 1) path = "c:\\选片客人.txt"; else if (m_radio == 2) path = "c:\\看设计客人.txt"; else if (m_radio == 3) path = "c:\\取件客人.txt"; else if (m_radio == 4) path = "c:\\婚庆客人.txt"; CStdioFile fp; fp.Open(path, CFile::modeCreate | CFile::modeWrite); CString str; CString name, m_name1, m_name2; CString phone, m_phone1, m_phone2; CString str1, str2, str3, str4, str5, str6, str7, str8, str9; int leng1 = 20; int leng2 = 30; int leng3 = 15; int leng4 = 15; int leng5 = 15; int leng6 = 15; int leng7 = 15; int leng8 = 15; int leng9 = 15; str1 = "姓名"; str2 = "电话"; str3 = "景点"; str4 = "日期"; str5 = "时间"; str6 = "摄影"; str7 = "化妆"; str8 = "套系"; str9 = "价格"; FillLength(str1, leng1); FillLength(str2, leng2); FillLength(str3, leng3); FillLength(str4, leng4); FillLength(str5, leng5); FillLength(str6, leng6); FillLength(str7, leng7); FillLength(str8, leng8); FillLength(str9, leng9); str = str1 + str2 + str3 + str4 + str5 + str6 + str7 + str8 + str9 + "\n"; fp.WriteString(str); for (int i = 0; i < m_List1.GetItemCount(); i++) { name.Empty(); phone.Empty(); m_name1 = m_List1.GetItemText(i, 1); m_name2 = m_List1.GetItemText(i, 2); m_phone1 = m_List1.GetItemText(i, 3); m_phone2 = m_List1.GetItemText(i, 4); str3 = m_List1.GetItemText(i, 5); str4 = m_List1.GetItemText(i, 6); str5 = m_List1.GetItemText(i, 7); str6 = m_List1.GetItemText(i, 8); str7 = m_List1.GetItemText(i, 9); str8 = m_List1.GetItemText(i, 12); str9 = m_List1.GetItemText(i, 13); if (!m_name1.IsEmpty()) name = m_name1 + ","; name += m_name2; name.TrimRight(","); if (!m_phone1.IsEmpty()) phone = m_phone1 + ","; phone += m_phone2; phone.TrimRight(","); str1 = name; str2 = phone; FillLength(str1, leng1); FillLength(str2, leng2); FillLength(str3, leng3); FillLength(str4, leng4); FillLength(str5, leng5); FillLength(str6, leng6); FillLength(str7, leng7); FillLength(str8, leng8); FillLength(str9, leng9); str = str1 + str2 + str3 + str4 + str5 + str6 + str7 + str8 + str9 + "\n"; fp.WriteString(str); } fp.Close(); MessageBox("资料已保存到" + path); ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED); } void TodayForm2::GetClientPhone2() { CString path; path = "c:\\选片客人.txt"; CStdioFile fp; fp.Open(path, CFile::modeCreate | CFile::modeWrite); CString str; CString name, m_name1, m_name2; CString phone, m_phone1, m_phone2; CString str1, str2, str3, str4, str5, str6, str7, str8, str9; int leng1 = 25; int leng2 = 30; int leng3 = 20; int leng4 = 20; int leng5 = 20; int leng6 = 20; str1 = "姓名"; str2 = "电话"; str3 = "日期"; str4 = "时间"; str5 = "套系"; str6 = "价格"; FillLength(str1, leng1); FillLength(str2, leng2); FillLength(str3, leng3); FillLength(str4, leng4); FillLength(str5, leng5); FillLength(str6, leng6); str = str1 + str2 + str3 + str4 + str5 + str6 + "\n"; fp.WriteString(str); for (int i = 0; i < m_List2.GetItemCount(); i++) { name.Empty(); phone.Empty(); m_name1 = m_List2.GetItemText(i, 1); m_name2 = m_List2.GetItemText(i, 2); m_phone1 = m_List2.GetItemText(i, 3); m_phone2 = m_List2.GetItemText(i, 4); str3 = m_List2.GetItemText(i, 5); str4 = m_List2.GetItemText(i, 6); str5 = m_List2.GetItemText(i, 9); str6 = m_List2.GetItemText(i, 10); if (!m_name1.IsEmpty()) name = m_name1 + ","; name += m_name2; name.TrimRight(","); if (!m_phone1.IsEmpty()) phone = m_phone1 + ","; phone += m_phone2; phone.TrimRight(","); str1 = name; str2 = phone; FillLength(str1, leng1); FillLength(str2, leng2); FillLength(str3, leng3); FillLength(str4, leng4); FillLength(str5, leng5); FillLength(str6, leng6); str = str1 + str2 + str3 + str4 + str5 + str6 + "\n"; fp.WriteString(str); } fp.Close(); MessageBox("资料已保存到" + path); ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED); } void TodayForm2::GetClientPhone3() { CString path; path = "c:\\看设计客人.txt"; CStdioFile fp; fp.Open(path, CFile::modeCreate | CFile::modeWrite); CString str; CString name, m_name1, m_name2; CString phone, m_phone1, m_phone2; CString str1, str2, str3, str4, str5, str6, str7, str8, str9; int leng1 = 25; int leng2 = 30; int leng3 = 20; int leng4 = 20; int leng5 = 20; int leng6 = 20; str1 = "姓名"; str2 = "电话"; str3 = "日期"; str4 = "时间"; str5 = "套系"; str6 = "价格"; FillLength(str1, leng1); FillLength(str2, leng2); FillLength(str3, leng3); FillLength(str4, leng4); FillLength(str5, leng5); FillLength(str6, leng6); str = str1 + str2 + str3 + str4 + str5 + str6 + "\n"; fp.WriteString(str); for (int i = 0; i < m_List3.GetItemCount(); i++) { name.Empty(); phone.Empty(); m_name1 = m_List3.GetItemText(i, 1); m_name2 = m_List3.GetItemText(i, 2); m_phone1 = m_List3.GetItemText(i, 3); m_phone2 = m_List3.GetItemText(i, 4); str3 = m_List3.GetItemText(i, 5); str4 = m_List3.GetItemText(i, 6); str5 = m_List3.GetItemText(i, 10); str6 = m_List3.GetItemText(i, 11); if (!m_name1.IsEmpty()) name = m_name1 + ","; name += m_name2; name.TrimRight(","); if (!m_phone1.IsEmpty()) phone = m_phone1 + ","; phone += m_phone2; phone.TrimRight(","); str1 = name; str2 = phone; FillLength(str1, leng1); FillLength(str2, leng2); FillLength(str3, leng3); FillLength(str4, leng4); FillLength(str5, leng5); FillLength(str6, leng6); str = str1 + str2 + str3 + str4 + str5 + str6 + "\n"; fp.WriteString(str); } fp.Close(); MessageBox("资料已保存到" + path); ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED); } void TodayForm2::GetClientPhone4() { CString path; path = "c:\\取件客人.txt"; CStdioFile fp; fp.Open(path, CFile::modeCreate | CFile::modeWrite); CString str; CString name, m_name1, m_name2; CString phone, m_phone1, m_phone2; CString str1, str2, str3, str4, str5, str6, str7, str8, str9; int leng1 = 25; int leng2 = 30; int leng3 = 20; int leng4 = 20; int leng5 = 20; int leng6 = 20; str1 = "姓名"; str2 = "电话"; str3 = "日期"; str4 = "时间"; str5 = "套系"; str6 = "价格"; FillLength(str1, leng1); FillLength(str2, leng2); FillLength(str3, leng3); FillLength(str4, leng4); FillLength(str5, leng5); FillLength(str6, leng6); str = str1 + str2 + str3 + str4 + str5 + str6 + "\n"; fp.WriteString(str); for (int i = 0; i < m_List4.GetItemCount(); i++) { name.Empty(); phone.Empty(); m_name1 = m_List4.GetItemText(i, 1); m_name2 = m_List4.GetItemText(i, 2); m_phone1 = m_List4.GetItemText(i, 3); m_phone2 = m_List4.GetItemText(i, 4); str3 = m_List4.GetItemText(i, 5); str4 = m_List4.GetItemText(i, 6); str5 = m_List4.GetItemText(i, 10); str6 = m_List4.GetItemText(i, 11); if (!m_name1.IsEmpty()) name = m_name1 + ","; name += m_name2; name.TrimRight(","); if (!m_phone1.IsEmpty()) phone = m_phone1 + ","; phone += m_phone2; phone.TrimRight(","); str1 = name; str2 = phone; FillLength(str1, leng1); FillLength(str2, leng2); FillLength(str3, leng3); FillLength(str4, leng4); FillLength(str5, leng5); FillLength(str6, leng6); str = str1 + str2 + str3 + str4 + str5 + str6 + "\n"; fp.WriteString(str); } fp.Close(); MessageBox("资料已保存到" + path); ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED); } void TodayForm2::GetClientPhone5() { CString path; path = "c:\\婚庆客人.txt"; CStdioFile fp; fp.Open(path, CFile::modeCreate | CFile::modeWrite); CString str; CString name, m_name1, m_name2; CString phone, m_phone1, m_phone2; CString str1, str2, str3, str4, str5, str6, str7, str8, str9; int leng1 = 25; int leng2 = 30; int leng3 = 20; int leng4 = 20; int leng5 = 20; int leng6 = 20; int leng7 = 20; str1 = "姓名"; str2 = "电话"; str3 = "婚庆内容"; str4 = "日期"; str5 = "时间"; str6 = "套系"; str7 = "价格"; FillLength(str1, leng1); FillLength(str2, leng2); FillLength(str3, leng3); FillLength(str4, leng4); FillLength(str5, leng5); FillLength(str6, leng6); FillLength(str7, leng7); str = str1 + str2 + str3 + str4 + str5 + str6 + str7 + "\n"; fp.WriteString(str); for (int i = 0; i < m_List5.GetItemCount(); i++) { name.Empty(); phone.Empty(); m_name1 = m_List5.GetItemText(i, 1); m_name2 = m_List5.GetItemText(i, 2); m_phone1 = m_List5.GetItemText(i, 3); m_phone2 = m_List5.GetItemText(i, 4); str3 = m_List5.GetItemText(i, 5); str4 = m_List5.GetItemText(i, 6); str5 = m_List5.GetItemText(i, 7); str6 = m_List5.GetItemText(i, 12); str7 = m_List5.GetItemText(i, 13); if (!m_name1.IsEmpty()) name = m_name1 + ","; name += m_name2; name.TrimRight(","); if (!m_phone1.IsEmpty()) phone = m_phone1 + ","; phone += m_phone2; phone.TrimRight(","); str1 = name; str2 = phone; FillLength(str1, leng1); FillLength(str2, leng2); FillLength(str3, leng3); FillLength(str4, leng4); FillLength(str5, leng5); FillLength(str6, leng6); FillLength(str7, leng7); str = str1 + str2 + str3 + str4 + str5 + str6 + str7 + "\n"; fp.WriteString(str); } fp.Close(); MessageBox("资料已保存到" + path); ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED); } void TodayForm2::OnClickList10(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here POSITION pos; pos = m_List6.GetFirstSelectedItemPosition(); if (pos == NULL)return; int iItem = m_List6.GetNextSelectedItem(pos); g_id = m_List6.GetItemText(iItem, 0); *pResult = 0; } void TodayForm2::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { // TODO: Add your message handler code here and/or call default int temp = m_nscrollpos; int nscrollpos = pScrollBar->GetScrollPos(); switch (nSBCode) { case SB_LINEUP: nscrollpos -= 20; break; case SB_LINEDOWN: nscrollpos += 20; break; case SB_PAGEUP: nscrollpos -= m_page; break; case SB_PAGEDOWN: nscrollpos += m_page; break; case SB_THUMBTRACK: nscrollpos = nPos; break; } m_nscrollpos = nscrollpos; pScrollBar->SetScrollPos(m_nscrollpos); m_childdlg.ScrollWindow(0, temp - m_nscrollpos); MyFormView::OnVScroll(nSBCode, nPos, pScrollBar); } CString TodayForm2::GetDate() { UpdateData(); CString strdate; strdate.Format("%04d-%02d-%02d", m_year, m_month, m_day); return strdate; } void TodayForm2::ReLoad1() { DateChange(); } BOOL TodayForm2::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) { // TODO: Add your message handler code here and/or call default if (zDelta > 0) { int temp = m_nscrollpos; int nscrollpos = m_scrollbar.GetScrollPos(); nscrollpos -= 60; if (nscrollpos < 0)nscrollpos = 0; m_nscrollpos = nscrollpos; m_scrollbar.SetScrollPos(m_nscrollpos); m_childdlg.ScrollWindow(0, temp - m_nscrollpos); } else { int temp = m_nscrollpos; int nscrollpos = m_scrollbar.GetScrollPos(); nscrollpos += 60; m_nscrollpos = nscrollpos; m_scrollbar.SetScrollPos(m_nscrollpos); m_childdlg.ScrollWindow(0, temp - m_nscrollpos); } return MyFormView::OnMouseWheel(nFlags, zDelta, pt); }