// 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 "ChoosePhotoSkin2.h" #include "CalendarConvert.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; } 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_scrollbar); DDX_Control(pDX, IDC_LIST10, m_List6); DDX_Control(pDX, IDC_LIST8, m_List5); DDX_Control(pDX, IDC_LIST7, m_List4); DDX_Control(pDX, IDC_LIST4, m_List3); DDX_Control(pDX, IDC_LIST3, m_List2); DDX_Control(pDX, IDC_LIST2, m_List1); DDX_Control(pDX, IDC_SPIN3, m_spinday); DDX_Control(pDX, IDC_SPIN2, m_spinmonth); DDX_Control(pDX, IDC_SPIN1, m_spinyear); DDX_Control(pDX, IDC_STATIC1, m_static1); DDX_Text(pDX, IDC_EDITyear, m_year); DDV_MinMaxUInt(pDX, m_year, 1900, 3000); DDX_Text(pDX, IDC_EDITmonth, m_month); DDV_MinMaxUInt(pDX, m_month, 1, 12); DDX_Text(pDX, IDC_EDITday, m_day); DDV_MinMaxUInt(pDX, m_day, 1, 31); DDX_Radio(pDX, IDC_RADIO3, m_radio); DDX_Check(pDX, IDC_CHECK1, m_check); DDX_Check(pDX, IDC_CHECK2, m_check2); DDX_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_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_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); 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-=20; CRect rc=rc2; rc2.top+=30; rc2.bottom+=256*19-30; m_childdlg.List1array=&m_List7array; // m_childdlg.pClientarray=&m_Clientarray; // m_childdlg.pTxtypearray=&m_Txtypearray; m_childdlg.MoveWindow(rc2); m_childdlg.ShowWindow(SW_SHOW); m_bInit=1; // DateChange(); rc2.top-=30; rc2.right+=20; rc2.left=rc2.right-20; rc2.bottom-=256*19-30; m_scrollbar.MoveWindow(rc2); rc.bottom=rc.top+30; m_table.Create(rc, this, WS_HSCROLL); m_table.m_bFocusFrame=0; m_table.Test2 (); m_page=rc2.Height ()-40; m_scrollbar.SetScrollRange(0,256*20); m_scrollbar.SetScrollPos(0); if(1) { // m_childdlg.m_table.ModeChange(10); // m_table.ModeChange(10); // m_table.Test2 (); // m_table.ShowWindow(SW_SHOW); // m_childdlg.ShowWindow(SW_SHOW); m_combo1.m_mode=1; m_combo1.m_pMsgParent=&(m_childdlg.m_table); m_childdlg.m_table.m_pComboBox=&m_combo1; // m_scrollbar.ShowWindow(SW_SHOW); m_table.ShowWindow(SW_HIDE); m_childdlg.ShowWindow(SW_HIDE); m_scrollbar.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_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; iiSendMessage(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(0) { CTime tm=GetTmFromStr("1512-00-12"); CString ss; ss.Format ("%d-%d-%d", tm.GetYear (), tm.GetMonth (), tm.GetDay ()); MessageBox(ss); return ; } 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); } 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_scrollbar.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); } 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); } 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(); int temp=m_nscrollpos; int nscrollpos=m_scrollbar.GetScrollPos(); m_nscrollpos=0; m_scrollbar.SetScrollPos(m_nscrollpos); m_childdlg.ScrollWindow(0, temp-m_nscrollpos); } else if(m_radio==5) // 近期生日; { m_List6array.RemoveAll(); CString today=g_date; CString todaynl=g_date; 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; g_sendhead.tabcount=3; g_sendhead.bsql=0; g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return; CArrayList1array; CArrayList2array; CArrayList3array; DataToArray(&List1array, &List2array, &List3array); clienttype="订单客户"; int size=0; #ifdef CHILD_VERSION try { for(int i=0; i=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-todaytm; ndays=dt.GetDays(); days.Format("%d天后满月", ndays); if(ndays==0) days="今天满月"; } else if(m_radio2==2) { CTime tm=GetTmFromStr(birthday);tm+=CTimeSpan(100, 0, 0, 0); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后满100天", ndays); if(ndays==0) days="今天满100天"; } else { birthday=today.Left(4)+birthday.Right(6); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后生日", ndays); if(ndays==0) days="今天生日"; } } else if(birthday.GetLength()==10) { if(m_radio2==1) { CString birthdaynl=birthday; int year=atoi(birthdaynl.Mid (0,4)); int month= atoi(birthdaynl.Mid (5,2)); int day= atoi(birthdaynl.Mid (8,2)); CovertDate3(birthday); CTime tm=GetTmFromStr(birthday); tm+=CTimeSpan(28, 0, 0, 0); while(1) { birthday=tm.Format ("%Y-%m-%d"); CovertDate2(birthday);//转为农历 if(atoi(birthday.Mid (8,2)) >=day && (atoi(birthday.Mid (5,2))==month+1 || atoi(birthday.Mid (0,4))==year+1) )break; if( atoi(birthday.Mid (5,2))>month+1) { tm-=CTimeSpan(1, 0, 0, 0); break; } tm+=CTimeSpan(1, 0, 0, 0); } CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后满月", ndays); if(ndays==0) days="今天满月"; } else if(m_radio2==2) { CovertDate3(birthday); CTime tm=GetTmFromStr(birthday);tm+=CTimeSpan(100, 0, 0, 0); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后满100天", ndays); if(ndays==0) days="今天满100天"; } else { birthday=todaynl.Left(4)+birthday.Right(6); CovertDate3(birthday); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后生日", ndays); if(ndays==0) days="今天生日"; } } if(ndays=0 && name!="") { m_List6array.SetSize( size+1, 1 ); m_List6array.ElementAt (size).Add(name); m_List6array.ElementAt (size).Add(sex); m_List6array.ElementAt (size).Add(birthdaybak); if(checknl) m_List6array.ElementAt (size).Add("农历"); else m_List6array.ElementAt (size).Add("公历"); m_List6array.ElementAt (size).Add(clienttype); m_List6array.ElementAt (size).Add(phone); m_List6array.ElementAt (size).Add(days); size++; } } } catch(...) { MessageBox(name+birthday); } clienttype="老客户"; for(int i=0; i=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-todaytm; ndays=dt.GetDays(); days.Format("%d天后满月", ndays); if(ndays==0) days="今天满月"; } else if(m_radio2==2) { CTime tm=GetTmFromStr(birthday);tm+=CTimeSpan(100, 0, 0, 0); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后满100天", ndays); if(ndays==0) days="今天满100天"; } else { birthday=today.Left(4)+birthday.Right(6); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后生日", ndays); if(ndays==0) days="今天生日"; } } else if(birthday.GetLength()==10) { if(m_radio2==1) { CString birthdaynl=birthday; int year=atoi(birthdaynl.Mid (0,4)); int month= atoi(birthdaynl.Mid (5,2)); int day= atoi(birthdaynl.Mid (8,2)); CovertDate3(birthday); CTime tm=GetTmFromStr(birthday); tm+=CTimeSpan(28, 0, 0, 0); while(1) { birthday=tm.Format ("%Y-%m-%d"); CovertDate2(birthday);//转为农历 if(atoi(birthday.Mid (8,2)) >=day && (atoi(birthday.Mid (5,2))==month+1 || atoi(birthday.Mid (0,4))==year+1) )break; if( atoi(birthday.Mid (5,2))>month+1) { tm-=CTimeSpan(1, 0, 0, 0); break; } tm+=CTimeSpan(1, 0, 0, 0); } CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后满月", ndays); if(ndays==0) days="今天满月"; } else if(m_radio2==2) { CovertDate3(birthday); CTime tm=GetTmFromStr(birthday);tm+=CTimeSpan(100, 0, 0, 0); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后满100天", ndays); if(ndays==0) days="今天满100天"; } else { birthday=todaynl.Left(4)+birthday.Right(6); CovertDate3(birthday); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后生日", ndays); if(ndays==0) days="今天生日"; } } if(ndays=0) { m_List6array.SetSize( size+1, 1 ); m_List6array.ElementAt (size).Add(name); m_List6array.ElementAt (size).Add(sex); m_List6array.ElementAt (size).Add(birthdaybak); if(checknl) m_List6array.ElementAt (size).Add("农历"); else m_List6array.ElementAt (size).Add("公历"); m_List6array.ElementAt (size).Add(clienttype); m_List6array.ElementAt (size).Add(phone); m_List6array.ElementAt (size).Add(days); size++; } } clienttype="意向客户"; for( i=0; i=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-todaytm; ndays=dt.GetDays(); days.Format("%d天后满月", ndays); if(ndays==0) days="今天满月"; } else if(m_radio2==2) { CTime tm=GetTmFromStr(birthday);tm+=CTimeSpan(100, 0, 0, 0); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后满100天", ndays); if(ndays==0) days="今天满100天"; } else { birthday=today.Left(4)+birthday.Right(6); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后生日", ndays); if(ndays==0) days="今天生日"; } } else if(birthday.GetLength()==10) { if(m_radio2==1) { CString birthdaynl=birthday; int year=atoi(birthdaynl.Mid (0,4)); int month= atoi(birthdaynl.Mid (5,2)); int day= atoi(birthdaynl.Mid (8,2)); CovertDate3(birthday); CTime tm=GetTmFromStr(birthday); tm+=CTimeSpan(28, 0, 0, 0); while(1) { birthday=tm.Format ("%Y-%m-%d"); CovertDate2(birthday);//转为农历 if(atoi(birthday.Mid (8,2)) >=day && (atoi(birthday.Mid (5,2))==month+1 || atoi(birthday.Mid (0,4))==year+1) )break; if( atoi(birthday.Mid (5,2))>month+1) { tm-=CTimeSpan(1, 0, 0, 0); break; } tm+=CTimeSpan(1, 0, 0, 0); } CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后满月", ndays); if(ndays==0) days="今天满月"; } else if(m_radio2==2) { CovertDate3(birthday); CTime tm=GetTmFromStr(birthday);tm+=CTimeSpan(100, 0, 0, 0); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后满100天", ndays); if(ndays==0) days="今天满100天"; } else { birthday=todaynl.Left(4)+birthday.Right(6); CovertDate3(birthday); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后生日", ndays); if(ndays==0) days="今天生日"; } } if(ndays=0) { m_List6array.SetSize( size+1, 1 ); m_List6array.ElementAt (size).Add(name); m_List6array.ElementAt (size).Add(sex); m_List6array.ElementAt (size).Add(birthdaybak); if(checknl) m_List6array.ElementAt (size).Add("农历"); else m_List6array.ElementAt (size).Add("公历"); m_List6array.ElementAt (size).Add(clienttype); m_List6array.ElementAt (size).Add(phone); m_List6array.ElementAt (size).Add(days); size++; } } #else//以下为婚纱版 int i; try { for( i=0; i=0 && name!="") { m_List6array.SetSize( size+1, 1 ); m_List6array.ElementAt (size).Add(name); m_List6array.ElementAt (size).Add(sex); m_List6array.ElementAt (size).Add(birthdaybak); if(checknl) m_List6array.ElementAt (size).Add("农历"); else m_List6array.ElementAt (size).Add("公历"); m_List6array.ElementAt (size).Add(clienttype); m_List6array.ElementAt (size).Add(phone); m_List6array.ElementAt (size).Add(days); size++; } sex="女"; name=List1array.ElementAt (i).ElementAt (1); phone=List1array.ElementAt (i).ElementAt (3); birthday=List1array.ElementAt (i).ElementAt (6); birthdaybak=birthday; checknl=atoi(List1array.ElementAt (i).ElementAt (11)); if(m_radio2==1 || m_radio2==2) { birthday=List1array.ElementAt (i).ElementAt (4); birthdaybak=birthday; checknl=atoi(List1array.ElementAt (i).ElementAt (12)); } ndays=-1; if(checknl==0 && birthday.GetLength()==10) { if(m_radio2==1) { CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后结婚", ndays); if(ndays==0) days="今天结婚"; } else if(m_radio2==2) { if(today.Left(4)<=birthday.Left (4))continue; birthday=today.Left(4)+birthday.Right(6); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后结婚纪念日", ndays); if(ndays==0) days="今天结婚纪念日"; } else { birthday=today.Left(4)+birthday.Right(6); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后生日", ndays); if(ndays==0) days="今天生日"; } } else if(birthday.GetLength()==10) { if(m_radio2==1) { CovertDate3(birthday); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后结婚", ndays); if(ndays==0) days="今天结婚"; } else if(m_radio2==2) { if(todaynl.Left(4)<=birthday.Left (4))continue; birthday=todaynl.Left(4)+birthday.Right(6); CovertDate3(birthday); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后结婚纪念日", ndays); if(ndays==0) days="今天结婚纪念日"; } else { birthday=todaynl.Left(4)+birthday.Right(6); CovertDate3(birthday); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后生日", ndays); if(ndays==0) days="今天生日"; } } if(ndays=0 && name!="") { m_List6array.SetSize( size+1, 1 ); m_List6array.ElementAt (size).Add(name); m_List6array.ElementAt (size).Add(sex); m_List6array.ElementAt (size).Add(birthdaybak); if(checknl) m_List6array.ElementAt (size).Add("农历"); else m_List6array.ElementAt (size).Add("公历"); m_List6array.ElementAt (size).Add(clienttype); m_List6array.ElementAt (size).Add(phone); m_List6array.ElementAt (size).Add(days); size++; } } } catch(...) { MessageBox(name+birthday); } clienttype="老客户"; for( i=0; i=0 && name!="") { m_List6array.SetSize( size+1, 1 ); m_List6array.ElementAt (size).Add(name); m_List6array.ElementAt (size).Add(sex); m_List6array.ElementAt (size).Add(birthdaybak); if(checknl) m_List6array.ElementAt (size).Add("农历"); else m_List6array.ElementAt (size).Add("公历"); m_List6array.ElementAt (size).Add(clienttype); m_List6array.ElementAt (size).Add(phone); m_List6array.ElementAt (size).Add(days); size++; } sex="女"; name=List2array.ElementAt (i).ElementAt (2); phone=List2array.ElementAt (i).ElementAt (4); birthday=List2array.ElementAt (i).ElementAt (8); birthdaybak=birthday; checknl=atoi(List2array.ElementAt (i).ElementAt (18)); if(m_radio2==1 || m_radio2==2) { birthday=List2array.ElementAt (i).ElementAt (9); birthdaybak=birthday; checknl=atoi(List2array.ElementAt (i).ElementAt (19)); } ndays=-1; if(checknl==0 && birthday.GetLength()==10) { if(m_radio2==1) { CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后结婚", ndays); if(ndays==0) days="今天结婚"; } else if(m_radio2==2) { if(today.Left(4)<=birthday.Left (4))continue; birthday=today.Left(4)+birthday.Right(6); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后结婚纪念日", ndays); if(ndays==0) days="今天结婚纪念日"; } else { birthday=today.Left(4)+birthday.Right(6); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后生日", ndays); if(ndays==0) days="今天生日"; } } else if(birthday.GetLength()==10) { if(m_radio2==1) { CovertDate3(birthday); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后结婚", ndays); if(ndays==0) days="今天结婚"; } else if(m_radio2==2) { if(todaynl.Left(4)<=birthday.Left (4))continue; birthday=todaynl.Left(4)+birthday.Right(6); CovertDate3(birthday); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后结婚纪念日", ndays); if(ndays==0) days="今天结婚纪念日"; } else { birthday=todaynl.Left(4)+birthday.Right(6); CovertDate3(birthday); CTime tm=GetTmFromStr(birthday); CTimeSpan dt=tm-todaytm; ndays=dt.GetDays(); days.Format("%d天后生日", ndays); if(ndays==0) days="今天生日"; } } if(ndays=0 && name!="") { m_List6array.SetSize( size+1, 1 ); m_List6array.ElementAt (size).Add(name); m_List6array.ElementAt (size).Add(sex); m_List6array.ElementAt (size).Add(birthdaybak); if(checknl) m_List6array.ElementAt (size).Add("农历"); else m_List6array.ElementAt (size).Add("公历"); m_List6array.ElementAt (size).Add(clienttype); m_List6array.ElementAt (size).Add(phone); m_List6array.ElementAt (size).Add(days); size++; } } clienttype="意向客户"; for( i=0; i=0) { m_List6array.SetSize( size+1, 1 ); m_List6array.ElementAt (size).Add(name); m_List6array.ElementAt (size).Add(sex); m_List6array.ElementAt (size).Add(birthdaybak); if(checknl) m_List6array.ElementAt (size).Add("农历"); else m_List6array.ElementAt (size).Add("公历"); m_List6array.ElementAt (size).Add(clienttype); m_List6array.ElementAt (size).Add(phone); m_List6array.ElementAt (size).Add(days); size++; } } #endif /* g_sendhead.bsql=0; g_sendhead.code[0]=135; g_sendhead.code[1]=136; g_sendhead.tabcount=2; CString sql; sql.Format ("time5>='"+strdate+"' and time5<='"+strdate2+"' and [status3]='未取'"); g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return; DataToArray(&m_List6array,&g_List1array); for(int i=0; i=0; i--) { if(m_List6array.ElementAt (i).ElementAt (4)=="已安排") m_List6array.RemoveAt(i); } qsort( static_cast(&m_List6array[0]), m_List6array.GetSize (), sizeof(m_List6array[0]), CompareByLabel3 ); */ } HidePrice(); FillGrid(); m_spinyear.EnableWindow(1); m_spinmonth.EnableWindow(1); m_spinday.EnableWindow(1); } void TodayForm::OnCheck1() { // TODO: Add your control notification handler code here UpdateData(); m_check2=0; UpdateData(false); DateChange(); } void TodayForm::OnCheck2() { // TODO: Add your control notification handler code here UpdateData(); m_check=0; UpdateData(false); DateChange(); } void TodayForm::OnChangeEDITyear() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the MyFormView::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. DateChange(); GetCalendarData(); // TODO: Add your control notification handler code here } void TodayForm::OnChangeEDITmonth() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the MyFormView::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. DateChange(); GetCalendarData(); // TODO: Add your control notification handler code here } void TodayForm::OnChangeEDITday() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the MyFormView::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. DateChange(); 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_scrollbar.ShowWindow(SW_SHOW); DateChange(); return; } m_table.ShowWindow(SW_HIDE); m_childdlg.ShowWindow(SW_HIDE); m_scrollbar.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); } 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_scrollbar.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); } 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); } } else { m_CalendarFrm.ShowWindow (SW_HIDE); } // if(m_bShowCalendar) // OnBUTall(); // else 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='" + strBeginTime + "' and bookingdate<='" + strEndofTime + "'"); 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(int i=0; i 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, "未知"); } m_List1array.ElementAt (i).InsertAt (3, m_List1array.ElementAt (i).ElementAt (28+m_nAdd2)); } #endif #ifdef ENTERPRISE_VERSION 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; int i = 0; for( i=-1; iOnDisconnect(); 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 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; iOnDisconnect(); 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; iOnDisconnect(); 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; jOnDisconnect(); 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; iOnDisconnect(); 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; jOnDisconnect(); 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; iOnDisconnect(); 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; jOnDisconnect(); g_bBranchModify=0;g_branchip=g_branchname=""; } void TodayForm::GetData5(CString strdate, CString strdate2)// 近期生日; {//MessageBox("fd"); 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; iOnDisconnect(); 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; jOnDisconnect(); g_bBranchModify=0;g_branchip=g_branchname=""; } void TodayForm::OnBUTtakeaway() // 打印; { // TODO: Add your control notification handler code here 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; CArrayarray2; CArrayarray3; CArrayarray4; CArrayarray5; 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; iSetWindowText("详情"); 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(); } //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; iPrintTakeForm1(&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; iPrintTakeForm2(&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; iPrintTakeForm3(&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; iPrintTakeForm4(&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_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; }