1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006 |
- // 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;
- }
- 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_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 (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;
- #if JEFF_TEST_ON
- g_sendhead.code[3] = 130; // 蓝钻会员;
- g_sendhead.code[4] = 68; // 现金子卡会员;
- #endif
- g_sendhead.tabcount = 5;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- if (g_bSendOK == 0)
- return;
- CArray<CStringArray, CStringArray>List1array;
- CArray<CStringArray, CStringArray>List2array;
- CArray<CStringArray, CStringArray>List3array;
- CArray<CStringArray, CStringArray>List4array;
- CArray<CStringArray, CStringArray>List5array;
- DataToArray(&List1array, &List2array, &List3array, &List4array, &List5array);
- clienttype = "订单客户";
- 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);
- #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_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<NMLVCUSTOMDRAW*>(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<NMLVCUSTOMDRAW*>(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<NMLVCUSTOMDRAW*>(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<NMLVCUSTOMDRAW*>(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<NMLVCUSTOMDRAW*>(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<NMLVCUSTOMDRAW*>(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;
- 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, "***");
- }
- 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 + "'");
- 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<void*>(&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 < 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, "未知");
- }
- m_List1array.ElementAt(i).InsertAt(3, m_List1array.ElementAt(i).ElementAt(28 + m_nAdd2));
- }
- #endif
- #ifdef ENTERPRISE_VERSION
- qsort(static_cast<void*>(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel8);
- qsort(static_cast<void*>(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel7);
- qsort(static_cast<void*>(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel5);
- #endif
- return;
- }
- //////////////数据汇总
- m_List1array.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] = 120;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)
- {
- failbrancharray.Add(branch);
- continue;
- }
- CArray<CStringArray, CStringArray>List1array;
- 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<void*>(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel8);
- qsort(static_cast<void*>(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel7);
- qsort(static_cast<void*>(&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;
- }
- CArray<CStringArray, CStringArray>List1array;
- 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;
- }
- CArray<CStringArray, CStringArray>List1array;
- 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;
- }
- CArray<CStringArray, CStringArray>List1array;
- 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;
- }
- CArray<CStringArray, CStringArray>List1array;
- 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;
- CArray<CStringArray, CStringArray>Listarray;
- 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;
- CArray<CStringArray, CStringArray>m_List1array;
- CArray<CStringArray, CStringArray>m_List2array;
- CArray<CStringArray, CStringArray>m_List3array;
- CArray<CStringArray, CStringArray>m_List4array;
- CArray<CStringArray, CStringArray>m_List5array;
- DataToArray(&m_List1array, &m_List2array, &m_List3array, &m_List4array, &m_List5array);
- CArray<int, int>array1; // Jeff:每日的拍照预约客人数量;
- CArray<int, int>array2; // Jeff:每日的选片客人数量;
- CArray<int, int>array3; // Jeff:......看样......;
- CArray<int, int>array4; // Jeff:......取件......;
- CArray<int, int>array5; // Jeff:......婚庆......;
- int pos;
- for (int i = 0; i < 32; i++)
- {
- array1.Add(0);
- array2.Add(0);
- array3.Add(0);
- array4.Add(0);
- array5.Add(0);
- }
- #if JEFF_TEST_ON // 2015-05-15
- // 要先过滤m_List1array中重复的项;
- for (i = 0; i < m_List1array.GetSize(); i++)
- {
- CStringArray &SubAry = m_List1array.ElementAt(i);
- int nSize = m_List1array.GetSize();
- for (int n = nSize-1; n > 0; n--)
- {
- if ( SubAry.ElementAt(0) == m_List1array.ElementAt(n).ElementAt(0) )
- {
- if( i != n )
- m_List1array.RemoveAt(n);
- }
- }
- }
- #endif
- 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();
- }
- //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()
- {
- CArray<CStringArray, CStringArray>Listarray;
- 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()
- {
- CArray<CStringArray, CStringArray>Listarray;
- 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()
- {
- CArray<CStringArray, CStringArray>Listarray;
- 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()
- {
- CArray<CStringArray, CStringArray>Listarray;
- 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()
- {
- CArray<CStringArray, CStringArray>Listarray;
- 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<CStringArray, CStringArray>& 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
- {
- // 会员;
- strSex = SubAry.ElementAt(3);
- strBirthday = SubAry.ElementAt(8);
- bBirthdayKind = 0;
- strCustomer = SubAry.ElementAt(2);
- strPhone = SubAry.ElementAt(4);
- }
- 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)
- {
- // 判断日期是否有效;
- if (bDateType)
- {
- if (!IsValidLunanrDate(strBirthday))return;
- strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(_ttoi(strBirthday.Left(4)), _ttoi(strBirthday.Mid(5, 2)), _ttoi(strBirthday.Mid(8, 2)));
- }
- else
- {
- if (!IsValidDate(strBirthday))return;
- }
- int ndays = -1;
- CString strDays;
- int nMemorialYear = 0;
- CString strBirthdayBak = strBirthday;
- 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
- {
- 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("今天生日");
- }
- 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++;
- }
- }
- /************************************************************************/
- /*
- */
- /************************************************************************/
- void TodayForm::DealWeddingBrithday(
- IN const int& nCheckDays,
- IN int& nItemSize,
- IN CString strCustomerKind,
- IN CTime& tmOftoday,
- IN CArray<CStringArray, CStringArray>& 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);
- }
- }
- }
- 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)
- {
- // 判断日期是否有效;
- if (bDateType)
- {
- if (!IsValidLunanrDate(strBirthday))return;
- strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(_ttoi(strBirthday.Left(4)), _ttoi(strBirthday.Mid(5, 2)), _ttoi(strBirthday.Mid(8, 2)));
- }
- else
- {
- if (!IsValidDate(strBirthday))return;
- }
- int ndays = -1;
- CString strDays;
- int nMemorialYear = 0;
- CString strBirthdayBak = strBirthday;
- if (m_radio2 == 1)
- {
- 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 == 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();
- 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();
- 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++;
- }
- }
|