// TodayForm.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "TodayForm.h" #include "MyMdi.H" #include "TakeControlDlg1.h" #include "TakeControlDlg2.h" #include "TakeControlDlg3.h" #include "TakeControlDlg4.h" #include "TakeControlDlg9.h" #include "SelMemberCardFund.h" #include "SendMsgDlg.h" #include "SearchTake.h" #include "SearchTake2.h" #include "SearchTake3.h" #include "SearchTake4.h" #include "SearchTake5.h" #include "CalendarConvert.h" #include "CalendarEx.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif CTime g_todaytm = CTime::GetCurrentTime(); int g_todayradio = 0; int g_todaycheck = 0; void CovertDate2(CString &date)//公历转农历 { try { GongToLong(date); return; if (date == "2013-04-09") { date = "2013-02-29"; return; } CCalendarConvert m_CalendarConvert; SYSTEMTIME src = { 0 }; SYSTEMTIME dst = { 0 }; COleDateTime m_timeLunar(atoi(date.Mid(0, 4)), atoi(date.Mid(5, 2)), atoi(date.Mid(8, 2)), 0, 0, 0); COleDateTime m_timeGregorian; m_timeLunar.GetAsSystemTime(src); BOOL bEmbolism = 0; if (m_CalendarConvert.Gregorian2Lunar(&src, &dst, &bEmbolism)) { m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime(&dst); date.Format("%04d-%02d-%02d", m_timeGregorian.GetYear(), m_timeGregorian.GetMonth(), m_timeGregorian.GetDay()); if (m_timeGregorian.GetYear() == -1)date = "2000-13-32"; } else { date = "1980-01-01"; } } catch (...) { date = "1980-01-01"; } } // 农历转公历; void CovertDate3(CString &date)//农历转公历 { LongToGong(date); return; try { CCalendarConvert m_CalendarConvert; SYSTEMTIME src = { 0 }; SYSTEMTIME dst = { 0 }; COleDateTime m_timeLunar(atoi(date.Mid(0, 4)), atoi(date.Mid(5, 2)), atoi(date.Mid(8, 2)), 0, 0, 0); COleDateTime m_timeGregorian; m_timeLunar.GetAsSystemTime(src); BOOL bEmbolism = 0; if (m_CalendarConvert.Lunar2Gregorian(&src, bEmbolism, &dst)) { m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime(&dst); date.Format("%04d-%02d-%02d", m_timeGregorian.GetYear(), m_timeGregorian.GetMonth(), m_timeGregorian.GetDay()); if (m_timeGregorian.GetYear() == -1)date = "2000-13-32"; } else date = "1980-01-01"; } catch (...) { date = "1980-01-01"; } /* bEmbolism = 1; if ( m_CalendarConvert.Lunar2Gregorian ( &src, bEmbolism, &dst ) ) { m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime ( &dst ); date.Format ("%04d-%02d-%02d", m_timeGregorian.GetYear (), m_timeGregorian.GetMonth (), m_timeGregorian.GetDay ()); }*/ } ///////////////////////////////////////////////////////////////////////////// // TodayForm IDC_RADIO8 IMPLEMENT_DYNCREATE(TodayForm, MyFormView) TodayForm::TodayForm() : MyFormView(TodayForm::IDD) { //{{AFX_DATA_INIT(TodayForm) m_check = FALSE; m_check2 = FALSE; m_radio2 = 0; 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; m_radio = 0; m_nAdd = 0; if (g_bAllBranch == 0) { m_radio = g_todayradio; if (g_todaycheck == 1) m_check = 1; else if (g_todaycheck == 2) m_check2 = 1; } else { m_radio = g_bookingtype; m_nAdd = 1; } m_bShowCalendar = 1; m_nAdd2 = 0; m_bHospital = FALSE; } TodayForm::~TodayForm() { } void TodayForm::DoDataExchange(CDataExchange* pDX) { MyFormView::DoDataExchange(pDX); //{{AFX_DATA_MAP(TodayForm) DDX_Control(pDX, IDC_COMBO6, m_combo1); DDX_Control(pDX, IDC_SCROLLBAR1, m_vScroll); 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_Radio(pDX, IDC_RADIO9, m_radio2); DDX_Scroll(pDX, IDC_SCROLLBAR1, m_nscrollpos); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(TodayForm, MyFormView) //{{AFX_MSG_MAP(TodayForm) 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_BN_CLICKED(IDC_RADIO9, OnRadio9) ON_BN_CLICKED(IDC_RADIO14, OnRadio14) ON_BN_CLICKED(IDC_RADIO15, OnRadio15) ON_BN_CLICKED(IDC_RADIO16, OnRadio16) ON_BN_CLICKED(IDC_RADIO10, OnRadio10) ON_NOTIFY(NM_DBLCLK, IDC_LIST8, OnDblclkList8) //}}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() ///////////////////////////////////////////////////////////////////////////// // TodayForm diagnostics #ifdef _DEBUG void TodayForm::AssertValid() const { MyFormView::AssertValid(); } void TodayForm::Dump(CDumpContext& dc) const { MyFormView::Dump(dc); } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // TodayForm message handlers void TodayForm::OnInitialUpdate() { MyFormView::OnInitialUpdate(); // m_List1.m_bSortSupport =0; // m_List5.m_bSortSupport =0; m_bHospital = atoi(g_cominfoarray.ElementAt(0).ElementAt(125)); 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); GetDlgItem(IDC_RADIO9)->ShowWindow(SW_HIDE); GetDlgItem(IDC_RADIO14)->ShowWindow(SW_HIDE); GetDlgItem(IDC_RADIO15)->ShowWindow(SW_HIDE); //#ifdef CHILD_VERSION GetDlgItem(IDC_RADIO16)->ShowWindow(SW_HIDE); // 医院跟踪:孕妇预产期; //#endif if (g_bAllBranch) { GetDlgItem(IDC_RADIO3)->ShowWindow(SW_HIDE); GetDlgItem(IDC_RADIO4)->ShowWindow(SW_HIDE); GetDlgItem(IDC_RADIO5)->ShowWindow(SW_HIDE); GetDlgItem(IDC_RADIO6)->ShowWindow(SW_HIDE); GetDlgItem(IDC_RADIO7)->ShowWindow(SW_HIDE); GetDlgItem(IDC_RADIO8)->ShowWindow(SW_HIDE); GetDlgItem(IDC_RADIO10)->ShowWindow(SW_HIDE); GetDlgItem(IDC_BUTall)->ShowWindow(SW_HIDE); GetDlgItem(IDC_STATIC3)->ShowWindow(SW_HIDE); m_bShowCalendar = 0; } // 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); if (g_bAllBranch) { CRect rc; GetDlgItem(IDC_RADIO3)->GetWindowRect(rc2); ScreenToClient(rc2); GetDlgItem(IDC_STATIC2)->GetWindowRect(rc); ScreenToClient(rc); rc.top = rc2.top; rc.bottom = rc2.bottom; GetDlgItem(IDC_STATIC2)->MoveWindow(rc); GetDlgItem(IDC_RADIO5)->GetWindowRect(rc2); ScreenToClient(rc2); rc2.bottom += rc2.Height(); rc2.top += rc2.Height() / 2; GetDlgItem(IDC_CHECK1)->MoveWindow(rc2); rc2.left = rc2.right; rc2.right = rc2.left + 100; GetDlgItem(IDC_CHECK2)->MoveWindow(rc2); GetDlgItem(IDC_BUTtake3)->GetWindowRect(rc2); ScreenToClient(rc2); GetDlgItem(IDC_STATIC3)->GetWindowRect(rc); ScreenToClient(rc); rc.right = rc2.left - rc2.Width() / 3; GetDlgItem(IDC_STATIC3)->MoveWindow(rc); } int idarray[] = { IDC_BUTall, IDC_BUTtakeaway, IDC_BUTtake3, IDC_BUTtake, IDC_BUTchoose, IDC_BUTmsg, IDC_BUTclose }; int idcount = 7; 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_RADIO14)->SetWindowText("宝宝满月"); GetDlgItem(IDC_RADIO15)->SetWindowText("宝宝100天"); #endif #ifdef ENTERPRISE_VERSION m_nAdd2 = 1; if (g_bAllBranch == 0) { #ifdef CHILD_VERSION GetDlgItem(IDC_RADIO7)->ShowWindow(SW_HIDE); GetDlgItem(IDC_RADIO7)->GetWindowRect(rc2); ScreenToClient(rc2); GetDlgItem(IDC_RADIO8)->MoveWindow(rc2); m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;性别,100;年龄,100;手机,100;固定电话,100;取件日期,100;景点,100;拍摄店,100;拍照,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_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120");//;录入时间,120 m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;录入,100;录入时间,120;状态,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;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100"); #else m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;取件日期,100;婚期,100;景点,100;拍摄店,100;拍照,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;套系价格,100" ); //m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120 m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;录入,100;录入时间,120;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100"); m_List3.SetHeadings("订单号,100;男宾姓名,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;套系价格,100" ); m_List5.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚期,100;婚庆内容,100;婚庆日期,100;时间,100;服务人员,100;服务人员2,100;状态,100;备注,100;接单人,100;套系名称,100;套系价格,100" ); m_List5.LoadColumnInfo (172);m_List5.m_bSortSupport=0; #endif m_List6.SetHeadings("客人姓名,100;性别,100;日期,100;是否农历,100;客户类别,100;电话,100;天数,200"); m_List1.LoadColumnInfo(110); m_List2.LoadColumnInfo(161); m_List3.LoadColumnInfo(162); m_List4.LoadColumnInfo(163); m_List6.LoadColumnInfo(169); } else { #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;欠款,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;套系价格,100" ); //m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120 m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;录入,100;录入时间,120;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100"); m_List3.SetHeadings("店名,100;订单号,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;套系价格,100"); #else m_List1.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;取件日期,100;婚期,100;景点,100;拍摄店,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;套系名称,100;套系价格,100" ); //m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120 m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;录入,100;录入时间,120;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" ); m_List3.SetHeadings("店名,100;订单号,100;男宾姓名,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;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100" ); m_List5.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚期,100;婚庆内容,100;婚庆日期,100;时间,100;服务人员,100;服务人员2,100;状态,100;备注,100;接单人,100;套系名称,100;套系价格,100" ); m_List5.LoadColumnInfo (193);m_List5.m_bSortSupport=0; #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_List1.LoadColumnInfo(188); m_List2.LoadColumnInfo(189); m_List3.LoadColumnInfo(190); m_List4.LoadColumnInfo(191); m_List6.LoadColumnInfo(192); GetDlgItem(IDC_RADIO8)->ShowWindow(SW_HIDE); } #else if (g_bAllBranch == 0) { #ifdef CHILD_VERSION GetDlgItem(IDC_RADIO7)->ShowWindow(SW_HIDE); GetDlgItem(IDC_RADIO7)->GetWindowRect(rc2); ScreenToClient(rc2); GetDlgItem(IDC_RADIO8)->MoveWindow(rc2); m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;性别,100;年龄,100;手机,100;固定电话,100;取件日期,100;景点,100;拍照,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_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120 m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;录入,100;录入时间,120;状态,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;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100"); #else m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;取件日期,100;婚期,100;景点,100;拍照,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;套系价格,100" ); //m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100" );//;录入时间,120 m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;录入,100;录入时间,120;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100"); m_List3.SetHeadings("订单号,100;男宾姓名,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;套系价格,100"); m_List5.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚期,100;婚庆内容,100;婚庆日期,100;时间,100;服务人员,100;服务人员2,100;状态,100;备注,100;接单人,100;套系名称,100;套系价格,100"); m_List5.LoadColumnInfo(172); m_List5.m_bSortSupport = 0; #endif m_List6.SetHeadings("客人姓名,100;性别,100;日期,100;是否农历,100;客户类别,100;电话,100;天数,200"); m_List1.LoadColumnInfo(110); m_List2.LoadColumnInfo(161); m_List3.LoadColumnInfo(162); m_List4.LoadColumnInfo(163); m_List6.LoadColumnInfo(169); } else { #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;录入,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;套系价格,100" ); //m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120 m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;录入,100;录入时间,120;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100"); m_List3.SetHeadings("店名,100;订单号,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;套系价格,100"); #else m_List1.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;取件日期,100;婚期,100;景点,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;套系名称,100;套系价格,100" ); //m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120 m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;录入,100;录入时间,120;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100"); m_List3.SetHeadings("店名,100;订单号,100;男宾姓名,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;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100"); m_List5.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚期,100;婚庆内容,100;婚庆日期,100;时间,100;服务人员,100;服务人员2,100;状态,100;备注,100;接单人,100;套系名称,100;套系价格,100"); m_List5.LoadColumnInfo(193); m_List5.m_bSortSupport = 0; #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_List1.LoadColumnInfo(188); m_List2.LoadColumnInfo(189); m_List3.LoadColumnInfo(190); m_List4.LoadColumnInfo(191); m_List6.LoadColumnInfo(192); GetDlgItem(IDC_RADIO8)->ShowWindow(SW_HIDE); } #endif m_bInit = 1; if (g_bAllBranch == 0) { m_List1.ShowWindow(SW_HIDE); m_List1.GetWindowRect(rc2); ScreenToClient(rc2); m_CalendarFrm.m_rect = rc2; m_CalendarFrm.Create(rc2, this, 106); if (m_radio == 5) OnRadio8(); else GetCalendarData(); } else DateChange(); m_List1.GetWindowRect(rc2); ScreenToClient(rc2); // 其他预约列表; m_childdlg.Create(IDD_DLGTodayFormChild, this); //rc2.right += 10; CRect rc = rc2; rc2.top += 30; rc2.bottom += 256 * 19 - 30; m_childdlg.List1array = &m_List7array; 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_vScroll.MoveWindow(rc2); rc.bottom = rc.top + 30; rc.right -= 20; m_table.Create(rc, this, WS_HSCROLL); m_table.m_bFocusFrame = 0; m_table.Test2(); m_page = rc2.Height() - 40; m_vScroll.SetScrollRange(0, 256 * 20); m_vScroll.SetScrollPos(0); 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); m_table.ShowWindow(SW_HIDE); m_childdlg.ShowWindow(SW_HIDE); m_vScroll.ShowWindow(SW_HIDE); } void TodayForm::FillGrid() { UpdateData(); int ii = 0; if (m_radio == 0) // 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); 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)); #ifdef ENTERPRISE_VERSION int nAdd2 = 0; #ifndef CHILD_VERSION nAdd2=-1; #endif if (::FindArray(&m_datearray1, m_List1array.ElementAt(ii).ElementAt(9 + m_nAdd + nAdd2)) == -1) m_datearray1.Add(m_List1array.ElementAt(ii).ElementAt(9 + m_nAdd + nAdd2)); #else #ifdef CHILD_VERSION if (::FindArray(&m_datearray1, m_List1array.ElementAt(ii).ElementAt(10 + m_nAdd + m_nAdd2)) == -1) m_datearray1.Add(m_List1array.ElementAt(ii).ElementAt(10 + m_nAdd + m_nAdd2)); #else if (::FindArray(&m_datearray1, m_List1array.ElementAt(ii).ElementAt(9 + m_nAdd + m_nAdd2)) == -1) m_datearray1.Add(m_List1array.ElementAt(ii).ElementAt(9 + m_nAdd + m_nAdd2)); #endif #endif } m_List1.m_arLabels.SetSize(count, 1); ii = count; m_List1.m_LabelCount = ii; m_List1.SetItemCountEx(ii); #if JEFF_TEST_ON//2015-05-15 CStringArray AryOrder; AryOrder.SetSize(count); AryOrder.RemoveAll(); for (int m = 0; m < count; m++) { AryOrder.Add(m_List1.m_arLabels.ElementAt(m).ElementAt(0)); } // 显示的订单数不对,显示成行数,要过滤; for (int k = 0; k < AryOrder.GetSize(); k++) { int nArySize = AryOrder.GetSize(); for (int n = nArySize - 1; n > 0; n--) { if (AryOrder.ElementAt(k) == AryOrder.ElementAt(n)) { if (k != n) AryOrder.RemoveAt(n); } } } ii = AryOrder.GetSize(); #endif } else if (m_radio == 1)// 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); 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 + m_nAdd)) == -1) m_datearray2.Add(m_List2array.ElementAt(ii).ElementAt(5 + m_nAdd)); } m_List2.m_arLabels.SetSize(count, 1); ii = count; m_List2.m_LabelCount = ii; m_List2.SetItemCountEx(ii); } else if (m_radio == 2)// 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); 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 + m_nAdd)) == -1) m_datearray3.Add(m_List3array.ElementAt(ii).ElementAt(5 + m_nAdd)); } m_List3.m_arLabels.SetSize(count, 1); ii = count; m_List3.m_LabelCount = ii; m_List3.SetItemCountEx(ii); } else if (m_radio == 3)// 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); 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 + m_nAdd)) == -1) m_datearray4.Add(m_List4array.ElementAt(ii).ElementAt(5 + m_nAdd)); } 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); m_List5.DeleteAllItems2(); m_datearray5.RemoveAll(); m_List5.m_arLabels.SetSize(m_List5array.GetSize(), 1); int count = 0; int dan = 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(7 + m_nAdd)) == -1) m_datearray5.Add(m_List5array.ElementAt(ii).ElementAt(7 + m_nAdd)); CString date = m_List5array.ElementAt(ii).ElementAt(7 + m_nAdd); if (date.GetLength() == 10 && date >= m_date1 && date <= m_date2)dan++; } m_List5.m_arLabels.SetSize(count, 1); ii = count; m_List5.m_LabelCount = ii; m_List5.SetItemCountEx(ii); CString str; str.Format("单数:%d", dan); SetDlgItemText(IDC_STATIC2, str); return; } else if (m_radio == 5)// 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+m_nAdd) )==-1) // m_datearray6.Add (m_List6array.ElementAt (ii).ElementAt (9+m_nAdd)); } 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 TodayForm::OnBUTclose() //wenbin mark { GetParent()->SendMessage(WM_CLOSE); } void TodayForm::OnBUTchoose3() //看设计 { m_mode = 3; FillGrid(); } int __cdecl CompareByLabel3(const void *elem1, const void *elem2) { CStringArray *p1 = (CStringArray*)elem1; CStringArray *p2 = (CStringArray*)elem2; #ifdef CHILD_VERSION return lstrcmp(p1->ElementAt(10), p2->ElementAt(10)); #else return lstrcmp(p1->ElementAt(9), p2->ElementAt(9)); #endif } int __cdecl CompareByLabel5(const void *elem1, const void *elem2) { CStringArray *p1 = (CStringArray*)elem1; CStringArray *p2 = (CStringArray*)elem2; int nAdd = 0; if (g_bAllBranch)nAdd = 1; int nAdd2 = 0; #ifndef CHILD_VERSION nAdd2 = -1; #endif if (p1->ElementAt(9 + nAdd + nAdd2) == p2->ElementAt(9 + nAdd + nAdd2) && p1->ElementAt(11 + nAdd + nAdd2) == p2->ElementAt(11 + nAdd + nAdd2)) { return lstrcmp(p1->ElementAt(12 + nAdd + nAdd2), p2->ElementAt(12 + nAdd + nAdd2)); } if (p1->ElementAt(9 + nAdd + nAdd2) == p2->ElementAt(9 + nAdd + nAdd2)) { return lstrcmp(p1->ElementAt(11 + nAdd + nAdd2), p2->ElementAt(11 + nAdd + nAdd2)); } return lstrcmp(p1->ElementAt(9 + nAdd + nAdd2), p2->ElementAt(9 + nAdd + nAdd2)); return 1; } int __cdecl CompareByLabel7(const void *elem1, const void *elem2) { CStringArray *p1 = (CStringArray*)elem1; CStringArray *p2 = (CStringArray*)elem2; int nAdd = 0; if (g_bAllBranch)nAdd = 1; int nAdd2 = 0; #ifndef CHILD_VERSION nAdd2 = -1; #endif if (p1->ElementAt(9 + nAdd + nAdd2) == p2->ElementAt(9 + nAdd + nAdd2)) { return lstrcmp(p1->ElementAt(11 + nAdd + nAdd2), p2->ElementAt(11 + nAdd + nAdd2)); } return lstrcmp(p1->ElementAt(9 + nAdd + nAdd2), p2->ElementAt(9 + nAdd + nAdd2)); return 1; } int __cdecl CompareByLabel8(const void *elem1, const void *elem2) { CStringArray *p1 = (CStringArray*)elem1; CStringArray *p2 = (CStringArray*)elem2; int nAdd2 = 0; #ifndef CHILD_VERSION nAdd2 = -1; #endif int nAdd = 0; if (g_bAllBranch)nAdd = 1; return lstrcmp(p1->ElementAt(9 + nAdd + nAdd2), p2->ElementAt(9 + nAdd + nAdd2)); } void TodayForm::DateChange()//connect with server; { if (m_bInit == 0)return; if (m_bShowCalendar&&m_radio != 6) { return; } m_spinyear.EnableWindow(0); m_spinmonth.EnableWindow(0); m_spinday.EnableWindow(0); UpdateData(); if (m_radio == 5) {// 看设计客人; GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0); GetDlgItem(IDC_BUTall)->ShowWindow(0); GetDlgItem(IDC_BUTtake3)->ShowWindow(0); GetDlgItem(IDC_BUTtake)->ShowWindow(0); GetDlgItem(IDC_BUTchoose)->ShowWindow(0); GetDlgItem(IDC_RADIO9)->ShowWindow(1); GetDlgItem(IDC_RADIO14)->ShowWindow(1); GetDlgItem(IDC_RADIO15)->ShowWindow(1); #ifdef CHILD_VERSION if ( m_bHospital ) GetDlgItem(IDC_RADIO16)->ShowWindow(1); #endif } else if (m_radio == 6) {// 取件客人; m_childdlg.m_table.ModeChange(10); m_table.ModeChange(10); m_table.Test2(); m_table.ShowWindow(SW_SHOW); m_childdlg.ShowWindow(SW_SHOW); m_vScroll.ShowWindow(SW_SHOW); GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0); GetDlgItem(IDC_BUTall)->ShowWindow(0); GetDlgItem(IDC_BUTtake3)->ShowWindow(0); GetDlgItem(IDC_BUTtake)->ShowWindow(1); GetDlgItem(IDC_BUTchoose)->ShowWindow(1); GetDlgItem(IDC_BUTtake)->SetWindowText("另约日期"); GetDlgItem(IDC_BUTchoose)->SetWindowText("取消预约"); GetDlgItem(IDC_RADIO9)->ShowWindow(0); GetDlgItem(IDC_RADIO14)->ShowWindow(0); GetDlgItem(IDC_RADIO15)->ShowWindow(0); #ifdef CHILD_VERSION GetDlgItem(IDC_RADIO16)->ShowWindow(0); #endif } else { GetDlgItem(IDC_BUTtakeaway)->ShowWindow(1); if (!g_bAllBranch)GetDlgItem(IDC_BUTall)->ShowWindow(1); GetDlgItem(IDC_BUTtake3)->ShowWindow(1); GetDlgItem(IDC_BUTtake)->ShowWindow(1); GetDlgItem(IDC_BUTchoose)->ShowWindow(1); GetDlgItem(IDC_BUTtake)->SetWindowText("客人预约"); GetDlgItem(IDC_BUTchoose)->SetWindowText("重新安排"); GetDlgItem(IDC_RADIO9)->ShowWindow(0); GetDlgItem(IDC_RADIO14)->ShowWindow(0); GetDlgItem(IDC_RADIO15)->ShowWindow(0); #ifdef CHILD_VERSION GetDlgItem(IDC_RADIO16)->ShowWindow(0); #endif } if (0)//m_radio==5) { GetDlgItem(IDC_CHECK1)->SetWindowText("近半个月"); GetDlgItem(IDC_CHECK2)->SetWindowText("近一个月"); } else { GetDlgItem(IDC_CHECK1)->SetWindowText("近一个星期"); GetDlgItem(IDC_CHECK2)->SetWindowText("近半个月"); } if (m_radio == 0 || m_radio == 1 || m_radio == 2 || m_radio == 3 || m_radio == 4) GetDlgItem(IDC_BUTtakeaway)->ShowWindow(1); else GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0); if (m_radio == 0) GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未拍"); if (m_radio == 1) GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未选"); if (m_radio == 2) GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未看"); if (m_radio == 3) GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未取"); if (m_radio == 4) GetDlgItem(IDC_BUTtake3)->SetWindowText("统计婚庆"); 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 = "无效日期"; m_static1.SetWindowText(strdate + "(" + sdate + ")小秘书"); m_date1 = strdate; m_date2 = strdate2; if (m_radio == 0) // 拍照客人; { GetData1(strdate, strdate2); } else if (m_radio == 1) // 选片客人; { GetData2(strdate, strdate2); } else if (m_radio == 2) // 看设计客人; { GetData3(strdate, strdate2); } else if (m_radio == 3) // 取件客人; { GetData4(strdate, strdate2); } else if (m_radio == 4) // 婚期; { GetData5(strdate, strdate2); } else if (m_radio == 6) // 其他预约; { m_List7array.RemoveAll(); g_sendhead.code[0] = 221; g_sendhead.tabcount = 1; g_sendhead.bsql = 0; CString sql; sql.Format("date>='" + strdate + "' and date<='" + strdate2 + "' and mode='10'"); g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0) { m_childdlg.ShowTable(); return; } DataToArray(&m_List7array); m_childdlg.ShowTable(); #if 0 int temp = m_nscrollpos; int nscrollpos = m_vScroll.GetScrollPos(); m_nscrollpos = 0; m_vScroll.SetScrollPos(m_nscrollpos); m_childdlg.ScrollWindow(0, temp - m_nscrollpos); #else m_vScroll.ShowWindow(SW_HIDE); #endif } else if (m_radio == 5) // 近期生日; { m_List6array.RemoveAll(); CString today = _T(""); CString todaynl = _T(""); today.Format(_T("%04d-%02d-%02d"),CTime::GetCurrentTime().GetYear(),m_month,m_day); todaynl.Format(_T("%04d-%02d-%02d"),CTime::GetCurrentTime().GetYear(),m_month,m_day); CovertDate2(todaynl); CTime todaytm = GetTmFromStr(today); CString name, sex, phone, birthday, clienttype, days, birthdaybak; BOOL checknl; int ndays = 0; int checkdays = 30; if (m_check) checkdays = 7; if (m_check2) checkdays = 15; #ifdef CHILD_VERSION g_sendhead.code[0] = 94; #else g_sendhead.code[0] = 64; #endif g_sendhead.code[1] = 138; g_sendhead.code[2] = 90; #if JEFF_TEST_ON g_sendhead.code[3] = 130; // 蓝钻会员; g_sendhead.code[4] = 68; // 现金子卡会员; #endif g_sendhead.tabcount = 5; #ifdef CHILD_VERSION // 儿童版医院跟踪系统; if ( m_bHospital ) { g_sendhead.code[5] = 206; g_sendhead.tabcount = 6; } #endif g_sendhead.bsql = 0; g_pMainWnd->ProcessChatMessageRequest2(1); if (g_bSendOK == 0) return; CArrayList1array; CArrayList2array; CArrayList3array; CArrayList4array; CArrayList5array; CArrayList6array; // 儿童版医院跟踪系统; #ifdef CHILD_VERSION if ( m_bHospital ) DataToArray(&List1array, &List2array, &List3array, &List4array, &List5array, &List6array); else DataToArray(&List1array, &List2array, &List3array, &List4array, &List5array); #else DataToArray(&List1array, &List2array, &List3array, &List4array, &List5array); #endif clienttype = _T("订单客户"); int size = 0; int nMemorialYear = 0; // 周年; #ifdef CHILD_VERSION DealChildBrithday(checkdays, size, _T("订单客户"), todaytm, List1array); DealChildBrithday(checkdays, size, _T("老客户"), todaytm, List2array); DealChildBrithday(checkdays, size, _T("意向客户"), todaytm, List3array); DealChildBrithday(checkdays, size, _T("蓝钻客户"), todaytm, List4array); DealChildBrithday(checkdays, size, _T("会员客户"), todaytm, List5array); if ( m_bHospital ) DealChildBrithday(checkdays, size, _T("医院客户"), todaytm, List6array); #else//以下为婚纱版 DealWeddingBrithday(checkdays, size, _T("订单客户"), todaytm, List1array); DealWeddingBrithday(checkdays, size, _T("老客户"), todaytm, List2array); DealWeddingBrithday(checkdays, size, _T("意向客户"), todaytm, List3array); DealWeddingBrithday(checkdays, size, _T("蓝钻客户"), todaytm, List4array); DealWeddingBrithday(checkdays, size, _T("会员客户"), todaytm, List5array); #endif } HidePrice(); FillGrid(); m_spinyear.EnableWindow(1); m_spinmonth.EnableWindow(1); m_spinday.EnableWindow(1); } void TodayForm::OnCheck1() { UpdateData(); m_check2 = 0; UpdateData(false); DateChange(); } void TodayForm::OnCheck2() { UpdateData(); m_check = 0; UpdateData(false); DateChange(); } void TodayForm::OnChangeEDITyear() { DateChange(); GetCalendarData(); } void TodayForm::OnChangeEDITmonth() { DateChange(); GetCalendarData(); } void TodayForm::OnChangeEDITday() { DateChange(); if (m_bInit == 0)return; if (m_bShowCalendar == 0)return; UpdateData(); m_CalendarFrm.DateChange2(m_year, m_month, m_day); m_CalendarFrm.m_oCalendar.Invalidate(); // TODO: Add your control notification handler code her } void TodayForm::OnRadio3() //拍照客人; { // TODO: Add your control notification handler code here OnRadio8(); } void TodayForm::OnRadio4() { // TODO: Add your control notification handler code here OnRadio8(); } void TodayForm::OnRadio5() { // TODO: Add your control notification handler code here OnRadio8(); } void TodayForm::OnRadio6() { // TODO: Add your control notification handler code here OnRadio8(); } void TodayForm::OnRadio7() { // TODO: Add your control notification handler code here OnRadio8(); } void TodayForm::OnRadio8() { // TODO: Add your control notification handler code here UpdateData(); if (m_radio == 6) { m_List1.ShowWindow(SW_HIDE); 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); m_CalendarFrm.ShowWindow(SW_HIDE); m_table.ShowWindow(SW_SHOW); m_childdlg.ShowWindow(SW_SHOW); m_vScroll.ShowWindow(SW_SHOW); DateChange(); return; } m_table.ShowWindow(SW_HIDE); m_childdlg.ShowWindow(SW_HIDE); m_vScroll.ShowWindow(SW_HIDE); if (m_bShowCalendar) { m_List1.ShowWindow(SW_HIDE); 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); m_CalendarFrm.ShowWindow(SW_SHOW); if (m_radio == 5) { GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0); GetDlgItem(IDC_BUTall)->ShowWindow(0); GetDlgItem(IDC_BUTtake3)->ShowWindow(0); GetDlgItem(IDC_BUTtake)->ShowWindow(0); GetDlgItem(IDC_BUTchoose)->ShowWindow(0); GetDlgItem(IDC_RADIO9)->ShowWindow(1); GetDlgItem(IDC_RADIO14)->ShowWindow(1); GetDlgItem(IDC_RADIO15)->ShowWindow(1); #ifdef CHILD_VERSION if ( m_bHospital ) GetDlgItem(IDC_RADIO16)->ShowWindow(1); #endif } else if (m_radio == 6) { m_childdlg.m_table.ModeChange(10); m_table.ModeChange(10); m_table.Test2(); m_table.ShowWindow(SW_SHOW); m_childdlg.ShowWindow(SW_SHOW); m_vScroll.ShowWindow(SW_SHOW); GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0); GetDlgItem(IDC_BUTall)->ShowWindow(0); GetDlgItem(IDC_BUTtake3)->ShowWindow(0); GetDlgItem(IDC_BUTtake)->ShowWindow(1); GetDlgItem(IDC_BUTchoose)->ShowWindow(1); GetDlgItem(IDC_BUTtake)->SetWindowText("另约日期"); GetDlgItem(IDC_BUTchoose)->SetWindowText("取消预约"); GetDlgItem(IDC_RADIO9)->ShowWindow(0); GetDlgItem(IDC_RADIO14)->ShowWindow(0); GetDlgItem(IDC_RADIO15)->ShowWindow(0); #ifdef CHILD_VERSION GetDlgItem(IDC_RADIO16)->ShowWindow(0); #endif } else { GetDlgItem(IDC_BUTtakeaway)->ShowWindow(1); if (!g_bAllBranch)GetDlgItem(IDC_BUTall)->ShowWindow(1); GetDlgItem(IDC_BUTtake3)->ShowWindow(1); GetDlgItem(IDC_BUTtake)->ShowWindow(1); GetDlgItem(IDC_BUTchoose)->ShowWindow(1); GetDlgItem(IDC_BUTtake)->SetWindowText("客人预约"); GetDlgItem(IDC_BUTchoose)->SetWindowText("重新安排"); GetDlgItem(IDC_RADIO9)->ShowWindow(0); GetDlgItem(IDC_RADIO14)->ShowWindow(0); GetDlgItem(IDC_RADIO15)->ShowWindow(0); #ifdef CHILD_VERSION GetDlgItem(IDC_RADIO16)->ShowWindow(0); #endif } } else { m_CalendarFrm.ShowWindow(SW_HIDE); } DateChange(); } void TodayForm::OnBUTtake() // 客人预约按钮; { // TODO: Add your control notification handler code here if (IsHasRights2new(2) == 0)return; UpdateData(); if (m_radio == 6) { m_childdlg.OtherDate(); return; } if (m_radio == 0) // 拍照客人预约; { TakeControlDlg1 dlg; dlg.DoModal(); if (g_bAllBranch) { if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return; } DateChange(); GetCalendarData(); } else if (m_radio == 1) // 选片客人预约; { TakeControlDlg2 dlg; dlg.DoModal(); if (g_bAllBranch) { if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return; } DateChange(); GetCalendarData(); } else if (m_radio == 2) // 看设计客人预约; { TakeControlDlg3 dlg; dlg.DoModal(); if (g_bAllBranch) { if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return; } DateChange(); GetCalendarData(); } else if (m_radio == 3) // 取件客人预约; { TakeControlDlg4 dlg; dlg.DoModal(); if (g_bAllBranch) { if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return; } DateChange(); GetCalendarData(); } else if (m_radio == 4) { TakeControlDlg9 dlg; dlg.DoModal(); if (g_bAllBranch) { if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return; } DateChange(); GetCalendarData(); } } void TodayForm::OnBUTchoose() //重新安排; { // TODO: Add your control notification handler code here if (IsHasRights2new(2) == 0)return; UpdateData(); if (m_radio == 6) { m_childdlg.DeleteCur(); return; } if (m_radio == 0) { 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 + m_nAdd); TakeControlDlg1 dlg; if (g_bAllBranch) dlg.m_branch = m_List1.GetItemText(iItem, 0); dlg.id = id; dlg.m_bModify = 1; dlg.DoModal(); if (g_bAllBranch) { if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return; } DateChange(); GetCalendarData(); } else if (m_radio == 1) { POSITION pos; pos = m_List2.GetFirstSelectedItemPosition(); if (pos == NULL) { AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION); return; } int iItem = m_List2.GetNextSelectedItem(pos); CString id = m_List2.GetItemText(iItem, 0 + m_nAdd); TakeControlDlg2 dlg; if (g_bAllBranch) dlg.m_branch = m_List2.GetItemText(iItem, 0); dlg.id = id; dlg.m_bModify = 1; dlg.DoModal(); if (g_bAllBranch) { if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return; } DateChange(); GetCalendarData(); } else if (m_radio == 2) { POSITION pos; pos = m_List3.GetFirstSelectedItemPosition(); if (pos == NULL) { AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION); return; } int iItem = m_List3.GetNextSelectedItem(pos); CString id = m_List3.GetItemText(iItem, 0 + m_nAdd); TakeControlDlg3 dlg; if (g_bAllBranch) dlg.m_branch = m_List3.GetItemText(iItem, 0); dlg.id = id; dlg.m_bModify = 1; dlg.DoModal(); if (g_bAllBranch) { if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return; } DateChange(); GetCalendarData(); } else if (m_radio == 3) { POSITION pos; pos = m_List4.GetFirstSelectedItemPosition(); if (pos == NULL) { AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION); return; } int iItem = m_List4.GetNextSelectedItem(pos); CString id = m_List4.GetItemText(iItem, 0 + m_nAdd); TakeControlDlg4 dlg; if (g_bAllBranch) dlg.m_branch = m_List4.GetItemText(iItem, 0); dlg.id = id; dlg.m_bModify = 1; dlg.DoModal(); if (g_bAllBranch) { if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return; } DateChange(); GetCalendarData(); } else if (m_radio == 4) { POSITION pos; pos = m_List5.GetFirstSelectedItemPosition(); if (pos == NULL) { AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION); return; } int iItem = m_List5.GetNextSelectedItem(pos); CString id = m_List5.GetItemText(iItem, 0 + m_nAdd); while (id == "") { iItem--; id = m_List5.GetItemText(iItem, 0 + m_nAdd); } TakeControlDlg9 dlg; if (g_bAllBranch) dlg.m_branch = m_List5.GetItemText(iItem, 0); dlg.id = id; dlg.m_bModify = 1; dlg.DoModal(); if (g_bAllBranch) { if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return; } DateChange(); GetCalendarData(); } } void TodayForm::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 + m_nAdd) != "OK") #else if (m_List4.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9 + m_nAdd) != "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 TodayForm::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 + m_nAdd) != "OK" && m_List3.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(7 + m_nAdd) != "OK") #else if (m_List3.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9 + m_nAdd) != "OK" && m_List3.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8 + m_nAdd) != "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 TodayForm::OnBUTmsg() //短信; { // TODO: Add your control notification handler code here UpdateData(); POSITION pos; CStringArray array; CString name; if (m_radio == 0) { pos = m_List1.GetFirstSelectedItemPosition(); if (pos == NULL) { AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION); return; } int iItem; while (pos) { iItem = m_List1.GetNextSelectedItem(pos); #ifdef CHILD_VERSION array.Add(m_List1.GetItemText(iItem, 5 + m_nAdd)); array.Add(m_List1.GetItemText(iItem, 6 + m_nAdd)); #else array.Add(m_List1.GetItemText(iItem, 3 + m_nAdd)); array.Add(m_List1.GetItemText(iItem, 4 + m_nAdd)); #endif } } else if (m_radio == 1) { pos = m_List2.GetFirstSelectedItemPosition(); if (pos == NULL) { AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION); return; } int iItem; while (pos) { iItem = m_List2.GetNextSelectedItem(pos); array.Add(m_List2.GetItemText(iItem, 3 + m_nAdd)); array.Add(m_List2.GetItemText(iItem, 4 + m_nAdd)); } } else if (m_radio == 2) { pos = m_List3.GetFirstSelectedItemPosition(); if (pos == NULL) { AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION); return; } int iItem; while (pos) { iItem = m_List3.GetNextSelectedItem(pos); array.Add(m_List3.GetItemText(iItem, 3 + m_nAdd)); array.Add(m_List3.GetItemText(iItem, 4 + m_nAdd)); } } else if (m_radio == 3) { pos = m_List4.GetFirstSelectedItemPosition(); if (pos == NULL) { AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION); return; } int iItem; while (pos) { iItem = m_List4.GetNextSelectedItem(pos); array.Add(m_List4.GetItemText(iItem, 3 + m_nAdd)); array.Add(m_List4.GetItemText(iItem, 4 + m_nAdd)); } } else if (m_radio == 4) { pos = m_List5.GetFirstSelectedItemPosition(); if (pos == NULL) { AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION); return; } int iItem; while (pos) { iItem = m_List5.GetNextSelectedItem(pos); array.Add(m_List5.GetItemText(iItem, 3 + m_nAdd)); array.Add(m_List5.GetItemText(iItem, 4 + m_nAdd)); } } else if (m_radio == 5) { 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, 5)); } } else if (m_radio == 6) { array.Add(m_childdlg.GetCurPhone(name)); } SendMsgDlg dlg; if (m_radio == 5) dlg.m_mode = 1; dlg.m_pArray = &array; if (name != "") dlg.m_strSendSms = name + "您好,"; dlg.DoModal(); } void TodayForm::OnBUTtake3() //统计未拍; { // TODO: Add your control notification handler code here if (IsHasRights2new(2) == 0)return; if (m_radio == 0) { SearchTake dlg; dlg.DoModal(); } else if (m_radio == 1) { SearchTake2 dlg; dlg.DoModal(); } else if (m_radio == 2) { SearchTake3 dlg; dlg.DoModal(); } else if (m_radio == 3) { SearchTake4 dlg; dlg.DoModal(); } else if (m_radio == 4) { SearchTake5 dlg; dlg.DoModal(); } if (g_bAllBranch) { if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return; } DateChange(); GetCalendarData(); } void TodayForm::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 + m_nAdd); *pResult = 0; } void TodayForm::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 + m_nAdd); *pResult = 0; } void TodayForm::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 + m_nAdd); *pResult = 0; } void TodayForm::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 + m_nAdd); *pResult = 0; } void TodayForm::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 + m_nAdd); *pResult = 0; } void TodayForm::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here OnBUTchoose(); *pResult = 0; } void TodayForm::OnDblclkList3(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here OnBUTchoose(); *pResult = 0; } void TodayForm::OnDblclkList4(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here OnBUTchoose(); *pResult = 0; } void TodayForm::OnDblclkList7(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here // if(IsHasRights2new(3)==0)return; OnBUTchoose(); // g_pMainWnd->OnOutbarNotify("发片/取件"); *pResult = 0; } void TodayForm::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. pLVCD->clrText = RGB(0, 0, 0); #ifdef ENTERPRISE_VERSION COLORREF col[10] = { \ RGB(190, 76, 195), \ RGB(76, 176, 76), \ RGB(136, 113, 200), \ RGB(76, 186, 198), \ RGB(209, 127, 213), \ RGB(127, 209, 127), \ RGB(170, 154, 215), \ RGB(127, 206, 215), \ RGB(0, 127, 0), \ RGB(0, 0, 127) }; int nAdd2 = 0; #ifndef CHILD_VERSION nAdd2=-1; #endif int pos = ::FindArray(&m_datearray1, m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9 + m_nAdd + nAdd2)) % 10; if (pos < 10) pLVCD->clrTextBk = col[pos]; else if (pLVCD->nmcd.dwItemSpec % 2) pLVCD->clrTextBk = g_gridcol1; else pLVCD->clrTextBk = g_gridcol2; #else #ifdef CHILD_VERSION int pos = ::FindArray(&m_datearray1, m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(10 + m_nAdd)) % 10; #else int pos = ::FindArray(&m_datearray1, m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9 + m_nAdd)) % 10; #endif COLORREF col[10] = { \ RGB(209, 127, 213), \ RGB(127, 209, 127), \ RGB(170, 154, 215), \ RGB(127, 206, 215), \ RGB(190, 76, 195), \ RGB(76, 176, 76), \ RGB(136, 113, 200), \ RGB(76, 186, 198), \ RGB(0, 127, 0), \ RGB(0, 0, 127) }; if (pos < 10) pLVCD->clrTextBk = col[pos]; else if (pLVCD->nmcd.dwItemSpec % 2) pLVCD->clrTextBk = g_gridcol1; else pLVCD->clrTextBk = g_gridcol2; #endif // Store the color back in the NMLVCUSTOMDRAW struct. // Tell Windows to paint the control itself. *pResult = CDRF_DODEFAULT; } } void TodayForm::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 + m_nAdd)) % 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 TodayForm::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. CString date = m_List5.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(7 + m_nAdd); // MessageBox(date); // MessageBox(m_date1); // MessageBox(m_date2); if (date.GetLength() == 10 && date >= m_date1 && date <= m_date2) 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 TodayForm::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+m_nAdd) )%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 TodayForm::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 TodayForm::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_nAdd); m_name2 = m_List1.GetItemText(i, 2 + m_nAdd); m_phone1 = m_List1.GetItemText(i, 3 + m_nAdd); m_phone2 = m_List1.GetItemText(i, 4 + m_nAdd); str3 = m_List1.GetItemText(i, 5 + m_nAdd); str4 = m_List1.GetItemText(i, 6 + m_nAdd); str5 = m_List1.GetItemText(i, 7 + m_nAdd); str6 = m_List1.GetItemText(i, 8 + m_nAdd); str7 = m_List1.GetItemText(i, 9 + m_nAdd); str8 = m_List1.GetItemText(i, 12 + m_nAdd); str9 = m_List1.GetItemText(i, 13 + m_nAdd); 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 TodayForm::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_nAdd); m_name2 = m_List2.GetItemText(i, 2 + m_nAdd); m_phone1 = m_List2.GetItemText(i, 3 + m_nAdd); m_phone2 = m_List2.GetItemText(i, 4 + m_nAdd); str3 = m_List2.GetItemText(i, 5 + m_nAdd); str4 = m_List2.GetItemText(i, 6 + m_nAdd); str5 = m_List2.GetItemText(i, 9 + m_nAdd); str6 = m_List2.GetItemText(i, 10 + m_nAdd); 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 TodayForm::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_nAdd); m_name2 = m_List3.GetItemText(i, 2 + m_nAdd); m_phone1 = m_List3.GetItemText(i, 3 + m_nAdd); m_phone2 = m_List3.GetItemText(i, 4 + m_nAdd); str3 = m_List3.GetItemText(i, 5 + m_nAdd); str4 = m_List3.GetItemText(i, 6 + m_nAdd); str5 = m_List3.GetItemText(i, 10 + m_nAdd); str6 = m_List3.GetItemText(i, 11 + m_nAdd); 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 TodayForm::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_nAdd); m_name2 = m_List4.GetItemText(i, 2 + m_nAdd); m_phone1 = m_List4.GetItemText(i, 3 + m_nAdd); m_phone2 = m_List4.GetItemText(i, 4 + m_nAdd); str3 = m_List4.GetItemText(i, 5 + m_nAdd); str4 = m_List4.GetItemText(i, 6 + m_nAdd); str5 = m_List4.GetItemText(i, 10 + m_nAdd); str6 = m_List4.GetItemText(i, 11 + m_nAdd); 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 TodayForm::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_nAdd); m_name2 = m_List5.GetItemText(i, 2 + m_nAdd); m_phone1 = m_List5.GetItemText(i, 3 + m_nAdd); m_phone2 = m_List5.GetItemText(i, 4 + m_nAdd); str3 = m_List5.GetItemText(i, 5 + m_nAdd); str4 = m_List5.GetItemText(i, 6 + m_nAdd); str5 = m_List5.GetItemText(i, 7 + m_nAdd); str6 = m_List5.GetItemText(i, 12 + m_nAdd); str7 = m_List5.GetItemText(i, 13 + m_nAdd); 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 TodayForm::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 + m_nAdd); *pResult = 0; } void TodayForm::HidePrice() { #ifdef LKAY_VERSION if(IsHasRights2new(31))return; for(int i=0; i< m_List1array.GetSize (); i++) { m_List1array.ElementAt (i).SetAt (3+m_nAdd, "***"); m_List1array.ElementAt (i).SetAt (4+m_nAdd, "***"); m_List1array.ElementAt (i).SetAt (12+m_nAdd, "***"); m_List1array.ElementAt (i).SetAt (13+m_nAdd, "***"); } for( i=0; i< m_List2array.GetSize (); i++) { m_List2array.ElementAt (i).SetAt (3+m_nAdd, "***"); m_List2array.ElementAt (i).SetAt (4+m_nAdd, "***"); m_List2array.ElementAt (i).SetAt (9+m_nAdd, "***"); m_List2array.ElementAt (i).SetAt (10+m_nAdd, "***"); } for( i=0; i< m_List3array.GetSize (); i++) { m_List3array.ElementAt (i).SetAt (3+m_nAdd, "***"); m_List3array.ElementAt (i).SetAt (4+m_nAdd, "***"); m_List3array.ElementAt (i).SetAt (10+m_nAdd, "***"); m_List3array.ElementAt (i).SetAt (11+m_nAdd, "***"); } for( i=0; i< m_List4array.GetSize (); i++) { m_List4array.ElementAt (i).SetAt (3+m_nAdd, "***"); m_List4array.ElementAt (i).SetAt (4+m_nAdd, "***"); m_List4array.ElementAt (i).SetAt (10+m_nAdd, "***"); m_List4array.ElementAt (i).SetAt (11+m_nAdd, "***"); } #else if (IsHasRights2new(31))return; int i = 0; for ( i = 0; i < m_List1array.GetSize(); i++) { #ifdef ENTERPRISE_VERSION #ifdef CHILD_VERSION if ( g_bAllBranch == 0) { m_List1array.ElementAt(i).SetAt(5 + m_nAdd, "***"); m_List1array.ElementAt(i).SetAt(6 + m_nAdd, "***"); } else { m_List1array.ElementAt(i).SetAt(6 + m_nAdd, "***"); m_List1array.ElementAt(i).SetAt(7 + m_nAdd, "***"); } #else if ( g_bAllBranch == 0) { m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "***"); m_List1array.ElementAt(i).SetAt(4 + m_nAdd, "***"); } else { m_List1array.ElementAt(i).SetAt(4 + m_nAdd, "***"); m_List1array.ElementAt(i).SetAt(5 + m_nAdd, "***"); } #endif #else #ifdef CHILD_VERSION m_List1array.ElementAt(i).SetAt(5 + m_nAdd, "***"); m_List1array.ElementAt(i).SetAt(6 + m_nAdd, "***"); #else m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "***"); m_List1array.ElementAt(i).SetAt(4 + m_nAdd, "***"); #endif #endif } for (i = 0; i < m_List2array.GetSize(); i++) { m_List2array.ElementAt(i).SetAt(3 + m_nAdd, "***"); m_List2array.ElementAt(i).SetAt(4 + m_nAdd, "***"); } for (i = 0; i < m_List3array.GetSize(); i++) { m_List3array.ElementAt(i).SetAt(3 + m_nAdd, "***"); m_List3array.ElementAt(i).SetAt(4 + m_nAdd, "***"); } for (i = 0; i < m_List4array.GetSize(); i++) { m_List4array.ElementAt(i).SetAt(3 + m_nAdd, "***"); m_List4array.ElementAt(i).SetAt(4 + m_nAdd, "***"); } for (i = 0; i < m_List5array.GetSize(); i++) { m_List5array.ElementAt(i).SetAt(3 + m_nAdd, "***"); m_List5array.ElementAt(i).SetAt(4 + m_nAdd, "***"); } /* for( i=0; i< m_List6array.GetSize (); i++) { m_List6array.ElementAt (i).SetAt (16+m_nAdd, "***"); m_List6array.ElementAt (i).SetAt (17+m_nAdd, "***"); }*/ #endif } extern BOOL CovertDate(CString &date, CString &date2); //-------------------------------------------------------------------------- // Remak by Jeff 2014.11.03 // 函数:GetData1 // 描述:获取指定时期段内的拍照预约客人详情。 // 参数: // strBeginTime:时间段起始时刻; // strEndofTime:时间段结束时刻 // 返回: //-------------------------------------------------------------------------- void TodayForm::GetData1(CString strBeginTime, CString strEndofTime)//拍照客人; { CString sql; sql.Format("bookingdate>='" + strBeginTime + "' and bookingdate<='" + strEndofTime + "'"); int i = 0; if (g_bAllBranch == 0) { g_sendhead.code[0] = 120; // takeview视图; g_sendhead.tabcount = 1; g_sendhead.bsql = 0; g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return; DataToArray(&m_List1array); // qsort( static_cast(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel3 ); #ifdef CHILD_VERSION CString strBirthday; // 阳历生日; CString strLunarBirthday, str; COleDateTime tCurrentTime = COleDateTime::GetCurrentTime(); int days; for ( i = 0; i < m_List1array.GetSize(); i++) { strBirthday = m_List1array.ElementAt(i).ElementAt(24 + m_nAdd2); // Jeff:出生日期; if (m_List1array.ElementAt(i).ElementAt(25 + m_nAdd2) == "1") // Jeff:是否农历生日; { strLunarBirthday.Empty(); CovertDate(strBirthday, strLunarBirthday); if (strLunarBirthday != "") strBirthday = strLunarBirthday; } if (strBirthday.GetLength() == 10) { COleDateTime tBirthdayTime(atoi(strBirthday.Mid(0, 4)), atoi(strBirthday.Mid(5, 2)), atoi(strBirthday.Mid(8, 2)), COleDateTime::GetCurrentTime().GetHour(), COleDateTime::GetCurrentTime().GetMinute(), COleDateTime::GetCurrentTime().GetSecond()); #if JEFF_TEST_ON // Jeff:闰年和平年需要考虑; // 1.today != 生日 // 2.today > birthday; // 2.1.获取出生年 compare 今年; 相等,则不足1周岁;可细化月数:差多少天满月、满月、2月…… // 2.2.获取出生年 compare 今年; < 则 求模判断几周岁; // 3.today < birthday; // 3.1.获取出生年 compare 今年; 相等,2周岁; // 3.2.获取出生年 compare 今年; < 则 求模判断几周岁; // ------------------------------------------------- // 4.today == birthday; 模求周岁; // ------------------------------------------------- // // ------------------------------------------------- // 1.先获取birthday年份和今年年份值,对比; // 2.获取birthday月份和今年月份; // 3.获取birthday日号和今年日号; // ------------------------------------------------ //printf("Jeff:姓名:%s,出生日期:%d-%d-%d\n\n",m_List1array.ElementAt(i).ElementAt(2),tBirthdayTime.GetYear(),tBirthdayTime.GetMonth(),tBirthdayTime.GetDay()); //printf("Jeff:姓名:%s,今天日期:%d-%d-%d\n\n",m_List1array.ElementAt(i).ElementAt(2),tCurrentTime.GetYear(),tCurrentTime.GetMonth(),tCurrentTime.GetDay()); // tCurrentTime今天; tBirthdayTime生日; if (tBirthdayTime.GetYear() < tCurrentTime.GetYear()) // 未到1周岁、1周岁及以上: { if (tCurrentTime.GetYear() - tBirthdayTime.GetYear() == 1) // 判断是否1周岁生日到了; { if (tCurrentTime.GetMonth() == tBirthdayTime.GetMonth() && tCurrentTime.GetDay() == tBirthdayTime.GetDay()) { // 1周岁生日; str.Format("1周岁"); } else { if (tCurrentTime.GetMonth() < tBirthdayTime.GetMonth()) { // 未满一周岁; // str.Format ("%d岁", days); int nMonthCount = tBirthdayTime.GetMonth() - tCurrentTime.GetMonth(); if (tCurrentTime.GetDay() > tBirthdayTime.GetDay()) { str.Format("%d月", 12 - nMonthCount); } else { str.Format("%d月", 12 - nMonthCount - 1); } } else { str.Format("1岁"); } } } else if (tCurrentTime.GetYear() - tBirthdayTime.GetYear() > 1) { int nYearCount = 0; nYearCount = tCurrentTime.GetYear() - tBirthdayTime.GetYear(); if (tCurrentTime.GetMonth() >= tBirthdayTime.GetMonth() && tCurrentTime.GetDay() >= tBirthdayTime.GetDay()) // 满nYearCount周岁; { str.Format("%d周岁", nYearCount); } else // 不满nYearCount-1周岁; { str.Format("%d周岁", nYearCount - 1); } } } else if (tBirthdayTime.GetYear() == tCurrentTime.GetYear()) // 1周岁以下; { if (tCurrentTime.GetMonth() == tBirthdayTime.GetMonth()) { if (tCurrentTime.GetDay() == tBirthdayTime.GetDay()) { // 满月; str.Format("满月"); } else { // 差多少天满月; str.Format("差%d天满月", tCurrentTime.GetDay() - tBirthdayTime.GetDay()); } } else if (tCurrentTime.GetMonth() > tBirthdayTime.GetMonth()) { int nMonthCount = tCurrentTime.GetMonth() - tBirthdayTime.GetMonth(); if (tCurrentTime.GetDay() > tBirthdayTime.GetDay()) // 满nMonthCount月; { str.Format("%d月", nMonthCount); } else // 满nMonthCount-1月; { str.Format("%d月", nMonthCount - 1); } } } #else // Jeff:儿童版开单后,摄控本里显示的岁数不对; CTimeSpan dt = tCurrentTime - tBirthdayTime; days = dt.GetDays() + 1; if (days % 365 == 0) days /= 365; else { days /= 365; days++; } str.Format("%d岁", days); #endif m_List1array.ElementAt(i).InsertAt(3, str); } else { // 设置年龄; m_List1array.ElementAt(i).InsertAt(3, "未知"); } // 设置性别; str = m_List1array.ElementAt(i).ElementAt(27 + m_nAdd2); m_List1array.ElementAt(i).InsertAt(3, str); } #endif #ifdef ENTERPRISE_VERSION if ( m_List1array.GetSize() == 0 ) { return; } qsort(static_cast(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel8); qsort(static_cast(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel7); qsort(static_cast(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel5); #endif return; } //////////////数据汇总 m_List1array.RemoveAll(); CStringArray failbrancharray; CString branch; for ( i = -1; i < g_brancharray.GetSize() - 1; i++) { if (i != -1) { branch = g_brancharray.ElementAt(i).ElementAt(0); g_branchip = g_brancharray.ElementAt(i).ElementAt(1); g_pMainWnd->OnDisconnect(); g_branchname = branch; g_bBranchModify = 1; } else branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0); g_sendhead.bsql = 0; g_sendhead.code[0] = 120; g_sendhead.tabcount = 1; g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0) { failbrancharray.Add(branch); continue; } CArrayList1array; DataToArray(&List1array); int size = m_List1array.GetSize(); for (int j = 0; j < List1array.GetSize(); j++) { size++; m_List1array.SetSize(size, 1); size--; m_List1array.ElementAt(size).Copy(List1array.ElementAt(j)); m_List1array.ElementAt(size).InsertAt(0, branch); size++; } } #ifdef CHILD_VERSION CString strBirthday; // 阳历生日; CString strLunarBirthday, str; COleDateTime tCurrentTime = COleDateTime::GetCurrentTime(); int days; for (i = 0; i < m_List1array.GetSize(); i++) { strBirthday = m_List1array.ElementAt(i).ElementAt(25 + m_nAdd2); if (m_List1array.ElementAt(i).ElementAt(26 + m_nAdd2) == "1") { strLunarBirthday.Empty(); CovertDate(strBirthday, strLunarBirthday); if (strLunarBirthday != "")strBirthday = strLunarBirthday; } if (strBirthday.GetLength() == 10) { COleDateTime tBirthdayTime(atoi(strBirthday.Mid(0, 4)), atoi(strBirthday.Mid(5, 2)), atoi(strBirthday.Mid(8, 2)), COleDateTime::GetCurrentTime().GetHour(), COleDateTime::GetCurrentTime().GetMinute(), COleDateTime::GetCurrentTime().GetSecond()); #if JEFF_TEST_ON if (tBirthdayTime.GetYear() < tCurrentTime.GetYear()) // 未到1周岁、1周岁及以上: { if (tCurrentTime.GetYear() - tBirthdayTime.GetYear() == 1) // 判断是否1周岁生日到了; { if (tCurrentTime.GetMonth() == tBirthdayTime.GetMonth() && tCurrentTime.GetDay() == tBirthdayTime.GetDay()) { // 1周岁生日; str.Format("1周岁"); } else { if (tCurrentTime.GetMonth() < tBirthdayTime.GetMonth()) { // 未满一周岁; // str.Format ("%d岁", days); int nMonthCount = tBirthdayTime.GetMonth() - tCurrentTime.GetMonth(); if (tCurrentTime.GetDay() > tBirthdayTime.GetDay()) { str.Format("%d月", 12 - nMonthCount); } else { str.Format("%d月", 12 - nMonthCount - 1); } } else { str.Format("1岁"); } } } else if (tCurrentTime.GetYear() - tBirthdayTime.GetYear() > 1) { int nYearCount = 0; nYearCount = tCurrentTime.GetYear() - tBirthdayTime.GetYear(); if (tCurrentTime.GetMonth() >= tBirthdayTime.GetMonth() && tCurrentTime.GetDay() >= tBirthdayTime.GetDay()) // 满nYearCount周岁; { str.Format("%d周岁", nYearCount); } else // 不满nYearCount-1周岁; { str.Format("%d周岁", nYearCount - 1); } } } else if (tBirthdayTime.GetYear() == tCurrentTime.GetYear()) // 1周岁以下; { if (tCurrentTime.GetMonth() == tBirthdayTime.GetMonth()) { if (tCurrentTime.GetDay() == tBirthdayTime.GetDay()) { // 满月; str.Format("满月"); } else { // 差多少天满月; str.Format("差%d天满月", tCurrentTime.GetDay() - tBirthdayTime.GetDay()); } } else if (tCurrentTime.GetMonth() > tBirthdayTime.GetMonth()) { int nMonthCount = tCurrentTime.GetMonth() - tBirthdayTime.GetMonth(); if (tCurrentTime.GetDay() > tBirthdayTime.GetDay()) // 满nMonthCount月; { str.Format("%d月", nMonthCount); } else // 满nMonthCount-1月; { str.Format("%d月", nMonthCount - 1); } } } #else CTimeSpan dt=tCurrentTime-tBirthdayTime; days=dt.GetDays ()+1; if(days%365==0) days/=365; else { days/=365; days++; } str.Format ("%d岁", days); #endif m_List1array.ElementAt(i).InsertAt(4, str); } else { m_List1array.ElementAt(i).InsertAt(4, "未知"); } m_List1array.ElementAt(i).InsertAt(4, m_List1array.ElementAt(i).ElementAt(29 + m_nAdd2)); } #endif qsort(static_cast(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel8); qsort(static_cast(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel7); qsort(static_cast(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel5); for (i = 0; i < failbrancharray.GetSize(); i++) { // AfxMessageBox("连接"+failbrancharray.ElementAt(i)+"服务器失败!", MB_ICONINFORMATION); } g_pMainWnd->OnDisconnect(); g_bBranchModify = 0; g_branchip = g_branchname = ""; } void TodayForm::GetData2(CString strdate, CString strdate2)//选片客人; { CString sql; sql.Format("time4>='" + strdate + "' and time4<='" + strdate2 + "'"); if (g_bAllBranch == 0) { g_sendhead.code[0] = 121; g_sendhead.tabcount = 1; g_sendhead.bsql = 0; g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return; DataToArray(&m_List2array); return; } //////////////数据汇总 m_List2array.RemoveAll(); CStringArray failbrancharray; CString branch; for (int i = -1; i < g_brancharray.GetSize() - 1; i++) { if (i != -1) { branch = g_brancharray.ElementAt(i).ElementAt(0); g_branchip = g_brancharray.ElementAt(i).ElementAt(1); g_pMainWnd->OnDisconnect(); g_branchname = branch; g_bBranchModify = 1; } else branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0); g_sendhead.bsql = 0; g_sendhead.code[0] = 121; g_sendhead.tabcount = 1; g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0) { failbrancharray.Add(branch); continue; } CArrayList1array; DataToArray(&List1array); int size = m_List2array.GetSize(); for (int j = 0; j < List1array.GetSize(); j++) { size++; m_List2array.SetSize(size, 1); size--; m_List2array.ElementAt(size).Copy(List1array.ElementAt(j)); m_List2array.ElementAt(size).InsertAt(0, branch); size++; } } g_pMainWnd->OnDisconnect(); g_bBranchModify = 0; g_branchip = g_branchname = ""; } void TodayForm::GetData3(CString strdate, CString strdate2)//看设计客人; { CString sql; sql.Format("time6>='" + strdate + "' and time6<='" + strdate2 + "'"); if (g_bAllBranch == 0) { g_sendhead.code[0] = 122; g_sendhead.tabcount = 1; g_sendhead.bsql = 0; g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return; DataToArray(&m_List3array); return; } //////////////数据汇总 m_List3array.RemoveAll(); CStringArray failbrancharray; CString branch; for (int i = -1; i < g_brancharray.GetSize() - 1; i++) { if (i != -1) { branch = g_brancharray.ElementAt(i).ElementAt(0); g_branchip = g_brancharray.ElementAt(i).ElementAt(1); g_pMainWnd->OnDisconnect(); g_branchname = branch; g_bBranchModify = 1; } else branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0); g_sendhead.bsql = 0; g_sendhead.code[0] = 122; g_sendhead.tabcount = 1; g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0) { failbrancharray.Add(branch); continue; } CArrayList1array; DataToArray(&List1array); int size = m_List3array.GetSize(); for (int j = 0; j < List1array.GetSize(); j++) { size++; m_List3array.SetSize(size, 1); size--; m_List3array.ElementAt(size).Copy(List1array.ElementAt(j)); m_List3array.ElementAt(size).InsertAt(0, branch); size++; } } g_pMainWnd->OnDisconnect(); g_bBranchModify = 0; g_branchip = g_branchname = ""; } void TodayForm::GetData4(CString strdate, CString strdate2)//取件客人 { CString sql; sql.Format("time5>='" + strdate + "' and time5<='" + strdate2 + "' and [status3]='未取'"); if (g_bAllBranch == 0) { g_sendhead.code[0] = 123; g_sendhead.tabcount = 1; g_sendhead.bsql = 0; g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return; DataToArray(&m_List4array); return; } //////////////数据汇总 m_List4array.RemoveAll(); CStringArray failbrancharray; CString branch; for (int i = -1; i < g_brancharray.GetSize() - 1; i++) { if (i != -1) { branch = g_brancharray.ElementAt(i).ElementAt(0); g_branchip = g_brancharray.ElementAt(i).ElementAt(1); g_pMainWnd->OnDisconnect(); g_branchname = branch; g_bBranchModify = 1; } else branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0); g_sendhead.bsql = 0; g_sendhead.code[0] = 123; g_sendhead.tabcount = 1; g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0) { failbrancharray.Add(branch); continue; } CArrayList1array; DataToArray(&List1array); int size = m_List4array.GetSize(); for (int j = 0; j < List1array.GetSize(); j++) { size++; m_List4array.SetSize(size, 1); size--; m_List4array.ElementAt(size).Copy(List1array.ElementAt(j)); m_List4array.ElementAt(size).InsertAt(0, branch); size++; } } g_pMainWnd->OnDisconnect(); g_bBranchModify = 0; g_branchip = g_branchname = ""; } void TodayForm::GetData5(CString strdate, CString strdate2)// 近期生日; { CString sql; sql.Format("hqdate>='" + strdate + "' and hqdate<='" + strdate2 + "' and kind='2'"); // sql.Format ("%s,%s", strdate,strdate2); if (g_bAllBranch == 0) { g_sendhead.code[0] = 227; g_sendhead.tabcount = 1; g_sendhead.bsql = 0; g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return; DataToArray(&m_List5array); return; } //////////////数据汇总 m_List5array.RemoveAll(); CStringArray failbrancharray; CString branch; for (int i = -1; i < g_brancharray.GetSize() - 1; i++) { if (i != -1) { branch = g_brancharray.ElementAt(i).ElementAt(0); g_branchip = g_brancharray.ElementAt(i).ElementAt(1); g_pMainWnd->OnDisconnect(); g_branchname = branch; g_bBranchModify = 1; } else branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0); g_sendhead.bsql = 0; g_sendhead.code[0] = 227; g_sendhead.tabcount = 1; g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0) { failbrancharray.Add(branch); continue; } CArrayList1array; DataToArray(&List1array); int size = m_List5array.GetSize(); for (int j = 0; j < List1array.GetSize(); j++) { size++; m_List5array.SetSize(size, 1); size--; m_List5array.ElementAt(size).Copy(List1array.ElementAt(j)); m_List5array.ElementAt(size).InsertAt(0, branch); size++; } } g_pMainWnd->OnDisconnect(); g_bBranchModify = 0; g_branchip = g_branchname = ""; } void TodayForm::OnBUTtakeaway() // 打印; { if (IsHasRights2new(2) == 0)return; if (m_radio == 0) { SelMemberCardFund seldlg; seldlg.m_mode = 1; if (seldlg.DoModal() != IDOK)return; if (seldlg.m_radio1 == 0) { OnBUTtakeaway1(); return; } } else if (m_radio == 1) { OnBUTtakeaway2(); return; } else if (m_radio == 2) { OnBUTtakeaway3(); return; } else if (m_radio == 3) { OnBUTtakeaway4(); return; } else if (m_radio == 4) { OnBUTtakeaway5(); return; } POSITION pos; pos = m_List1.GetFirstSelectedItemPosition(); if (pos == NULL) { AfxMessageBox("请先选中您要打印的项目!", MB_ICONINFORMATION); return; } int iItem; CArrayListarray; int count = m_List1.GetItemCount(); Listarray.SetSize(count, 1); count = 0; int curpos = 0; CString str; int nChild = 1; CString name, m_name1, m_name2; CString phone, m_phone1, m_phone2; #ifdef CHILD_VERSION nChild = 2; #endif while (pos) { name = ""; phone = ""; iItem = m_List1.GetNextSelectedItem(pos); Listarray.ElementAt(curpos).Add("日期"); Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 8 + nChild + m_nAdd + m_nAdd2)); Listarray.ElementAt(curpos).Add("时间"); Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 9 + nChild + m_nAdd + m_nAdd2)); m_name1 = m_List1.GetItemText(iItem, 1 + m_nAdd); m_name2 = m_List1.GetItemText(iItem, 2 + m_nAdd); m_phone1 = m_List1.GetItemText(iItem, 3 + m_nAdd); m_phone2 = m_List1.GetItemText(iItem, 4 + m_nAdd); #ifdef CHILD_VERSION m_phone1 = m_List1.GetItemText(iItem, 5 + m_nAdd); m_phone2 = m_List1.GetItemText(iItem, 6 + m_nAdd); #endif if (!m_name1.IsEmpty()) name = m_name1 + ","; name += m_name2; name.TrimRight(","); if (!m_phone1.IsEmpty()) phone = m_phone1 + ","; phone += m_phone2; phone.TrimRight(","); Listarray.ElementAt(curpos).Add("客人姓名"); Listarray.ElementAt(curpos).Add(name); Listarray.ElementAt(curpos).Add("联系电话"); Listarray.ElementAt(curpos).Add(phone); Listarray.ElementAt(curpos).Add("景点"); Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 6 + nChild + m_nAdd)); Listarray.ElementAt(curpos).Add("摄影师"); Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 12 + nChild + m_nAdd + m_nAdd2)); Listarray.ElementAt(curpos).Add("助理"); Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 13 + nChild + m_nAdd + m_nAdd2)); #ifdef CHILD_VERSION Listarray.ElementAt(curpos).Add("引导师"); #else Listarray.ElementAt(curpos).Add("化妆师"); #endif Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 14 + nChild + m_nAdd + m_nAdd2)); Listarray.ElementAt(curpos).Add("助理"); Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 15 + nChild + m_nAdd + m_nAdd2)); Listarray.ElementAt(curpos).Add("服装"); Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 16 + nChild + m_nAdd + m_nAdd2)); Listarray.ElementAt(curpos).Add("门市"); Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 18 + nChild + m_nAdd + m_nAdd2)); Listarray.ElementAt(curpos).Add("备注"); Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 17 + nChild + m_nAdd + m_nAdd2)); curpos++; } Listarray.SetSize(curpos, 1); g_pMainWnd->PrintTakeForm(&Listarray); } void TodayForm::GetCalendarData() { if (m_bInit == 0)return; if (m_bShowCalendar == 0)return; m_spinyear.EnableWindow(0); m_spinmonth.EnableWindow(0); m_spinday.EnableWindow(0); UpdateData(); CString strdate, strdate2; strdate.Format("%04d-%02d-%02d", m_year, m_month, 1); strdate2.Format("%04d-%02d-%02d", m_year, m_month, 31); CString sql; sql = "bookingdate>='" + strdate + "' and bookingdate<='" + strdate2 + "';time4>='" + strdate + "' and time4<='" + strdate2 + "';time6>='" + strdate + "' and time6<='" + strdate2 + "';time5>='" + strdate + "' and time5<='" + strdate2 + "' and [status3]='未取';hqdate>='" + strdate + "' and hqdate<='" + strdate2 + "' and kind='2'"; g_sendhead.code[0] = 120; g_sendhead.code[1] = 121; g_sendhead.code[2] = 122; g_sendhead.code[3] = 123; g_sendhead.code[4] = 139; g_sendhead.tabcount = 5; g_sendhead.bsql = 0; g_pMainWnd->ProcessChatMessageRequest2(sql); m_spinyear.EnableWindow(1); m_spinmonth.EnableWindow(1); m_spinday.EnableWindow(1); if (g_bSendOK == 0)return; CArraym_List1array; CArraym_List2array; CArraym_List3array; CArraym_List4array; CArraym_List5array; DataToArray(&m_List1array, &m_List2array, &m_List3array, &m_List4array, &m_List5array); CArrayarray1; // Jeff:每日的拍照预约客人数量; CArrayarray2; // Jeff:每日的选片客人数量; CArrayarray3; // Jeff:......看样......; CArrayarray4; // Jeff:......取件......; CArrayarray5; // Jeff:......婚庆......; int pos; int i = 0; for ( i = 0; i < 32; i++) { array1.Add(0); array2.Add(0); array3.Add(0); array4.Add(0); array5.Add(0); } for (i = 0; i < m_List1array.GetSize(); i++) { // - old code: Jeff remark:没有对集团版进行处理; // #ifdef CHILD_VERSION // pos=atoi(m_List1array.ElementAt (i).ElementAt (8).Right (2)); // #else // pos=atoi(m_List1array.ElementAt (i).ElementAt (9).Right (2)); // #endif // the follow is modify by Jeff; #ifdef CHILD_VERSION // 儿童版 #ifdef ENTERPRISE_VERSION pos = atoi(m_List1array.ElementAt(i).ElementAt(9).Right(2)); #else pos = atoi(m_List1array.ElementAt(i).ElementAt(8).Right(2)); #endif #else // 婚纱版 #ifdef ENTERPRISE_VERSION pos=atoi(m_List1array.ElementAt (i).ElementAt (10).Right (2)); #else pos = atoi(m_List1array.ElementAt(i).ElementAt(9).Right(2)); #endif #endif array1.SetAt(pos, array1.ElementAt(pos) + 1); } for (i = 0; i < m_List2array.GetSize(); i++) { pos = atoi(m_List2array.ElementAt(i).ElementAt(5).Right(2)); array2.SetAt(pos, array2.ElementAt(pos) + 1); } for (i = 0; i < m_List3array.GetSize(); i++) { pos = atoi(m_List3array.ElementAt(i).ElementAt(5).Right(2)); array3.SetAt(pos, array3.ElementAt(pos) + 1); } for (i = 0; i < m_List4array.GetSize(); i++) { pos = atoi(m_List4array.ElementAt(i).ElementAt(5).Right(2)); array4.SetAt(pos, array4.ElementAt(pos) + 1); } for (i = 0; i < m_List5array.GetSize(); i++) { pos = atoi(m_List5array.ElementAt(i).ElementAt(6).Right(2)); array5.SetAt(pos, array5.ElementAt(pos) + 1); } m_CalendarFrm.m_oCalendar.m_Array.RemoveAll(); CString str; for (i = 0; i < 32; i++) { #ifndef CHILD_VERSION //wangwenbin mark str.Format("拍照客人: %d\n选片客人: %d\n看样客人: %d\n取件客人: %d\n婚庆客人: %d\n", array1.ElementAt(i), array2.ElementAt(i), array3.ElementAt(i), array4.ElementAt(i), array5.ElementAt(i)); #else str.Format("拍照客人: %d\n选片客人: %d\n看样客人: %d\n取件客人: %d\n", array1.ElementAt(i), array2.ElementAt(i), array3.ElementAt(i), array4.ElementAt(i)); #endif m_CalendarFrm.m_oCalendar.m_Array.Add(str); // Jeff:添加到日历控件中; } //SetDate(iYear, iMonth, iDay); m_CalendarFrm.DateChange(m_year, m_month); m_CalendarFrm.m_oCalendar.Invalidate(); } // Jeff:按钮:详情图表; void TodayForm::OnBUTall() // 详情; { // TODO: Add your control notification handler code here m_bShowCalendar = !m_bShowCalendar; if (m_bShowCalendar) { GetDlgItem(IDC_BUTall)->SetWindowText("详情"); m_List1.ShowWindow(SW_HIDE); 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); m_CalendarFrm.ShowWindow(SW_SHOW); } else { GetDlgItem(IDC_BUTall)->SetWindowText("图表"); m_CalendarFrm.ShowWindow(SW_HIDE); DateChange(); } } void TodayForm::SetDate(int m_iYear, int m_iMonth, int m_iDay) { UpdateData(); m_year = m_iYear; m_month = m_iMonth; m_day = m_iDay; UpdateData(false); } void TodayForm::OnBUTall2() { OnBUTall(); } void TodayForm::OnRadio9() { // TODO: Add your control notification handler code here OnRadio8(); } void TodayForm::OnRadio14() { // TODO: Add your control notification handler code here OnRadio8(); } void TodayForm::OnRadio15() { // TODO: Add your control notification handler code here OnRadio8(); } void TodayForm::OnRadio16() { // TODO: Add your control notification handler code here OnRadio8(); } //hideprice void TodayForm::OnRadio10() { // TODO: Add your control notification handler code here OnRadio8(); } void TodayForm::ReLoad1() { DateChange(); } CString TodayForm::GetDate() { UpdateData(); CString strdate; strdate.Format("%04d-%02d-%02d", m_year, m_month, m_day); return strdate; } //天后生日 void TodayForm::OnBUTtakeaway1() { CArrayListarray; CString name, m_name1, m_name2; CString phone, m_phone1, m_phone2; int nChild = 1; #ifdef CHILD_VERSION nChild = 2; #endif int count = m_List1.GetItemCount() / 45; if (m_List1.GetItemCount() % 45)count++; Listarray.SetSize(m_List1.GetItemCount() + count, 1); int pos = 0; for (int i = 0; i < m_List1.GetItemCount(); i++) { if (i % 45 == 0) { Listarray.ElementAt(pos).Add("客人/电话"); Listarray.ElementAt(pos).Add("景点"); Listarray.ElementAt(pos).Add("日期/时间"); Listarray.ElementAt(pos).Add("摄影/助理"); Listarray.ElementAt(pos).Add("化妆/助理"); Listarray.ElementAt(pos).Add("服装"); Listarray.ElementAt(pos).Add("门市"); pos++; } name = ""; phone = ""; m_name1 = m_List1.GetItemText(i, 1 + m_nAdd); m_name2 = m_List1.GetItemText(i, 2 + m_nAdd); if (!m_name1.IsEmpty()) name = m_name1 + ","; name += m_name2; name.TrimRight(","); m_phone1 = m_List1.GetItemText(i, 3 + m_nAdd); m_phone2 = m_List1.GetItemText(i, 4 + m_nAdd); #ifdef CHILD_VERSION m_phone1 = m_List1.GetItemText(i, 5 + m_nAdd); m_phone2 = m_List1.GetItemText(i, 6 + m_nAdd); #endif if (!m_phone1.IsEmpty()) phone = m_phone1 + ","; phone += m_phone2; phone.TrimRight(","); Listarray.ElementAt(pos).Add(name + "/" + phone); Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 6 + nChild + m_nAdd)); Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 8 + nChild + m_nAdd + m_nAdd2) + "/" + m_List1.GetItemText(i, 9 + nChild + m_nAdd + m_nAdd2)); Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 12 + nChild + m_nAdd + m_nAdd2) + "/" + m_List1.GetItemText(i, 13 + nChild + m_nAdd + m_nAdd2)); Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 14 + nChild + m_nAdd + m_nAdd2) + "/" + m_List1.GetItemText(i, 15 + nChild + m_nAdd + m_nAdd2)); Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 16 + nChild + m_nAdd + m_nAdd2)); Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 18 + nChild + m_nAdd + m_nAdd2)); pos++; } Listarray.SetSize(pos, 1); g_pMainWnd->PrintTakeForm1(&Listarray); } void TodayForm::OnBUTtakeaway2() { CArrayListarray; CString name, m_name1, m_name2; CString phone, m_phone1, m_phone2; int nChild = 0; #ifdef CHILD_VERSION nChild = -1; #endif int count = m_List2.GetItemCount() / 45; if (m_List2.GetItemCount() % 45)count++; Listarray.SetSize(m_List2.GetItemCount() + count, 1); int pos = 0; for (int i = 0; i < m_List2.GetItemCount(); i++) { if (i % 45 == 0) { Listarray.ElementAt(pos).Add("客人/电话"); Listarray.ElementAt(pos).Add("日期/时间"); Listarray.ElementAt(pos).Add("选片人"); Listarray.ElementAt(pos).Add("套系"); Listarray.ElementAt(pos).Add("门市"); pos++; } name = ""; phone = ""; m_name1 = m_List2.GetItemText(i, 1 + m_nAdd); m_name2 = m_List2.GetItemText(i, 2 + m_nAdd); if (!m_name1.IsEmpty()) name = m_name1 + ","; name += m_name2; name.TrimRight(","); m_phone1 = m_List2.GetItemText(i, 3 + m_nAdd); m_phone2 = m_List2.GetItemText(i, 4 + m_nAdd); #ifdef CHILD_VERSION m_phone1 = m_List2.GetItemText(i, 3 + m_nAdd); m_phone2 = m_List2.GetItemText(i, 4 + m_nAdd); #endif if (!m_phone1.IsEmpty()) phone = m_phone1 + ","; phone += m_phone2; phone.TrimRight(","); Listarray.ElementAt(pos).Add(name + "/" + phone); Listarray.ElementAt(pos).Add(m_List2.GetItemText(i, 5 + m_nAdd) + "/" + m_List2.GetItemText(i, 6 + m_nAdd));// 日期/时间; #if JEFF_TEST_ON // 由于添加了录入人和录入时间,所以要向后移动; Listarray.ElementAt(pos).Add(m_List2.GetItemText(i, 11 + nChild + m_nAdd)); Listarray.ElementAt(pos).Add(m_List2.GetItemText(i, 13 + nChild + m_nAdd)); Listarray.ElementAt(pos).Add(m_List2.GetItemText(i, 12 + nChild + m_nAdd)); #else Listarray.ElementAt(pos).Add(m_List2.GetItemText(i, 9 + nChild + m_nAdd)); Listarray.ElementAt(pos).Add(m_List2.GetItemText(i, 11 + nChild + m_nAdd)); Listarray.ElementAt(pos).Add(m_List2.GetItemText(i, 10 + nChild + m_nAdd)); #endif pos++; } Listarray.SetSize(pos, 1); g_pMainWnd->PrintTakeForm2(&Listarray); } void TodayForm::OnBUTtakeaway3() { CArrayListarray; CString name, m_name1, m_name2; CString phone, m_phone1, m_phone2; int nChild = 0; #ifdef CHILD_VERSION nChild = -1; #endif int count = m_List3.GetItemCount() / 45; if (m_List3.GetItemCount() % 45)count++; Listarray.SetSize(m_List3.GetItemCount() + count, 1); int pos = 0; for (int i = 0; i < m_List3.GetItemCount(); i++) { if (i % 45 == 0) { Listarray.ElementAt(pos).Add("客人/电话"); Listarray.ElementAt(pos).Add("日期/时间"); Listarray.ElementAt(pos).Add("看设计人"); Listarray.ElementAt(pos).Add("套系"); Listarray.ElementAt(pos).Add("门市"); pos++; } name = ""; phone = ""; m_name1 = m_List3.GetItemText(i, 1 + m_nAdd); m_name2 = m_List3.GetItemText(i, 2 + m_nAdd); if (!m_name1.IsEmpty()) name = m_name1 + ","; name += m_name2; name.TrimRight(","); m_phone1 = m_List3.GetItemText(i, 3 + m_nAdd); m_phone2 = m_List3.GetItemText(i, 4 + m_nAdd); #ifdef CHILD_VERSION m_phone1 = m_List3.GetItemText(i, 3 + m_nAdd); m_phone2 = m_List3.GetItemText(i, 4 + m_nAdd); #endif if (!m_phone1.IsEmpty()) phone = m_phone1 + ","; phone += m_phone2; phone.TrimRight(","); Listarray.ElementAt(pos).Add(name + "/" + phone); Listarray.ElementAt(pos).Add(m_List3.GetItemText(i, 5 + m_nAdd) + "/" + m_List3.GetItemText(i, 6 + m_nAdd)); Listarray.ElementAt(pos).Add(m_List3.GetItemText(i, 10 + nChild + m_nAdd)); Listarray.ElementAt(pos).Add(m_List3.GetItemText(i, 12 + nChild + m_nAdd)); Listarray.ElementAt(pos).Add(m_List3.GetItemText(i, 11 + nChild + m_nAdd)); pos++; } Listarray.SetSize(pos, 1); g_pMainWnd->PrintTakeForm3(&Listarray); } void TodayForm::OnBUTtakeaway4() { CArrayListarray; CString name, m_name1, m_name2; CString phone, m_phone1, m_phone2; int nChild = 0; #ifdef CHILD_VERSION nChild = -1; #endif int count = m_List4.GetItemCount() / 45; if (m_List4.GetItemCount() % 45)count++; Listarray.SetSize(m_List4.GetItemCount() + count, 1); int pos = 0; for (int i = 0; i < m_List4.GetItemCount(); i++) { if (i % 45 == 0) { Listarray.ElementAt(pos).Add("客人/电话"); Listarray.ElementAt(pos).Add("日期/时间"); Listarray.ElementAt(pos).Add("取件人"); Listarray.ElementAt(pos).Add("是否完件"); Listarray.ElementAt(pos).Add("门市"); pos++; } name = ""; phone = ""; m_name1 = m_List4.GetItemText(i, 1 + m_nAdd); m_name2 = m_List4.GetItemText(i, 2 + m_nAdd); if (!m_name1.IsEmpty()) name = m_name1 + ","; name += m_name2; name.TrimRight(","); m_phone1 = m_List4.GetItemText(i, 3 + m_nAdd); m_phone2 = m_List4.GetItemText(i, 4 + m_nAdd); #ifdef CHILD_VERSION m_phone1 = m_List4.GetItemText(i, 3 + m_nAdd); m_phone2 = m_List4.GetItemText(i, 4 + m_nAdd); #endif if (!m_phone1.IsEmpty()) phone = m_phone1 + ","; phone += m_phone2; phone.TrimRight(","); Listarray.ElementAt(pos).Add(name + "/" + phone); Listarray.ElementAt(pos).Add(m_List4.GetItemText(i, 5 + m_nAdd) + "/" + m_List4.GetItemText(i, 6 + m_nAdd)); Listarray.ElementAt(pos).Add(m_List4.GetItemText(i, 10 + nChild + m_nAdd)); Listarray.ElementAt(pos).Add(m_List4.GetItemText(i, 9 + nChild + m_nAdd)); Listarray.ElementAt(pos).Add(m_List4.GetItemText(i, 11 + nChild + m_nAdd)); pos++; } Listarray.SetSize(pos, 1); g_pMainWnd->PrintTakeForm4(&Listarray); } void TodayForm::OnBUTtakeaway5() { CArrayListarray; CString name, m_name1, m_name2; CString phone, m_phone1, m_phone2; int count = m_List5.GetItemCount() / 45; if (m_List5.GetItemCount() % 45)count++; Listarray.SetSize(m_List5.GetItemCount() + count, 1); int pos = 0; int aa = 0; for (int i = 0; i < m_List5.GetItemCount(); i++) { CString date = m_List5.GetItemText(i, 7 + m_nAdd); if (!(date.GetLength() == 10 && date >= m_date1 && date <= m_date2))continue; if (aa % 45 == 0) { Listarray.ElementAt(pos).Add("客人/电话"); Listarray.ElementAt(pos).Add("婚庆内容"); Listarray.ElementAt(pos).Add("日期/时间"); Listarray.ElementAt(pos).Add("服务人员"); Listarray.ElementAt(pos).Add("服务人员2"); Listarray.ElementAt(pos).Add("套系"); Listarray.ElementAt(pos).Add("门市"); pos++; } aa++; name = ""; phone = ""; int idpos = i; while (m_List5.GetItemText(idpos, 0 + m_nAdd) == "") idpos--; m_name1 = m_List5.GetItemText(idpos, 1 + m_nAdd); m_name2 = m_List5.GetItemText(idpos, 2 + m_nAdd); if (!m_name1.IsEmpty()) name = m_name1 + ","; name += m_name2; name.TrimRight(","); m_phone1 = m_List5.GetItemText(idpos, 3 + m_nAdd); m_phone2 = m_List5.GetItemText(idpos, 4 + m_nAdd); if (!m_phone1.IsEmpty()) phone = m_phone1 + ","; phone += m_phone2; phone.TrimRight(","); Listarray.ElementAt(pos).Add(name + "/" + phone); Listarray.ElementAt(pos).Add(m_List5.GetItemText(i, 6 + m_nAdd)); Listarray.ElementAt(pos).Add(m_List5.GetItemText(i, 7 + m_nAdd) + "/" + m_List5.GetItemText(i, 8 + m_nAdd)); Listarray.ElementAt(pos).Add(m_List5.GetItemText(i, 9 + m_nAdd)); Listarray.ElementAt(pos).Add(m_List5.GetItemText(i, 10 + m_nAdd)); Listarray.ElementAt(pos).Add(m_List5.GetItemText(idpos, 14 + m_nAdd)); Listarray.ElementAt(pos).Add(m_List5.GetItemText(idpos, 13 + m_nAdd)); pos++; } Listarray.SetSize(pos, 1); g_pMainWnd->PrintTakeForm5(&Listarray); } void TodayForm::OnDblclkList8(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here OnBUTchoose(); *pResult = 0; } /************************************************************************/ /* */ /************************************************************************/ void TodayForm::DealChildBrithday( IN const int& nCheckDays, IN int& nItemSize, IN CString strCustomerKind, IN CTime& tmOftoday, IN CArray& AryOfCustomer) { CString strCustomer; CString strSex; CString strBirthday; CString strPhone; CString strDifDays; BOOL bBirthdayKind = FALSE; int nSize = AryOfCustomer.GetSize(); for (int i = 0; i < nSize; i++) { CStringArray &SubAry = AryOfCustomer.ElementAt(i); if (strCustomerKind == _T("订单客户")) { strSex = SubAry.ElementAt(9); strBirthday = SubAry.ElementAt(7); bBirthdayKind = atoi(SubAry.ElementAt(11)); strCustomer = SubAry.ElementAt(1) + _T(",") + SubAry.ElementAt(2); strPhone = SubAry.ElementAt(3); } else if (strCustomerKind == _T("老客户")) { strSex = SubAry.ElementAt(3); strBirthday = SubAry.ElementAt(6); bBirthdayKind = atoi(SubAry.ElementAt(14)); strCustomer = SubAry.ElementAt(1) + _T(",") + SubAry.ElementAt(2); strPhone = SubAry.ElementAt(4); } else if (strCustomerKind == _T("意向客户")) { strSex = SubAry.ElementAt(2); strBirthday = SubAry.ElementAt(9); bBirthdayKind = atoi(SubAry.ElementAt(13)); strCustomer = SubAry.ElementAt(1) + _T(",") + SubAry.ElementAt(1); strPhone = SubAry.ElementAt(3); } else if ( strCustomerKind == _T("会员客户")) { // 会员; strSex = SubAry.ElementAt(3); strBirthday = SubAry.ElementAt(8); bBirthdayKind = 0; strCustomer = SubAry.ElementAt(2); strPhone = SubAry.ElementAt(4); } else if ( strCustomerKind.Find(_T("医院客户")) != -1 ) { BOOL bChild = !_ttoi(SubAry.ElementAt(6)); if ( bChild && m_radio2 != 3 ) {// 儿童生日; strSex = SubAry.ElementAt(4); strBirthday = SubAry.ElementAt(7); strCustomer = SubAry.ElementAt(2); bBirthdayKind = _ttoi(SubAry.ElementAt(5)); strPhone = SubAry.ElementAt(17); strCustomerKind = _T("医院客户儿童"); } else if ( !bChild && m_radio2 == 3 ) {// 孕妇预产期; strSex = _T("女"); strBirthday = SubAry.ElementAt(7); strCustomer = SubAry.ElementAt(1); bBirthdayKind = _ttoi(SubAry.ElementAt(5)); strPhone = SubAry.ElementAt(17); strCustomerKind = _T("医院客户孕妇"); strCustomer.TrimLeft(_T(",")); strCustomer.TrimRight(_T(",")); DealChildDate(nCheckDays, nItemSize, strCustomerKind, strCustomer, strSex, strBirthday, strPhone, bBirthdayKind, tmOftoday); continue; } else { continue; } } strCustomer.TrimLeft(_T(",")); strCustomer.TrimRight(_T(",")); DealChildDate(nCheckDays, nItemSize, strCustomerKind, strCustomer, strSex, strBirthday, strPhone, bBirthdayKind, tmOftoday); } } void TodayForm::DealChildDate( IN const int& nCheckDays, IN int &nItemIndex, IN CString &strCustomerType, IN CString &strCustomer, IN CString strSex, IN CString& strBirthday, IN CString& strPhone, IN BOOL bDateType, IN CTime& tmOftoday) { // 判断日期是否有效; CString strBirthdayBak = strBirthday; if (bDateType) {// 农历生日类型; if ( m_radio2 == 1 || m_radio2 == 2 ) // 百天和满月只计算今年的; { if (!IsValidLunanrDate(strBirthday))return; strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(_ttoi(strBirthday.Left(4)), _ttoi(strBirthday.Mid(5, 2)), _ttoi(strBirthday.Mid(8, 2))); } else { strBirthday.Format("%04d-%02d-%02d",tmOftoday.GetYear(), _ttoi(strBirthdayBak.Mid(5, 2)), _ttoi(strBirthdayBak.Mid(8, 2))); if (!IsValidLunanrDate(strBirthday))return; strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(tmOftoday.GetYear(), _ttoi(strBirthday.Mid(5, 2)), _ttoi(strBirthday.Mid(8, 2))); } if ( tmOftoday.GetYear() < _ttoi(strBirthday.Left(4)) ) {// 超过1年日期; return; } if ( strBirthday == _T("1900-01-01") ) {// 没有找到该农历日期; // 排除大月30号出生,但是今年只有小月29号; if ( m_radio2 == 1 || m_radio2 == 2 ) // 百天和满月只计算今年的; strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(_ttoi(strBirthday.Left(4)), _ttoi(strBirthdayBak.Mid(5, 2)), _ttoi(strBirthdayBak.Mid(8, 2)) - 1 ); else strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(tmOftoday.GetYear(), _ttoi(strBirthdayBak.Mid(5, 2)), _ttoi(strBirthdayBak.Mid(8, 2)) - 1 ); if ( strBirthday == _T("1900-01-01") ) {// 仍然是不存在,则可能日期是乱写的; return; } } } else {// 公历生日类型; if (!IsValidDate(strBirthday))return; } int ndays = -1; CString strDays; int nMemorialYear = 0; if ( m_radio2 == 0 ) { // 生日; strBirthday = g_date.Left(4) + strBirthday.Right(6); CTime tm = GetTmFromStr(strBirthday); CTimeSpan dt = tm - tmOftoday; ndays = dt.GetDays(); strDays.Format(_T("%d天后生日"), ndays); if (ndays == 0)strDays = _T("今天生日"); } else if (m_radio2 == 1) { // 满月; CTime tm = GetTmFromStr(strBirthday); int year = tm.GetYear(); int month = tm.GetMonth(); int day = tm.GetDay(); tm += CTimeSpan(28, 0, 0, 0); while (1) { if (tm.GetDay() >= day && (tm.GetMonth() == month + 1 || tm.GetYear() == year + 1))break; if (tm.GetMonth() > month + 1) { tm -= CTimeSpan(1, 0, 0, 0); break; } tm += CTimeSpan(1, 0, 0, 0); } CTimeSpan dt = tm - tmOftoday; ndays = dt.GetDays(); strDays.Format(_T("%d天后满月"), ndays); if (ndays == 0)strDays = _T("今天满月"); } else if (m_radio2 == 2) { // 百天; CTime tm = GetTmFromStr(strBirthday); tm += CTimeSpan(100, 0, 0, 0); CTimeSpan dt = tm - tmOftoday; ndays = dt.GetDays(); strDays.Format(_T("%d天后满100天"), ndays); if (ndays == 0)strDays = _T("今天满100天"); } else if ( m_radio2 == 3 ) {// 医院宝宝生日或孕妇预产期; if ( strCustomerType == _T("医院客户孕妇")) { CTime tm = GetTmFromStr(strBirthday); CTimeSpan dt = tm - tmOftoday; ndays = dt.GetDays(); strDays.Format(_T("%d天后预产期"), ndays); if (ndays == 0)strDays = _T("今天预产期"); } } if (ndays < nCheckDays && ndays >= 0 && strCustomer != _T("")) { m_List6array.SetSize(nItemIndex + 1, 1); m_List6array.ElementAt(nItemIndex).Add(strCustomer); m_List6array.ElementAt(nItemIndex).Add(strSex); m_List6array.ElementAt(nItemIndex).Add(strBirthdayBak); if (bDateType) m_List6array.ElementAt(nItemIndex).Add(_T("农历")); else m_List6array.ElementAt(nItemIndex).Add(_T("公历")); m_List6array.ElementAt(nItemIndex).Add(strCustomerType); m_List6array.ElementAt(nItemIndex).Add(strPhone); m_List6array.ElementAt(nItemIndex).Add(strDays); nItemIndex++; } } /************************************************************************/ /* 函数:[3/2/2016 IT]; /* 描述:; /* 参数:; /* [IN] :; /* [OUT] :; /* [IN/OUT] :; /* 返回:void; /* 注意:; /* 示例:; /* /* 修改:; /* 日期:; /* 内容:; /************************************************************************/ void TodayForm::DealWeddingBrithday( IN const int& nCheckDays, IN int& nItemSize, IN CString strCustomerKind, IN CTime& tmOftoday, IN CArray& AryOfCustomer) { CString strCustomer; CString strSex; CString strBirthday; CString strPhone; CString strDifDays; BOOL bBirthdayKind = FALSE; int nSize = AryOfCustomer.GetSize(); for (int i = 0; i < nSize; i++) { CStringArray &SubAry = AryOfCustomer.ElementAt(i); ////////////////////////////////////////////////////////////////////////// // 男宾; if (strCustomerKind == _T("订单客户")) { strCustomer = SubAry.ElementAt(0); strPhone = SubAry.ElementAt(2); strBirthday = SubAry.ElementAt(5); bBirthdayKind = atoi(SubAry.ElementAt(10)); if (m_radio2 == 1 || m_radio2 == 2) { strBirthday = SubAry.ElementAt(4); // 婚期日期; bBirthdayKind = atoi(SubAry.ElementAt(12)); } DealWeddingDate( nCheckDays, nItemSize, strCustomerKind, strCustomer, _T("男"), strBirthday, strPhone, bBirthdayKind, tmOftoday); } else if (strCustomerKind == _T("老客户")) { strCustomer = SubAry.ElementAt(1); strPhone = SubAry.ElementAt(3); strBirthday = SubAry.ElementAt(7); bBirthdayKind = atoi(SubAry.ElementAt(17)); if (m_radio2 == 1 || m_radio2 == 2) { strBirthday = SubAry.ElementAt(9); // 婚期日期; bBirthdayKind = atoi(SubAry.ElementAt(19)); } DealWeddingDate(nCheckDays, nItemSize, strCustomerKind, strCustomer, _T("男"), strBirthday, strPhone, bBirthdayKind, tmOftoday); } else if (strCustomerKind == _T("意向客户")) { strSex = SubAry.ElementAt(2); strCustomer = SubAry.ElementAt(1); strPhone = SubAry.ElementAt(3); strBirthday = SubAry.ElementAt(9); bBirthdayKind = atoi(SubAry.ElementAt(13)); if (m_radio2 == 1 || m_radio2 == 2) { return; } DealWeddingDate(nCheckDays, nItemSize, strCustomerKind, strCustomer, strSex, strBirthday, strPhone, bBirthdayKind, tmOftoday); } else { strSex = SubAry.ElementAt(3); strCustomer = SubAry.ElementAt(2); strPhone = SubAry.ElementAt(4); strBirthday = SubAry.ElementAt(8); bBirthdayKind = 0; if (m_radio2 == 1 || m_radio2 == 2) { return; } DealWeddingDate(nCheckDays, nItemSize, strCustomerKind, strCustomer, strSex, strBirthday, strPhone, bBirthdayKind, tmOftoday); } ////////////////////////////////////////////////////////////////////////// // 女宾; if (strCustomerKind == _T("订单客户")) { strCustomer = SubAry.ElementAt(1); strPhone = SubAry.ElementAt(3); strBirthday = SubAry.ElementAt(6); bBirthdayKind = atoi(SubAry.ElementAt(11)); if (m_radio2 == 1 || m_radio2 == 2) { strBirthday = SubAry.ElementAt(4); // 婚期日期; bBirthdayKind = atoi(SubAry.ElementAt(12)); } DealWeddingDate(nCheckDays, nItemSize, strCustomerKind, strCustomer, _T("女"), strBirthday, strPhone, bBirthdayKind, tmOftoday); } else if (strCustomerKind == _T("老客户")) { strCustomer = SubAry.ElementAt(2); strPhone = SubAry.ElementAt(4); strBirthday = SubAry.ElementAt(8); bBirthdayKind = atoi(SubAry.ElementAt(18)); if (m_radio2 == 1 || m_radio2 == 2) { strBirthday = SubAry.ElementAt(9); // 婚期日期; bBirthdayKind = atoi(SubAry.ElementAt(19)); } DealWeddingDate(nCheckDays, nItemSize, strCustomerKind, strCustomer, _T("女"), strBirthday, strPhone, bBirthdayKind, tmOftoday); } } } /************************************************************************/ /* 函数:[3/2/2016 IT]; /* 描述:; /* 参数:; /* [IN] :; /* [OUT] :; /* [IN/OUT] :; /* 返回:void; /* 注意:; /* 示例:; /* /* 修改:; /* 日期:; /* 内容:; /************************************************************************/ void TodayForm::DealWeddingDate( IN const int& nCheckDays, IN int &nItemIndex, IN CString &strCustomerType, IN CString &strCustomer, IN CString strSex, IN CString& strBirthday, IN CString& strPhone, IN BOOL bDateType, IN CTime& tmOftoday) { // 判断日期是否有效; CString strBirthdayBak = strBirthday; if (bDateType) { if ( m_radio2 == 1 ) // 结婚当天; { if (!IsValidLunanrDate(strBirthday))return; strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(_ttoi(strBirthday.Left(4)), _ttoi(strBirthday.Mid(5, 2)), _ttoi(strBirthday.Mid(8, 2))); } else { strBirthday.Format(_T("%04d-%02d-%02d"),tmOftoday.GetYear(), _ttoi(strBirthday.Mid(5, 2)), _ttoi(strBirthday.Mid(8, 2))); if (!IsValidLunanrDate(strBirthday))return; strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(tmOftoday.GetYear(), _ttoi(strBirthday.Mid(5, 2)), _ttoi(strBirthday.Mid(8, 2))); } if ( tmOftoday.GetYear() < _ttoi(strBirthday.Left(4)) ) {// 超过1年日期; return; } if ( strBirthday == _T("1900-01-01") ) {// 没有找到该农历日期; // 排除大月30号出生,但是今年只有小月29号; strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(tmOftoday.GetYear(), _ttoi(strBirthdayBak.Mid(5, 2)), _ttoi(strBirthdayBak.Mid(8, 2)) - 1 ); if ( strBirthday == _T("1900-01-01") ) {// 仍然是不存在,则可能日期是乱写的; return; } } } else { if (!IsValidDate(strBirthday))return; strBirthday.Format(_T("%04d-%s-%s"), tmOftoday.GetYear(), strBirthday.Mid(5, 2), strBirthday.Mid(8, 2)); } int ndays = -1; CString strDays; int nMemorialYear = 0; if (m_radio2 == 1) // 当天结婚; { CTime tm = GetTmFromStr(strBirthday); CTimeSpan dt = tm - tmOftoday; ndays = dt.GetDays(); if ( ndays < 0 ) return; strDays.Format(_T("%d天后结婚"), ndays); if (ndays == 0) strDays = _T("今天结婚"); } else if (m_radio2 == 2) // 结婚纪念日; { if (g_date.Left(4) <= strBirthday.Left(4)) return; strBirthday = g_date.Left(4) + strBirthday.Right(6); CTime tm = GetTmFromStr(strBirthday); CTimeSpan dt = tm - tmOftoday; ndays = dt.GetDays(); if ( ndays < 0 ) return; nMemorialYear = atoi(g_date.Left(4)) - atoi(strBirthdayBak.Left(4)); strDays.Format(_T("%d天后%d周年结婚纪念日"), ndays, nMemorialYear); if (ndays == 0) strDays.Format(_T("今天%d周年结婚纪念日"), nMemorialYear); } else // 生日; { strBirthday = g_date.Left(4) + strBirthday.Right(6); CTime tm = GetTmFromStr(strBirthday); CTimeSpan dt = tm - tmOftoday; ndays = dt.GetDays(); if ( ndays < 0 ) return; strDays.Format(_T("%d天后生日"), ndays); if (ndays == 0) strDays = _T("今天生日"); } if (ndays < nCheckDays && ndays >= 0 && strCustomer != _T("")) { m_List6array.SetSize(nItemIndex + 1, 1); m_List6array.ElementAt(nItemIndex).Add(strCustomer); m_List6array.ElementAt(nItemIndex).Add(strSex); m_List6array.ElementAt(nItemIndex).Add(strBirthdayBak); if (bDateType) m_List6array.ElementAt(nItemIndex).Add(_T("农历")); else m_List6array.ElementAt(nItemIndex).Add(_T("公历")); m_List6array.ElementAt(nItemIndex).Add(strCustomerType); m_List6array.ElementAt(nItemIndex).Add(strPhone); m_List6array.ElementAt(nItemIndex).Add(strDays); nItemIndex++; } }