void CEMStatisticsMajorDiseasesReport::OnReportPeriodSelendok() { CString tmpStr; CDate dte; UpdateData(true); int nMonth = ToInt(m_szReportPeriodKey); if(nMonth > 0 && nMonth <= 12) { m_szFromDate.Format(_T("%.4d/%.2d/01"), m_nYear, nMonth); dte.ParseDate(m_szFromDate); m_szToDate.Format(_T("%.4d/%.2d/%.2d 23:59"), m_nYear, nMonth, dte.GetMonthLastDay()); } if(nMonth == 13) { m_szFromDate.Format(_T("%.4d/01/01"), m_nYear); tmpStr.Format(_T("%.4d/03/01"), m_nYear); dte.ParseDate(tmpStr); m_szToDate.Format(_T("%.4d/03/%.2d 23:59" ), m_nYear, dte.GetMonthLastDay()); } if(nMonth == 14) { m_szFromDate.Format(_T("%.4d/04/01"), m_nYear); tmpStr.Format(_T("%.4d/06/01"), m_nYear); dte.ParseDate(tmpStr); m_szToDate.Format(_T("%.4d/06/%.2d 23:59"), m_nYear, dte.GetMonthLastDay()); } if(nMonth == 15) { m_szFromDate.Format(_T("%.4d/07/01"), m_nYear); tmpStr.Format(_T("%.4d/09/01"), m_nYear); dte.ParseDate(tmpStr); m_szToDate.Format(_T("%.4d/09/%.2d 23:59"), m_nYear, dte.GetMonthLastDay()); } if(nMonth == 16) { m_szFromDate.Format(_T("%.4d/10/01"), m_nYear); tmpStr.Format(_T("%.4d/10/01"), m_nYear); dte.ParseDate(tmpStr); m_szToDate.Format(_T("%.4d/12/%.2d 23:59"), m_nYear, dte.GetMonthLastDay()); } if(nMonth == 17) { m_szFromDate.Format(_T("%.4d/01/01"), m_nYear); tmpStr.Format(_T("%.4d/12/01"), m_nYear); dte.ParseDate(tmpStr); m_szToDate.Format(_T("%.4d/12/%.2d 23:59"), m_nYear, dte.GetMonthLastDay()); } UpdateData(false); }
void CEMOperationFosteringListC12::OnSetWindowEvents(){ CMainFrame_E10 *pMF = (CMainFrame_E10*) AfxGetMainWnd(); //m_wndYear.SetEvent(WE_CHANGE, _OnYearChangeFnc); //m_wndYear.SetEvent(WE_SETFOCUS, _OnYearSetfocusFnc); //m_wndYear.SetEvent(WE_KILLFOCUS, _OnYearKillfocusFnc); m_wndYear.SetEvent(WE_CHECKVALUE, _OnYearCheckValueFnc); m_wndReportPeriod.SetEvent(WE_SELENDOK, _OnReportPeriodSelendokFnc); //m_wndReportPeriod.SetEvent(WE_SETFOCUS, _OnReportPeriodSetfocusFnc); //m_wndReportPeriod.SetEvent(WE_KILLFOCUS, _OnReportPeriodKillfocusFnc); m_wndReportPeriod.SetEvent(WE_SELCHANGE, _OnReportPeriodSelectChangeFnc); m_wndReportPeriod.SetEvent(WE_LOADDATA, _OnReportPeriodLoadDataFnc); //m_wndReportPeriod.SetEvent(WE_ADDNEW, _OnReportPeriodAddNewFnc); m_wndObject.SetEvent(WE_SELENDOK, _OnObjectSelendokFnc); //m_wndObject.SetEvent(WE_SETFOCUS, _OnObjectSetfocusFnc); //m_wndObject.SetEvent(WE_KILLFOCUS, _OnObjectKillfocusFnc); m_wndObject.SetEvent(WE_SELCHANGE, _OnObjectSelectChangeFnc); m_wndObject.SetEvent(WE_LOADDATA, _OnObjectLoadDataFnc); //m_wndObject.SetEvent(WE_ADDNEW, _OnObjectAddNewFnc); //m_wndFromDate.SetEvent(WE_CHANGE, _OnFromDateChangeFnc); //m_wndFromDate.SetEvent(WE_SETFOCUS, _OnFromDateSetfocusFnc); //m_wndFromDate.SetEvent(WE_KILLFOCUS, _OnFromDateKillfocusFnc); m_wndFromDate.SetEvent(WE_CHECKVALUE, _OnFromDateCheckValueFnc); //m_wndToDate.SetEvent(WE_CHANGE, _OnToDateChangeFnc); //m_wndToDate.SetEvent(WE_SETFOCUS, _OnToDateSetfocusFnc); //m_wndToDate.SetEvent(WE_KILLFOCUS, _OnToDateKillfocusFnc); m_wndToDate.SetEvent(WE_CHECKVALUE, _OnToDateCheckValueFnc); m_wndPrintPreview.SetEvent(WE_CLICK, _OnPrintPreviewSelectFnc); m_wndExport.SetEvent(WE_CLICK, _OnExportSelectFnc); CDate dte; dte.ParseDate(pMF->GetSysDate()); m_szFromDate = m_szToDate = pMF->GetSysDate(); m_szFromDate += _T("00:00"); m_szToDate += _T("23:59"); m_nYear = dte.GetYear(); m_szReportPeriodKey.Format(_T("%d"), dte.GetMonth()); UpdateData(false); }