TodayForm.cpp 130 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501
  1. // TodayForm.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "TodayForm.h"
  6. #include "MyMdi.H"
  7. #include "TakeControlDlg1.h"
  8. #include "TakeControlDlg2.h"
  9. #include "TakeControlDlg3.h"
  10. #include "TakeControlDlg4.h"
  11. #include "TakeControlDlg9.h"
  12. #include "SelMemberCardFund.h"
  13. #include "SendMsgDlg.h"
  14. #include "SearchTake.h"
  15. #include "SearchTake2.h"
  16. #include "SearchTake3.h"
  17. #include "SearchTake4.h"
  18. #include "SearchTake5.h"
  19. #include "ChoosePhotoSkin2.h"
  20. #include "CalendarConvert.h"
  21. #ifdef _DEBUG
  22. #define new DEBUG_NEW
  23. #undef THIS_FILE
  24. static char THIS_FILE[] = __FILE__;
  25. #endif
  26. CTime g_todaytm=CTime::GetCurrentTime ();
  27. int g_todayradio=0;
  28. int g_todaycheck=0;
  29. void CovertDate2(CString &date)//公历转农历
  30. {
  31. try
  32. {
  33. GongToLong(date);return;
  34. if(date=="2013-04-09")
  35. {
  36. date="2013-02-29";
  37. return;
  38. }
  39. CCalendarConvert m_CalendarConvert;
  40. SYSTEMTIME src = {0};
  41. SYSTEMTIME dst = {0};
  42. COleDateTime m_timeLunar(atoi(date.Mid (0,4)),atoi(date.Mid (5,2)),atoi(date.Mid (8,2)),0,0,0);
  43. COleDateTime m_timeGregorian;
  44. m_timeLunar.GetAsSystemTime ( src );
  45. BOOL bEmbolism = 0;
  46. if ( m_CalendarConvert.Gregorian2Lunar ( &src, &dst, &bEmbolism ) )
  47. {
  48. m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime ( &dst );
  49. date.Format ("%04d-%02d-%02d", m_timeGregorian.GetYear (), m_timeGregorian.GetMonth (), m_timeGregorian.GetDay ());
  50. if(m_timeGregorian.GetYear ()==-1)date="2000-13-32";
  51. }
  52. else
  53. {
  54. date="1980-01-01";
  55. }
  56. }
  57. catch(...)
  58. {
  59. date="1980-01-01";
  60. }
  61. }
  62. void CovertDate3(CString &date)//农历转公历
  63. {
  64. LongToGong(date);
  65. return;
  66. try
  67. {
  68. CCalendarConvert m_CalendarConvert;
  69. SYSTEMTIME src = {0};
  70. SYSTEMTIME dst = {0};
  71. COleDateTime m_timeLunar(atoi(date.Mid (0,4)),atoi(date.Mid (5,2)),atoi(date.Mid (8,2)),0,0,0);
  72. COleDateTime m_timeGregorian;
  73. m_timeLunar.GetAsSystemTime ( src );
  74. BOOL bEmbolism = 0;
  75. if ( m_CalendarConvert.Lunar2Gregorian ( &src, bEmbolism, &dst ) )
  76. {
  77. m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime ( &dst );
  78. date.Format ("%04d-%02d-%02d", m_timeGregorian.GetYear (), m_timeGregorian.GetMonth (), m_timeGregorian.GetDay ());
  79. if(m_timeGregorian.GetYear ()==-1)date="2000-13-32";
  80. }
  81. else
  82. date="1980-01-01";
  83. }
  84. catch(...)
  85. {
  86. date="1980-01-01";
  87. }
  88. /* bEmbolism = 1;
  89. if ( m_CalendarConvert.Lunar2Gregorian ( &src, bEmbolism, &dst ) )
  90. {
  91. m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime ( &dst );
  92. date.Format ("%04d-%02d-%02d", m_timeGregorian.GetYear (), m_timeGregorian.GetMonth (), m_timeGregorian.GetDay ());
  93. }*/
  94. }
  95. /////////////////////////////////////////////////////////////////////////////
  96. // TodayForm IDC_RADIO8
  97. IMPLEMENT_DYNCREATE(TodayForm, MyFormView)
  98. TodayForm::TodayForm()
  99. : MyFormView(TodayForm::IDD)
  100. {
  101. //{{AFX_DATA_INIT(TodayForm)
  102. m_check = FALSE;
  103. m_check2 = FALSE;
  104. m_radio2 = 0;
  105. m_nscrollpos = 0;
  106. //}}AFX_DATA_INIT
  107. m_mode=0;
  108. m_year = g_todaytm.GetYear ();
  109. m_month = g_todaytm.GetMonth ();
  110. m_day = g_todaytm.GetDay ();
  111. m_bInit=0;
  112. m_radio = 0;
  113. m_nAdd=0;
  114. if(g_bAllBranch==0)
  115. {
  116. m_radio = g_todayradio;
  117. if(g_todaycheck==1)
  118. m_check=1;
  119. else if(g_todaycheck==2)
  120. m_check2=1;
  121. }
  122. else
  123. {
  124. m_radio=g_bookingtype;
  125. m_nAdd=1;
  126. }
  127. m_bShowCalendar=1;
  128. m_nAdd2=0;
  129. }
  130. TodayForm::~TodayForm()
  131. {
  132. }
  133. void TodayForm::DoDataExchange(CDataExchange* pDX)
  134. {
  135. MyFormView::DoDataExchange(pDX);
  136. //{{AFX_DATA_MAP(TodayForm)
  137. DDX_Control(pDX, IDC_COMBO6, m_combo1);
  138. DDX_Control(pDX, IDC_SCROLLBAR1, m_scrollbar);
  139. DDX_Control(pDX, IDC_LIST10, m_List6);
  140. DDX_Control(pDX, IDC_LIST8, m_List5);
  141. DDX_Control(pDX, IDC_LIST7, m_List4);
  142. DDX_Control(pDX, IDC_LIST4, m_List3);
  143. DDX_Control(pDX, IDC_LIST3, m_List2);
  144. DDX_Control(pDX, IDC_LIST2, m_List1);
  145. DDX_Control(pDX, IDC_SPIN3, m_spinday);
  146. DDX_Control(pDX, IDC_SPIN2, m_spinmonth);
  147. DDX_Control(pDX, IDC_SPIN1, m_spinyear);
  148. DDX_Control(pDX, IDC_STATIC1, m_static1);
  149. DDX_Text(pDX, IDC_EDITyear, m_year);
  150. DDV_MinMaxUInt(pDX, m_year, 1900, 3000);
  151. DDX_Text(pDX, IDC_EDITmonth, m_month);
  152. DDV_MinMaxUInt(pDX, m_month, 1, 12);
  153. DDX_Text(pDX, IDC_EDITday, m_day);
  154. DDV_MinMaxUInt(pDX, m_day, 1, 31);
  155. DDX_Radio(pDX, IDC_RADIO3, m_radio);
  156. DDX_Check(pDX, IDC_CHECK1, m_check);
  157. DDX_Check(pDX, IDC_CHECK2, m_check2);
  158. DDX_Radio(pDX, IDC_RADIO9, m_radio2);
  159. DDX_Scroll(pDX, IDC_SCROLLBAR1, m_nscrollpos);
  160. //}}AFX_DATA_MAP
  161. }
  162. BEGIN_MESSAGE_MAP(TodayForm, MyFormView)
  163. //{{AFX_MSG_MAP(TodayForm)
  164. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  165. ON_BN_CLICKED(IDC_BUTtake, OnBUTtake)
  166. ON_BN_CLICKED(IDC_BUTchoose, OnBUTchoose)
  167. ON_BN_CLICKED(IDC_BUTtakeaway, OnBUTtakeaway)
  168. ON_BN_CLICKED(IDC_BUTall, OnBUTall)
  169. ON_BN_CLICKED(IDC_BUTchoose3, OnBUTchoose3)
  170. ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
  171. ON_EN_CHANGE(IDC_EDITyear, OnChangeEDITyear)
  172. ON_EN_CHANGE(IDC_EDITmonth, OnChangeEDITmonth)
  173. ON_EN_CHANGE(IDC_EDITday, OnChangeEDITday)
  174. ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
  175. ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
  176. ON_BN_CLICKED(IDC_RADIO5, OnRadio5)
  177. ON_BN_CLICKED(IDC_RADIO6, OnRadio6)
  178. ON_BN_CLICKED(IDC_CHECK2, OnCheck2)
  179. ON_BN_CLICKED(IDC_BUTmsg, OnBUTmsg)
  180. ON_BN_CLICKED(IDC_RADIO7, OnRadio7)
  181. ON_BN_CLICKED(IDC_BUTtake3, OnBUTtake3)
  182. ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
  183. ON_NOTIFY(NM_CLICK, IDC_LIST3, OnClickList3)
  184. ON_NOTIFY(NM_CLICK, IDC_LIST4, OnClickList4)
  185. ON_NOTIFY(NM_CLICK, IDC_LIST7, OnClickList7)
  186. ON_NOTIFY(NM_CLICK, IDC_LIST8, OnClickList8)
  187. ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2)
  188. ON_NOTIFY(NM_DBLCLK, IDC_LIST3, OnDblclkList3)
  189. ON_NOTIFY(NM_DBLCLK, IDC_LIST4, OnDblclkList4)
  190. ON_NOTIFY(NM_DBLCLK, IDC_LIST7, OnDblclkList7)
  191. ON_BN_CLICKED(IDC_RADIO8, OnRadio8)
  192. ON_NOTIFY(NM_CLICK, IDC_LIST10, OnClickList10)
  193. ON_BN_CLICKED(IDC_RADIO9, OnRadio9)
  194. ON_BN_CLICKED(IDC_RADIO14, OnRadio14)
  195. ON_BN_CLICKED(IDC_RADIO15, OnRadio15)
  196. ON_BN_CLICKED(IDC_RADIO10, OnRadio10)
  197. ON_NOTIFY(NM_DBLCLK, IDC_LIST8, OnDblclkList8)
  198. //}}AFX_MSG_MAP
  199. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST7, OnCustomdrawList4)
  200. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST4, OnCustomdrawList3)
  201. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST2, OnCustomdrawList1)
  202. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST3, OnCustomdrawList2)
  203. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST8, OnCustomdrawList5)
  204. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST10, OnCustomdrawList6)
  205. END_MESSAGE_MAP()
  206. /////////////////////////////////////////////////////////////////////////////
  207. // TodayForm diagnostics
  208. #ifdef _DEBUG
  209. void TodayForm::AssertValid() const
  210. {
  211. MyFormView::AssertValid();
  212. }
  213. void TodayForm::Dump(CDumpContext& dc) const
  214. {
  215. MyFormView::Dump(dc);
  216. }
  217. #endif //_DEBUG
  218. /////////////////////////////////////////////////////////////////////////////
  219. // TodayForm message handlers
  220. void TodayForm::OnInitialUpdate()
  221. {
  222. MyFormView::OnInitialUpdate();
  223. // m_List1.m_bSortSupport =0;
  224. // m_List5.m_bSortSupport =0;
  225. m_List2.ShowWindow (SW_HIDE);
  226. m_List3.ShowWindow (SW_HIDE);
  227. m_List4.ShowWindow (SW_HIDE);
  228. m_List5.ShowWindow (SW_HIDE);
  229. m_List6.ShowWindow (SW_HIDE);
  230. GetDlgItem(IDC_RADIO9)->ShowWindow (SW_HIDE);
  231. GetDlgItem(IDC_RADIO14)->ShowWindow (SW_HIDE);
  232. GetDlgItem(IDC_RADIO15)->ShowWindow (SW_HIDE);
  233. if(g_bAllBranch)
  234. {
  235. GetDlgItem(IDC_RADIO3)->ShowWindow (SW_HIDE);
  236. GetDlgItem(IDC_RADIO4)->ShowWindow (SW_HIDE);
  237. GetDlgItem(IDC_RADIO5)->ShowWindow (SW_HIDE);
  238. GetDlgItem(IDC_RADIO6)->ShowWindow (SW_HIDE);
  239. GetDlgItem(IDC_RADIO7)->ShowWindow (SW_HIDE);
  240. GetDlgItem(IDC_RADIO8)->ShowWindow (SW_HIDE);
  241. GetDlgItem(IDC_RADIO10)->ShowWindow (SW_HIDE);
  242. GetDlgItem(IDC_BUTall)->ShowWindow (SW_HIDE);
  243. GetDlgItem(IDC_STATIC3)->ShowWindow (SW_HIDE);
  244. m_bShowCalendar=0;
  245. }
  246. // TODO: Add your specialized code here and/or call the base class
  247. GetDlgItem(IDC_BUTtake)->EnableWindow(IsHasRights2new(2));
  248. GetDlgItem(IDC_BUTtake3)->EnableWindow(IsHasRights2new(2));
  249. GetDlgItem(IDC_BUTchoose)->EnableWindow(IsHasRights2new(2));
  250. CMyMdi Mdi;
  251. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  252. // Here we create the outbar control using the splitter as its parent
  253. // and setting its id to the first pane.
  254. CRect rc2;
  255. GetWindowRect(rc2);
  256. ::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE);
  257. EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc,0);
  258. if(g_bAllBranch)
  259. {
  260. CRect rc;
  261. GetDlgItem(IDC_RADIO3)->GetWindowRect (rc2);
  262. ScreenToClient(rc2);
  263. GetDlgItem(IDC_STATIC2)->GetWindowRect (rc);
  264. ScreenToClient(rc);
  265. rc.top = rc2.top ;
  266. rc.bottom = rc2.bottom ;
  267. GetDlgItem(IDC_STATIC2)->MoveWindow (rc);
  268. GetDlgItem(IDC_RADIO5)->GetWindowRect (rc2);
  269. ScreenToClient(rc2);
  270. rc2.bottom += rc2.Height();
  271. rc2.top += rc2.Height()/2;
  272. GetDlgItem(IDC_CHECK1)->MoveWindow (rc2);
  273. rc2.left =rc2.right ;
  274. rc2.right =rc2.left +100;
  275. GetDlgItem(IDC_CHECK2)->MoveWindow (rc2);
  276. GetDlgItem(IDC_BUTtake3)->GetWindowRect (rc2);
  277. ScreenToClient(rc2);
  278. GetDlgItem(IDC_STATIC3)->GetWindowRect (rc);ScreenToClient(rc);
  279. rc.right =rc2.left-rc2.Width ()/3 ;
  280. GetDlgItem(IDC_STATIC3)->MoveWindow (rc);
  281. }
  282. int idarray[]={IDC_BUTall,IDC_BUTtakeaway,IDC_BUTtake3,IDC_BUTtake,IDC_BUTchoose,IDC_BUTmsg,IDC_BUTclose};
  283. int idcount=7;
  284. int btnwid;
  285. CRect prerc;
  286. for(int a=idcount-2; a>=0; a--)
  287. {
  288. GetDlgItem(idarray[a+1])->GetWindowRect (prerc);
  289. ScreenToClient(prerc);
  290. GetDlgItem(idarray[a])->GetWindowRect (rc2);
  291. ScreenToClient(rc2);
  292. btnwid=rc2.Width ();
  293. rc2.right =prerc.left ;
  294. rc2.left =rc2.right -btnwid;
  295. GetDlgItem(idarray[a])->MoveWindow (rc2);
  296. }
  297. m_spinyear.SetRange (1900, 3000);
  298. m_spinmonth.SetRange (1, 12);
  299. m_spinday.SetRange (1, 31);
  300. m_static1.SetFont (&g_titlefont);
  301. #ifdef CHILD_VERSION
  302. GetDlgItem(IDC_RADIO14)->SetWindowText("宝宝满月");
  303. GetDlgItem(IDC_RADIO15)->SetWindowText("宝宝100天");
  304. #endif
  305. #ifdef ENTERPRISE_VERSION
  306. m_nAdd2=1;
  307. if(g_bAllBranch==0)
  308. {
  309. #ifdef CHILD_VERSION
  310. GetDlgItem(IDC_RADIO7)->ShowWindow(SW_HIDE);
  311. GetDlgItem(IDC_RADIO7)->GetWindowRect(rc2);
  312. ScreenToClient(rc2);
  313. GetDlgItem(IDC_RADIO8)->MoveWindow(rc2);
  314. 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" );
  315. //m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
  316. //m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120");//;录入时间,120
  317. m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;录入,100;录入时间,120;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
  318. m_List3.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;看设计日期,100;时间,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100" );
  319. m_List4.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;取件日期,100;时间,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100" );
  320. #else
  321. 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" );
  322. //m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
  323. //m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120
  324. m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;录入,100;录入时间,120;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100");
  325. m_List3.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;看设计日期,100;时间,100;婚期,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100" );
  326. m_List4.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;取件日期,100;时间,100;婚期,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100" );
  327. m_List5.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚期,100;婚庆内容,100;婚庆日期,100;时间,100;服务人员,100;服务人员2,100;状态,100;备注,100;接单人,100;套系名称,100;套系价格,100" );
  328. m_List5.LoadColumnInfo (172);m_List5.m_bSortSupport=0;
  329. #endif
  330. m_List6.SetHeadings("客人姓名,100;性别,100;生日,100;是否农历,100;客户类别,100;电话,100;天数,200" );
  331. m_List1.LoadColumnInfo (110);
  332. m_List2.LoadColumnInfo (161);
  333. m_List3.LoadColumnInfo (162);
  334. m_List4.LoadColumnInfo (163);
  335. m_List6.LoadColumnInfo (169);
  336. }
  337. else
  338. {
  339. #ifdef CHILD_VERSION
  340. GetDlgItem(IDC_RADIO7)->ShowWindow(SW_HIDE);
  341. 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" );
  342. //m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
  343. //m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120
  344. m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;录入,100;录入时间,120;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
  345. m_List3.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;看设计日期,100;时间,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100" );
  346. m_List4.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;取件日期,100;时间,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100" );
  347. #else
  348. 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" );
  349. //m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
  350. //m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120
  351. m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;录入,100;录入时间,120;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
  352. m_List3.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;看设计日期,100;时间,100;婚期,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100" );
  353. m_List4.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;取件日期,100;时间,100;婚期,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100" );
  354. m_List5.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚期,100;婚庆内容,100;婚庆日期,100;时间,100;服务人员,100;服务人员2,100;状态,100;备注,100;接单人,100;套系名称,100;套系价格,100" );
  355. m_List5.LoadColumnInfo (193);m_List5.m_bSortSupport=0;
  356. #endif
  357. #ifdef CHILD_VERSION
  358. m_List6.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  359. #else
  360. m_List6.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100" );
  361. #endif
  362. m_List1.LoadColumnInfo (188);
  363. m_List2.LoadColumnInfo (189);
  364. m_List3.LoadColumnInfo (190);
  365. m_List4.LoadColumnInfo (191);
  366. m_List6.LoadColumnInfo (192);
  367. GetDlgItem(IDC_RADIO8)->ShowWindow (SW_HIDE);
  368. }
  369. #else
  370. if(g_bAllBranch==0)
  371. {
  372. #ifdef CHILD_VERSION
  373. GetDlgItem(IDC_RADIO7)->ShowWindow(SW_HIDE);
  374. GetDlgItem(IDC_RADIO7)->GetWindowRect(rc2);
  375. ScreenToClient(rc2);
  376. GetDlgItem(IDC_RADIO8)->MoveWindow(rc2);
  377. 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" );
  378. //m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
  379. //m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120
  380. m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;录入,100;录入时间,120;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
  381. m_List3.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;看设计日期,100;时间,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100" );
  382. m_List4.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;取件日期,100;时间,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100" );
  383. #else
  384. 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" );
  385. //m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
  386. //m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100" );//;录入时间,120
  387. m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;录入,100;录入时间,120;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100");
  388. m_List3.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;看设计日期,100;时间,100;婚期,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100" );
  389. m_List4.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;取件日期,100;时间,100;婚期,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100" );
  390. m_List5.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚期,100;婚庆内容,100;婚庆日期,100;时间,100;服务人员,100;服务人员2,100;状态,100;备注,100;接单人,100;套系名称,100;套系价格,100" );
  391. m_List5.LoadColumnInfo (172);m_List5.m_bSortSupport=0;
  392. #endif
  393. m_List6.SetHeadings("客人姓名,100;性别,100;生日,100;是否农历,100;客户类别,100;电话,100;天数,200" );
  394. m_List1.LoadColumnInfo (110);
  395. m_List2.LoadColumnInfo (161);
  396. m_List3.LoadColumnInfo (162);
  397. m_List4.LoadColumnInfo (163);
  398. m_List6.LoadColumnInfo (169);
  399. }
  400. else
  401. {
  402. #ifdef CHILD_VERSION
  403. GetDlgItem(IDC_RADIO7)->ShowWindow(SW_HIDE);
  404. 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" );
  405. // m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
  406. //m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120
  407. m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;录入,100;录入时间,120;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
  408. m_List3.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;看设计日期,100;时间,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100" );
  409. m_List4.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;取件日期,100;时间,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100" );
  410. #else
  411. 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" );
  412. //m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
  413. //m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120
  414. m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;录入,100;录入时间,120;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100");
  415. m_List3.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;看设计日期,100;时间,100;婚期,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100" );
  416. m_List4.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;取件日期,100;时间,100;婚期,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100" );
  417. m_List5.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚期,100;婚庆内容,100;婚庆日期,100;时间,100;服务人员,100;服务人员2,100;状态,100;备注,100;接单人,100;套系名称,100;套系价格,100" );
  418. m_List5.LoadColumnInfo (193);m_List5.m_bSortSupport=0;
  419. #endif
  420. #ifdef CHILD_VERSION
  421. m_List6.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  422. #else
  423. m_List6.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100" );
  424. #endif
  425. m_List1.LoadColumnInfo (188);
  426. m_List2.LoadColumnInfo (189);
  427. m_List3.LoadColumnInfo (190);
  428. m_List4.LoadColumnInfo (191);
  429. m_List6.LoadColumnInfo (192);
  430. GetDlgItem(IDC_RADIO8)->ShowWindow (SW_HIDE);
  431. }
  432. #endif
  433. m_bInit=1;
  434. if(g_bAllBranch==0)
  435. {
  436. m_List1.ShowWindow (SW_HIDE);
  437. m_List1.GetWindowRect (rc2);
  438. ScreenToClient(rc2);
  439. m_CalendarFrm.m_rect=rc2;
  440. m_CalendarFrm.Create(rc2, this, 106);
  441. if(m_radio==5)
  442. OnRadio8();
  443. else
  444. GetCalendarData();
  445. }
  446. else
  447. DateChange();
  448. m_List1.GetWindowRect (rc2);
  449. ScreenToClient(rc2);
  450. m_childdlg.Create(IDD_DLGTodayFormChild, this);
  451. rc2.right-=20;
  452. CRect rc=rc2;
  453. rc2.top+=30;
  454. rc2.bottom+=256*19-30;
  455. m_childdlg.List1array=&m_List7array;
  456. // m_childdlg.pClientarray=&m_Clientarray;
  457. // m_childdlg.pTxtypearray=&m_Txtypearray;
  458. m_childdlg.MoveWindow(rc2);
  459. m_childdlg.ShowWindow(SW_SHOW);
  460. m_bInit=1;
  461. // DateChange();
  462. rc2.top-=30;
  463. rc2.right+=20;
  464. rc2.left=rc2.right-20; rc2.bottom-=256*19-30;
  465. m_scrollbar.MoveWindow(rc2);
  466. rc.bottom=rc.top+30;
  467. m_table.Create(rc, this, WS_HSCROLL);
  468. m_table.m_bFocusFrame=0;
  469. m_table.Test2 ();
  470. m_page=rc2.Height ()-40;
  471. m_scrollbar.SetScrollRange(0,256*20);
  472. m_scrollbar.SetScrollPos(0);
  473. if(1)
  474. {
  475. // m_childdlg.m_table.ModeChange(10);
  476. // m_table.ModeChange(10);
  477. // m_table.Test2 ();
  478. // m_table.ShowWindow(SW_SHOW);
  479. // m_childdlg.ShowWindow(SW_SHOW);
  480. m_combo1.m_mode=1;
  481. m_combo1.m_pMsgParent=&(m_childdlg.m_table);
  482. m_childdlg.m_table.m_pComboBox=&m_combo1;
  483. // m_scrollbar.ShowWindow(SW_SHOW);
  484. m_table.ShowWindow(SW_HIDE);
  485. m_childdlg.ShowWindow(SW_HIDE);
  486. m_scrollbar.ShowWindow(SW_HIDE);
  487. }
  488. }
  489. void TodayForm::FillGrid()
  490. {
  491. UpdateData();
  492. int ii=0;
  493. if(m_radio==0) // 0:拍照客人
  494. {
  495. m_List1.ShowWindow (SW_SHOW);
  496. m_List2.ShowWindow (SW_HIDE);
  497. m_List3.ShowWindow (SW_HIDE);
  498. m_List4.ShowWindow (SW_HIDE);
  499. m_List5.ShowWindow (SW_HIDE);
  500. m_List6.ShowWindow (SW_HIDE);
  501. m_List1.DeleteAllItems2 ();
  502. m_datearray1.RemoveAll ();
  503. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  504. int count=0;
  505. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  506. {
  507. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  508. #ifdef ENTERPRISE_VERSION
  509. int nAdd2=0;
  510. #ifndef CHILD_VERSION
  511. nAdd2=-1;
  512. #endif
  513. if(::FindArray (&m_datearray1, m_List1array.ElementAt (ii).ElementAt (9+m_nAdd+nAdd2) )==-1)
  514. m_datearray1.Add (m_List1array.ElementAt (ii).ElementAt (9+m_nAdd+nAdd2));
  515. #else
  516. #ifdef CHILD_VERSION
  517. if(::FindArray (&m_datearray1, m_List1array.ElementAt (ii).ElementAt (10+m_nAdd+m_nAdd2) )==-1)
  518. m_datearray1.Add (m_List1array.ElementAt (ii).ElementAt (10+m_nAdd+m_nAdd2));
  519. #else
  520. if(::FindArray (&m_datearray1, m_List1array.ElementAt (ii).ElementAt (9+m_nAdd+m_nAdd2) )==-1)
  521. m_datearray1.Add (m_List1array.ElementAt (ii).ElementAt (9+m_nAdd+m_nAdd2));
  522. #endif
  523. #endif
  524. }
  525. m_List1.m_arLabels.SetSize(count, 1);
  526. ii=count;
  527. m_List1.m_LabelCount=ii;
  528. m_List1.SetItemCountEx (ii);
  529. }
  530. else if(m_radio==1)// 1:选片客人;
  531. {
  532. m_List2.ShowWindow (SW_SHOW);
  533. m_List1.ShowWindow (SW_HIDE);
  534. m_List3.ShowWindow (SW_HIDE);
  535. m_List4.ShowWindow (SW_HIDE);
  536. m_List5.ShowWindow (SW_HIDE);
  537. m_List6.ShowWindow (SW_HIDE);
  538. m_List2.DeleteAllItems2();
  539. m_datearray2.RemoveAll ();
  540. m_List2.m_arLabels.SetSize(m_List2array.GetSize(), 1 );
  541. int count=0;
  542. for(ii=0; ii<m_List2.m_arLabels.GetSize(); ii++)
  543. {
  544. m_List2.m_arLabels.ElementAt (count++).Copy (m_List2array.ElementAt (ii));
  545. if(::FindArray (&m_datearray2, m_List2array.ElementAt (ii).ElementAt (5+m_nAdd) )==-1)
  546. m_datearray2.Add (m_List2array.ElementAt (ii).ElementAt (5+m_nAdd));
  547. }
  548. m_List2.m_arLabels.SetSize(count, 1);
  549. ii=count;
  550. m_List2.m_LabelCount=ii;
  551. m_List2.SetItemCountEx (ii);
  552. }
  553. else if(m_radio==2)// 2:看设计客人;
  554. {
  555. m_List3.ShowWindow (SW_SHOW);
  556. m_List2.ShowWindow (SW_HIDE);
  557. m_List1.ShowWindow (SW_HIDE);
  558. m_List4.ShowWindow (SW_HIDE);
  559. m_List5.ShowWindow (SW_HIDE);
  560. m_List6.ShowWindow (SW_HIDE);
  561. m_List3.DeleteAllItems2 ();m_datearray3.RemoveAll ();
  562. m_List3.m_arLabels.SetSize( m_List3array.GetSize (), 1 );
  563. int count=0;
  564. for(ii=0; ii<m_List3.m_arLabels.GetSize (); ii++)
  565. {
  566. m_List3.m_arLabels.ElementAt (count++).Copy (m_List3array.ElementAt (ii));
  567. if(::FindArray(&m_datearray3, m_List3array.ElementAt (ii).ElementAt (5+m_nAdd) )==-1)
  568. m_datearray3.Add (m_List3array.ElementAt (ii).ElementAt (5+m_nAdd));
  569. }
  570. m_List3.m_arLabels.SetSize(count, 1);
  571. ii=count;
  572. m_List3.m_LabelCount=ii;
  573. m_List3.SetItemCountEx (ii);
  574. }
  575. else if(m_radio==3)// 3:取件客人;
  576. {
  577. m_List4.ShowWindow (SW_SHOW);
  578. m_List2.ShowWindow (SW_HIDE);
  579. m_List3.ShowWindow (SW_HIDE);
  580. m_List1.ShowWindow (SW_HIDE);
  581. m_List5.ShowWindow (SW_HIDE);
  582. m_List6.ShowWindow (SW_HIDE);
  583. m_List4.DeleteAllItems2 ();m_datearray4.RemoveAll ();
  584. m_List4.m_arLabels.SetSize( m_List4array.GetSize (), 1 );
  585. int count=0;
  586. for(ii=0; ii<m_List4.m_arLabels.GetSize (); ii++)
  587. {
  588. m_List4.m_arLabels.ElementAt (count++).Copy (m_List4array.ElementAt (ii));
  589. if(::FindArray (&m_datearray4, m_List4array.ElementAt (ii).ElementAt (5+m_nAdd) )==-1)
  590. m_datearray4.Add (m_List4array.ElementAt (ii).ElementAt (5+m_nAdd));
  591. }
  592. m_List4.m_arLabels.SetSize(count, 1);
  593. ii=count;
  594. m_List4.m_LabelCount=ii;
  595. m_List4.SetItemCountEx (ii);
  596. }
  597. else if(m_radio==4)
  598. {
  599. m_List5.ShowWindow (SW_SHOW);
  600. m_List2.ShowWindow (SW_HIDE);
  601. m_List3.ShowWindow (SW_HIDE);
  602. m_List4.ShowWindow (SW_HIDE);
  603. m_List1.ShowWindow (SW_HIDE);
  604. m_List6.ShowWindow (SW_HIDE);
  605. m_List5.DeleteAllItems2 ();m_datearray5.RemoveAll ();
  606. m_List5.m_arLabels.SetSize( m_List5array.GetSize (), 1 );
  607. int count=0;
  608. int dan=0;
  609. for(ii=0; ii<m_List5.m_arLabels.GetSize (); ii++)
  610. {
  611. m_List5.m_arLabels.ElementAt (count++).Copy (m_List5array.ElementAt (ii));
  612. if(::FindArray (&m_datearray5, m_List5array.ElementAt (ii).ElementAt (7+m_nAdd) )==-1)
  613. m_datearray5.Add (m_List5array.ElementAt (ii).ElementAt (7+m_nAdd));
  614. CString date=m_List5array.ElementAt (ii).ElementAt (7+m_nAdd);
  615. if(date.GetLength()==10 && date>=m_date1 && date<=m_date2)dan++;
  616. }
  617. m_List5.m_arLabels.SetSize(count, 1);
  618. ii=count;
  619. m_List5.m_LabelCount=ii;
  620. m_List5.SetItemCountEx (ii);
  621. CString str;
  622. str.Format ("单数:%d", dan);
  623. SetDlgItemText(IDC_STATIC2, str);
  624. return;
  625. }
  626. else if(m_radio==5)// 5:近期生日;
  627. {
  628. m_List6.ShowWindow (SW_SHOW);
  629. m_List2.ShowWindow (SW_HIDE);
  630. m_List3.ShowWindow (SW_HIDE);
  631. m_List4.ShowWindow (SW_HIDE);
  632. m_List1.ShowWindow (SW_HIDE);
  633. m_List5.ShowWindow (SW_HIDE);
  634. m_List6.DeleteAllItems2 ();m_datearray6.RemoveAll ();
  635. m_List6.m_arLabels.SetSize( m_List6array.GetSize (), 1 );
  636. int count=0;
  637. for(ii=0; ii<m_List6.m_arLabels.GetSize (); ii++)
  638. {
  639. m_List6.m_arLabels.ElementAt (count++).Copy (m_List6array.ElementAt (ii));
  640. // if(::FindArray (&m_datearray6, m_List6array.ElementAt (ii).ElementAt (9+m_nAdd) )==-1)
  641. // m_datearray6.Add (m_List6array.ElementAt (ii).ElementAt (9+m_nAdd));
  642. }
  643. m_List6.m_arLabels.SetSize(count, 1);
  644. ii=count;
  645. m_List6.m_LabelCount=ii;
  646. m_List6.SetItemCountEx (ii);
  647. }
  648. CString str;
  649. str.Format ("单数:%d", ii);
  650. SetDlgItemText(IDC_STATIC2, str);
  651. }
  652. void TodayForm::OnBUTclose() //wenbin mark
  653. {
  654. GetParent()->SendMessage(WM_CLOSE);
  655. }
  656. void TodayForm::OnBUTchoose3() //看设计
  657. {
  658. m_mode=3;
  659. FillGrid();
  660. }
  661. int __cdecl CompareByLabel3( const void *elem1, const void *elem2)
  662. {
  663. CStringArray *p1 = (CStringArray*)elem1;
  664. CStringArray *p2 = (CStringArray*)elem2;
  665. #ifdef CHILD_VERSION
  666. return lstrcmp( p1->ElementAt (10), p2->ElementAt (10) ) ;
  667. #else
  668. return lstrcmp( p1->ElementAt (9), p2->ElementAt (9) ) ;
  669. #endif
  670. }
  671. int __cdecl CompareByLabel5( const void *elem1, const void *elem2)
  672. {
  673. CStringArray *p1 = (CStringArray*)elem1;
  674. CStringArray *p2 = (CStringArray*)elem2;
  675. int nAdd=0;
  676. if(g_bAllBranch)nAdd=1;
  677. int nAdd2=0;
  678. #ifndef CHILD_VERSION
  679. nAdd2=-1;
  680. #endif
  681. if(p1->ElementAt (9+nAdd+nAdd2)==p2->ElementAt (9+nAdd+nAdd2) && p1->ElementAt (11+nAdd+nAdd2)==p2->ElementAt (11+nAdd+nAdd2))
  682. {
  683. return lstrcmp( p1->ElementAt (12+nAdd+nAdd2), p2->ElementAt (12+nAdd+nAdd2) ) ;
  684. }
  685. if(p1->ElementAt (9+nAdd+nAdd2)==p2->ElementAt (9+nAdd+nAdd2))
  686. {
  687. return lstrcmp( p1->ElementAt (11+nAdd+nAdd2), p2->ElementAt (11+nAdd+nAdd2) ) ;
  688. }
  689. return lstrcmp( p1->ElementAt (9+nAdd+nAdd2), p2->ElementAt (9+nAdd+nAdd2) ) ;
  690. return 1;
  691. }
  692. int __cdecl CompareByLabel7( const void *elem1, const void *elem2)
  693. {
  694. CStringArray *p1 = (CStringArray*)elem1;
  695. CStringArray *p2 = (CStringArray*)elem2;
  696. int nAdd=0;
  697. if(g_bAllBranch)nAdd=1;
  698. int nAdd2=0;
  699. #ifndef CHILD_VERSION
  700. nAdd2=-1;
  701. #endif
  702. if(p1->ElementAt (9+nAdd+nAdd2)==p2->ElementAt (9+nAdd+nAdd2))
  703. {
  704. return lstrcmp( p1->ElementAt (11+nAdd+nAdd2), p2->ElementAt (11+nAdd+nAdd2) ) ;
  705. }
  706. return lstrcmp( p1->ElementAt (9+nAdd+nAdd2), p2->ElementAt (9+nAdd+nAdd2) ) ;
  707. return 1;
  708. }
  709. int __cdecl CompareByLabel8( const void *elem1, const void *elem2)
  710. {
  711. CStringArray *p1 = (CStringArray*)elem1;
  712. CStringArray *p2 = (CStringArray*)elem2;
  713. int nAdd2=0;
  714. #ifndef CHILD_VERSION
  715. nAdd2=-1;
  716. #endif
  717. int nAdd=0;
  718. if(g_bAllBranch)nAdd=1;
  719. return lstrcmp( p1->ElementAt (9+nAdd+nAdd2), p2->ElementAt (9+nAdd+nAdd2) ) ;
  720. }
  721. void TodayForm::DateChange()//connect with server;
  722. {
  723. if(m_bInit==0)return;
  724. if(m_bShowCalendar&&m_radio!=6)
  725. {
  726. return;
  727. }
  728. m_spinyear.EnableWindow(0);
  729. m_spinmonth.EnableWindow(0);
  730. m_spinday.EnableWindow(0);
  731. UpdateData();
  732. if(0)
  733. {
  734. CTime tm=GetTmFromStr("1512-00-12");
  735. CString ss;
  736. ss.Format ("%d-%d-%d", tm.GetYear (), tm.GetMonth (), tm.GetDay ());
  737. MessageBox(ss);
  738. return ;
  739. }
  740. if(m_radio==5)
  741. {
  742. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0);
  743. GetDlgItem(IDC_BUTall)->ShowWindow(0);
  744. GetDlgItem(IDC_BUTtake3)->ShowWindow(0);
  745. GetDlgItem(IDC_BUTtake)->ShowWindow(0);
  746. GetDlgItem(IDC_BUTchoose)->ShowWindow(0);
  747. GetDlgItem(IDC_RADIO9)->ShowWindow(1);
  748. GetDlgItem(IDC_RADIO14)->ShowWindow(1);
  749. GetDlgItem(IDC_RADIO15)->ShowWindow(1);
  750. }
  751. else if(m_radio==6 )
  752. {
  753. m_childdlg.m_table.ModeChange(10);
  754. m_table.ModeChange(10);
  755. m_table.Test2 ();
  756. m_table.ShowWindow(SW_SHOW);
  757. m_childdlg.ShowWindow(SW_SHOW);
  758. m_scrollbar.ShowWindow(SW_SHOW);
  759. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0);
  760. GetDlgItem(IDC_BUTall)->ShowWindow(0);
  761. GetDlgItem(IDC_BUTtake3)->ShowWindow(0);
  762. GetDlgItem(IDC_BUTtake)->ShowWindow(1);
  763. GetDlgItem(IDC_BUTchoose)->ShowWindow(1);
  764. GetDlgItem(IDC_BUTtake)->SetWindowText("另约日期");
  765. GetDlgItem(IDC_BUTchoose)->SetWindowText("取消预约");
  766. GetDlgItem(IDC_RADIO9)->ShowWindow(0);
  767. GetDlgItem(IDC_RADIO14)->ShowWindow(0);
  768. GetDlgItem(IDC_RADIO15)->ShowWindow(0);
  769. }
  770. else
  771. {
  772. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(1);
  773. if(!g_bAllBranch)GetDlgItem(IDC_BUTall)->ShowWindow(1);
  774. GetDlgItem(IDC_BUTtake3)->ShowWindow(1);
  775. GetDlgItem(IDC_BUTtake)->ShowWindow(1);
  776. GetDlgItem(IDC_BUTchoose)->ShowWindow(1);
  777. GetDlgItem(IDC_BUTtake)->SetWindowText("客人预约");
  778. GetDlgItem(IDC_BUTchoose)->SetWindowText("重新安排");
  779. GetDlgItem(IDC_RADIO9)->ShowWindow(0);
  780. GetDlgItem(IDC_RADIO14)->ShowWindow(0);
  781. GetDlgItem(IDC_RADIO15)->ShowWindow(0);
  782. }
  783. if(0)//m_radio==5)
  784. {
  785. GetDlgItem(IDC_CHECK1)->SetWindowText("近半个月");
  786. GetDlgItem(IDC_CHECK2)->SetWindowText("近一个月");
  787. }
  788. else
  789. {
  790. GetDlgItem(IDC_CHECK1)->SetWindowText("近一个星期");
  791. GetDlgItem(IDC_CHECK2)->SetWindowText("近半个月");
  792. }
  793. if(m_radio==0||m_radio==1||m_radio==2||m_radio==3||m_radio==4)
  794. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(1);
  795. else
  796. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0);
  797. if(m_radio==0)
  798. GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未拍");
  799. if(m_radio==1)
  800. GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未选");
  801. if(m_radio==2)
  802. GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未看");
  803. if(m_radio==3)
  804. GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未取");
  805. if(m_radio==4)
  806. GetDlgItem(IDC_BUTtake3)->SetWindowText("统计婚庆");
  807. g_todayradio=m_radio;
  808. g_todaycheck=0;
  809. CTime tm=CTime(m_year, m_month, m_day, 0, 0, 0);
  810. g_todaytm=tm;
  811. CString strdate,strdate2;
  812. strdate.Format ("%04d-%02d-%02d", m_year, m_month, m_day);
  813. if(m_check)
  814. {
  815. CTime tm=CTime(m_year, m_month, m_day, 0, 0, 0);
  816. if(m_radio==5)
  817. tm+=CTimeSpan(15, 0, 0, 0);
  818. else
  819. tm+=CTimeSpan(7, 0, 0, 0);
  820. strdate2=tm.Format ("%Y-%m-%d");
  821. g_todaycheck=1;
  822. }
  823. else if(m_check2)
  824. {
  825. CTime tm=CTime(m_year, m_month, m_day, 0, 0, 0);
  826. if(m_radio==5)
  827. tm+=CTimeSpan(31, 0, 0, 0);
  828. else
  829. tm+=CTimeSpan(15, 0, 0, 0);
  830. strdate2=tm.Format ("%Y-%m-%d");
  831. g_todaycheck=2;
  832. }
  833. else
  834. strdate2=strdate;
  835. COleDateTime dtDay(m_year, m_month, m_day, 0, 0, 0);
  836. int nDayWeek = dtDay.GetDayOfWeek()-1; //得到星期几,1=Sunday, 2=Monday,
  837. CString DayOfWeek[7]={"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};
  838. CString sdate;
  839. if(nDayWeek>=0 && nDayWeek<=6)
  840. sdate=DayOfWeek[nDayWeek];
  841. else
  842. sdate="无效日期";
  843. m_static1.SetWindowText (strdate+"("+sdate+")小秘书");
  844. m_date1=strdate;
  845. m_date2=strdate2;
  846. if(m_radio==0) // 拍照客人;
  847. {
  848. GetData1(strdate, strdate2);
  849. }
  850. else if(m_radio==1) // 选片客人;
  851. {
  852. GetData2(strdate, strdate2);
  853. }
  854. else if(m_radio==2) // 看设计客人;
  855. {
  856. GetData3(strdate, strdate2);
  857. }
  858. else if(m_radio==3) // 取件客人;
  859. {
  860. GetData4(strdate, strdate2);
  861. }
  862. else if(m_radio==4) // ??
  863. {
  864. GetData5(strdate, strdate2);
  865. }
  866. else if(m_radio==6) // 其他预约
  867. {
  868. m_List7array.RemoveAll();
  869. g_sendhead.code[0]=221;
  870. g_sendhead.tabcount=1;
  871. g_sendhead.bsql=0;
  872. CString sql;
  873. sql.Format ("date>='"+strdate+"' and date<='"+strdate2+"' and mode='10'");
  874. g_pMainWnd->ProcessChatMessageRequest2(sql);
  875. if(g_bSendOK==0)
  876. {
  877. m_childdlg.ShowTable();return;
  878. }
  879. DataToArray(&m_List7array); m_childdlg.ShowTable();
  880. int temp=m_nscrollpos;
  881. int nscrollpos=m_scrollbar.GetScrollPos();
  882. m_nscrollpos=0;
  883. m_scrollbar.SetScrollPos(m_nscrollpos);
  884. m_childdlg.ScrollWindow(0, temp-m_nscrollpos);
  885. }
  886. else if(m_radio==5) // 近期生日;
  887. {
  888. m_List6array.RemoveAll();
  889. CString today=g_date;
  890. CString todaynl=g_date;
  891. CovertDate2(todaynl);
  892. CTime todaytm=GetTmFromStr(today);
  893. CString name,sex,phone,birthday,clienttype,days,birthdaybak;
  894. BOOL checknl;
  895. int ndays=0;
  896. int checkdays=30;
  897. if(m_check)
  898. checkdays=7;
  899. if(m_check2)
  900. checkdays=15;
  901. #ifdef CHILD_VERSION
  902. g_sendhead.code[0]=94;
  903. #else
  904. g_sendhead.code[0]=64;
  905. #endif
  906. g_sendhead.code[1]=138;
  907. g_sendhead.code[2]=90;
  908. g_sendhead.tabcount=3;
  909. g_sendhead.bsql=0;
  910. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
  911. CArray<CStringArray, CStringArray>List1array;
  912. CArray<CStringArray, CStringArray>List2array;
  913. CArray<CStringArray, CStringArray>List3array;
  914. DataToArray(&List1array, &List2array, &List3array);
  915. clienttype="订单客户";
  916. int size=0;
  917. #ifdef CHILD_VERSION
  918. try
  919. {
  920. for(int i=0; i<List1array.GetSize(); i++)
  921. {
  922. sex=List1array.ElementAt (i).ElementAt (9);
  923. birthday=List1array.ElementAt (i).ElementAt (7);
  924. birthdaybak=birthday;
  925. checknl=atoi(List1array.ElementAt (i).ElementAt (11));
  926. name=List1array.ElementAt (i).ElementAt (1)+","+List1array.ElementAt (i).ElementAt (2);
  927. phone=List1array.ElementAt (i).ElementAt (3);
  928. ndays=-1;
  929. name.TrimLeft (",");name.TrimRight (",");
  930. if(checknl==0 && birthday.GetLength()==10)
  931. {
  932. if(m_radio2==1)
  933. {
  934. CTime tm=GetTmFromStr(birthday);
  935. int year=tm.GetYear ();
  936. int month=tm.GetMonth ();
  937. int day=tm.GetDay ();
  938. tm+=CTimeSpan(28, 0, 0, 0);
  939. while(1)
  940. {
  941. if(tm.GetDay ()>=day && (tm.GetMonth ()==month+1 || tm.GetYear ()==year+1) )break;
  942. if(tm.GetMonth ()>month+1)
  943. {
  944. tm-=CTimeSpan(1, 0, 0, 0);
  945. break;
  946. }
  947. tm+=CTimeSpan(1, 0, 0, 0);
  948. }
  949. CTimeSpan dt=tm-todaytm;
  950. ndays=dt.GetDays();
  951. days.Format("%d天后满月", ndays);
  952. if(ndays==0)
  953. days="今天满月";
  954. }
  955. else if(m_radio2==2)
  956. {
  957. CTime tm=GetTmFromStr(birthday);tm+=CTimeSpan(100, 0, 0, 0);
  958. CTimeSpan dt=tm-todaytm;
  959. ndays=dt.GetDays();
  960. days.Format("%d天后满100天", ndays);
  961. if(ndays==0)
  962. days="今天满100天";
  963. }
  964. else
  965. {
  966. birthday=today.Left(4)+birthday.Right(6);
  967. CTime tm=GetTmFromStr(birthday);
  968. CTimeSpan dt=tm-todaytm;
  969. ndays=dt.GetDays();
  970. days.Format("%d天后生日", ndays);
  971. if(ndays==0)
  972. days="今天生日";
  973. }
  974. }
  975. else if(birthday.GetLength()==10)
  976. {
  977. if(m_radio2==1)
  978. {
  979. CString birthdaynl=birthday;
  980. int year=atoi(birthdaynl.Mid (0,4));
  981. int month= atoi(birthdaynl.Mid (5,2));
  982. int day= atoi(birthdaynl.Mid (8,2));
  983. CovertDate3(birthday);
  984. CTime tm=GetTmFromStr(birthday);
  985. tm+=CTimeSpan(28, 0, 0, 0);
  986. while(1)
  987. {
  988. birthday=tm.Format ("%Y-%m-%d");
  989. CovertDate2(birthday);//转为农历
  990. if(atoi(birthday.Mid (8,2)) >=day && (atoi(birthday.Mid (5,2))==month+1 || atoi(birthday.Mid (0,4))==year+1) )break;
  991. if( atoi(birthday.Mid (5,2))>month+1)
  992. {
  993. tm-=CTimeSpan(1, 0, 0, 0);
  994. break;
  995. }
  996. tm+=CTimeSpan(1, 0, 0, 0);
  997. }
  998. CTimeSpan dt=tm-todaytm;
  999. ndays=dt.GetDays();
  1000. days.Format("%d天后满月", ndays);
  1001. if(ndays==0)
  1002. days="今天满月";
  1003. }
  1004. else if(m_radio2==2)
  1005. {
  1006. CovertDate3(birthday);
  1007. CTime tm=GetTmFromStr(birthday);tm+=CTimeSpan(100, 0, 0, 0);
  1008. CTimeSpan dt=tm-todaytm;
  1009. ndays=dt.GetDays();
  1010. days.Format("%d天后满100天", ndays);
  1011. if(ndays==0)
  1012. days="今天满100天";
  1013. }
  1014. else
  1015. {
  1016. birthday=todaynl.Left(4)+birthday.Right(6);
  1017. CovertDate3(birthday);
  1018. CTime tm=GetTmFromStr(birthday);
  1019. CTimeSpan dt=tm-todaytm;
  1020. ndays=dt.GetDays();
  1021. days.Format("%d天后生日", ndays);
  1022. if(ndays==0)
  1023. days="今天生日";
  1024. }
  1025. }
  1026. if(ndays<checkdays && ndays>=0 && name!="")
  1027. {
  1028. m_List6array.SetSize( size+1, 1 );
  1029. m_List6array.ElementAt (size).Add(name);
  1030. m_List6array.ElementAt (size).Add(sex);
  1031. m_List6array.ElementAt (size).Add(birthdaybak);
  1032. if(checknl)
  1033. m_List6array.ElementAt (size).Add("农历");
  1034. else
  1035. m_List6array.ElementAt (size).Add("公历");
  1036. m_List6array.ElementAt (size).Add(clienttype);
  1037. m_List6array.ElementAt (size).Add(phone);
  1038. m_List6array.ElementAt (size).Add(days);
  1039. size++;
  1040. }
  1041. }
  1042. }
  1043. catch(...)
  1044. {
  1045. MessageBox(name+birthday);
  1046. }
  1047. clienttype="老客户";
  1048. for(int i=0; i<List2array.GetSize(); i++)//老客户
  1049. {
  1050. sex=List2array.ElementAt (i).ElementAt (3);
  1051. birthday=List2array.ElementAt (i).ElementAt (6);
  1052. birthdaybak=birthday;
  1053. checknl=atoi(List2array.ElementAt (i).ElementAt (14));
  1054. name=List2array.ElementAt (i).ElementAt (2);
  1055. phone=List2array.ElementAt (i).ElementAt (4);
  1056. ndays=-1;
  1057. if(checknl==0 && birthday.GetLength()==10)
  1058. {
  1059. if(m_radio2==1)
  1060. {
  1061. CTime tm=GetTmFromStr(birthday);
  1062. int year=tm.GetYear ();
  1063. int month=tm.GetMonth ();
  1064. int day=tm.GetDay ();
  1065. tm+=CTimeSpan(28, 0, 0, 0);
  1066. while(1)
  1067. {
  1068. if(tm.GetDay ()>=day && (tm.GetMonth ()==month+1 || tm.GetYear ()==year+1) )break;
  1069. if(tm.GetMonth ()>month+1)
  1070. {
  1071. tm-=CTimeSpan(1, 0, 0, 0);
  1072. break;
  1073. }
  1074. tm+=CTimeSpan(1, 0, 0, 0);
  1075. }
  1076. CTimeSpan dt=tm-todaytm;
  1077. ndays=dt.GetDays();
  1078. days.Format("%d天后满月", ndays);
  1079. if(ndays==0)
  1080. days="今天满月";
  1081. }
  1082. else if(m_radio2==2)
  1083. {
  1084. CTime tm=GetTmFromStr(birthday);tm+=CTimeSpan(100, 0, 0, 0);
  1085. CTimeSpan dt=tm-todaytm;
  1086. ndays=dt.GetDays();
  1087. days.Format("%d天后满100天", ndays);
  1088. if(ndays==0)
  1089. days="今天满100天";
  1090. }
  1091. else
  1092. {
  1093. birthday=today.Left(4)+birthday.Right(6);
  1094. CTime tm=GetTmFromStr(birthday);
  1095. CTimeSpan dt=tm-todaytm;
  1096. ndays=dt.GetDays();
  1097. days.Format("%d天后生日", ndays);
  1098. if(ndays==0)
  1099. days="今天生日";
  1100. }
  1101. }
  1102. else if(birthday.GetLength()==10)
  1103. {
  1104. if(m_radio2==1)
  1105. {
  1106. CString birthdaynl=birthday;
  1107. int year=atoi(birthdaynl.Mid (0,4));
  1108. int month= atoi(birthdaynl.Mid (5,2));
  1109. int day= atoi(birthdaynl.Mid (8,2));
  1110. CovertDate3(birthday);
  1111. CTime tm=GetTmFromStr(birthday);
  1112. tm+=CTimeSpan(28, 0, 0, 0);
  1113. while(1)
  1114. {
  1115. birthday=tm.Format ("%Y-%m-%d");
  1116. CovertDate2(birthday);//转为农历
  1117. if(atoi(birthday.Mid (8,2)) >=day && (atoi(birthday.Mid (5,2))==month+1 || atoi(birthday.Mid (0,4))==year+1) )break;
  1118. if( atoi(birthday.Mid (5,2))>month+1)
  1119. {
  1120. tm-=CTimeSpan(1, 0, 0, 0);
  1121. break;
  1122. }
  1123. tm+=CTimeSpan(1, 0, 0, 0);
  1124. }
  1125. CTimeSpan dt=tm-todaytm;
  1126. ndays=dt.GetDays();
  1127. days.Format("%d天后满月", ndays);
  1128. if(ndays==0)
  1129. days="今天满月";
  1130. }
  1131. else if(m_radio2==2)
  1132. {
  1133. CovertDate3(birthday);
  1134. CTime tm=GetTmFromStr(birthday);tm+=CTimeSpan(100, 0, 0, 0);
  1135. CTimeSpan dt=tm-todaytm;
  1136. ndays=dt.GetDays();
  1137. days.Format("%d天后满100天", ndays);
  1138. if(ndays==0)
  1139. days="今天满100天";
  1140. }
  1141. else
  1142. {
  1143. birthday=todaynl.Left(4)+birthday.Right(6);
  1144. CovertDate3(birthday);
  1145. CTime tm=GetTmFromStr(birthday);
  1146. CTimeSpan dt=tm-todaytm;
  1147. ndays=dt.GetDays();
  1148. days.Format("%d天后生日", ndays);
  1149. if(ndays==0)
  1150. days="今天生日";
  1151. }
  1152. }
  1153. if(ndays<checkdays && ndays>=0)
  1154. {
  1155. m_List6array.SetSize( size+1, 1 );
  1156. m_List6array.ElementAt (size).Add(name);
  1157. m_List6array.ElementAt (size).Add(sex);
  1158. m_List6array.ElementAt (size).Add(birthdaybak);
  1159. if(checknl)
  1160. m_List6array.ElementAt (size).Add("农历");
  1161. else
  1162. m_List6array.ElementAt (size).Add("公历");
  1163. m_List6array.ElementAt (size).Add(clienttype);
  1164. m_List6array.ElementAt (size).Add(phone);
  1165. m_List6array.ElementAt (size).Add(days);
  1166. size++;
  1167. }
  1168. }
  1169. clienttype="意向客户";
  1170. for( i=0; i<List3array.GetSize(); i++)//
  1171. {
  1172. sex=List3array.ElementAt (i).ElementAt (2);
  1173. birthday=List3array.ElementAt (i).ElementAt (9);
  1174. birthdaybak=birthday;
  1175. checknl=atoi(List3array.ElementAt (i).ElementAt (13));
  1176. name=List3array.ElementAt (i).ElementAt (1);
  1177. phone=List3array.ElementAt (i).ElementAt (3);
  1178. ndays=-1;
  1179. if(checknl==0 && birthday.GetLength()==10)
  1180. {
  1181. if(m_radio2==1)
  1182. {
  1183. CTime tm=GetTmFromStr(birthday);
  1184. int year=tm.GetYear ();
  1185. int month=tm.GetMonth ();
  1186. int day=tm.GetDay ();
  1187. tm+=CTimeSpan(28, 0, 0, 0);
  1188. while(1)
  1189. {
  1190. if(tm.GetDay ()>=day && (tm.GetMonth ()==month+1 || tm.GetYear ()==year+1) )break;
  1191. if(tm.GetMonth ()>month+1)
  1192. {
  1193. tm-=CTimeSpan(1, 0, 0, 0);
  1194. break;
  1195. }
  1196. tm+=CTimeSpan(1, 0, 0, 0);
  1197. }
  1198. CTimeSpan dt=tm-todaytm;
  1199. ndays=dt.GetDays();
  1200. days.Format("%d天后满月", ndays);
  1201. if(ndays==0)
  1202. days="今天满月";
  1203. }
  1204. else if(m_radio2==2)
  1205. {
  1206. CTime tm=GetTmFromStr(birthday);tm+=CTimeSpan(100, 0, 0, 0);
  1207. CTimeSpan dt=tm-todaytm;
  1208. ndays=dt.GetDays();
  1209. days.Format("%d天后满100天", ndays);
  1210. if(ndays==0)
  1211. days="今天满100天";
  1212. }
  1213. else
  1214. {
  1215. birthday=today.Left(4)+birthday.Right(6);
  1216. CTime tm=GetTmFromStr(birthday);
  1217. CTimeSpan dt=tm-todaytm;
  1218. ndays=dt.GetDays();
  1219. days.Format("%d天后生日", ndays);
  1220. if(ndays==0)
  1221. days="今天生日";
  1222. }
  1223. }
  1224. else if(birthday.GetLength()==10)
  1225. {
  1226. if(m_radio2==1)
  1227. {
  1228. CString birthdaynl=birthday;
  1229. int year=atoi(birthdaynl.Mid (0,4));
  1230. int month= atoi(birthdaynl.Mid (5,2));
  1231. int day= atoi(birthdaynl.Mid (8,2));
  1232. CovertDate3(birthday);
  1233. CTime tm=GetTmFromStr(birthday);
  1234. tm+=CTimeSpan(28, 0, 0, 0);
  1235. while(1)
  1236. {
  1237. birthday=tm.Format ("%Y-%m-%d");
  1238. CovertDate2(birthday);//转为农历
  1239. if(atoi(birthday.Mid (8,2)) >=day && (atoi(birthday.Mid (5,2))==month+1 || atoi(birthday.Mid (0,4))==year+1) )break;
  1240. if( atoi(birthday.Mid (5,2))>month+1)
  1241. {
  1242. tm-=CTimeSpan(1, 0, 0, 0);
  1243. break;
  1244. }
  1245. tm+=CTimeSpan(1, 0, 0, 0);
  1246. }
  1247. CTimeSpan dt=tm-todaytm;
  1248. ndays=dt.GetDays();
  1249. days.Format("%d天后满月", ndays);
  1250. if(ndays==0)
  1251. days="今天满月";
  1252. }
  1253. else if(m_radio2==2)
  1254. {
  1255. CovertDate3(birthday);
  1256. CTime tm=GetTmFromStr(birthday);tm+=CTimeSpan(100, 0, 0, 0);
  1257. CTimeSpan dt=tm-todaytm;
  1258. ndays=dt.GetDays();
  1259. days.Format("%d天后满100天", ndays);
  1260. if(ndays==0)
  1261. days="今天满100天";
  1262. }
  1263. else
  1264. {
  1265. birthday=todaynl.Left(4)+birthday.Right(6);
  1266. CovertDate3(birthday);
  1267. CTime tm=GetTmFromStr(birthday);
  1268. CTimeSpan dt=tm-todaytm;
  1269. ndays=dt.GetDays();
  1270. days.Format("%d天后生日", ndays);
  1271. if(ndays==0)
  1272. days="今天生日";
  1273. }
  1274. }
  1275. if(ndays<checkdays && ndays>=0)
  1276. {
  1277. m_List6array.SetSize( size+1, 1 );
  1278. m_List6array.ElementAt (size).Add(name);
  1279. m_List6array.ElementAt (size).Add(sex);
  1280. m_List6array.ElementAt (size).Add(birthdaybak);
  1281. if(checknl)
  1282. m_List6array.ElementAt (size).Add("农历");
  1283. else
  1284. m_List6array.ElementAt (size).Add("公历");
  1285. m_List6array.ElementAt (size).Add(clienttype);
  1286. m_List6array.ElementAt (size).Add(phone);
  1287. m_List6array.ElementAt (size).Add(days);
  1288. size++;
  1289. }
  1290. }
  1291. #else//以下为婚纱版
  1292. int i;
  1293. try
  1294. {
  1295. for( i=0; i<List1array.GetSize(); i++)
  1296. {
  1297. sex="男";
  1298. name=List1array.ElementAt (i).ElementAt (0);
  1299. phone=List1array.ElementAt (i).ElementAt (2);
  1300. birthday=List1array.ElementAt (i).ElementAt (5);
  1301. birthdaybak=birthday;
  1302. checknl=atoi(List1array.ElementAt (i).ElementAt (10));
  1303. if(m_radio2==1 || m_radio2==2)
  1304. {
  1305. birthday=List1array.ElementAt (i).ElementAt (4);
  1306. birthdaybak=birthday;
  1307. checknl=atoi(List1array.ElementAt (i).ElementAt (12));
  1308. }
  1309. ndays=-1;
  1310. if(checknl==0 && birthday.GetLength()==10)
  1311. {
  1312. if(m_radio2==1)
  1313. {
  1314. CTime tm=GetTmFromStr(birthday);
  1315. CTimeSpan dt=tm-todaytm;
  1316. ndays=dt.GetDays();
  1317. days.Format("%d天后结婚", ndays);
  1318. if(ndays==0)
  1319. days="今天结婚";
  1320. }
  1321. else if(m_radio2==2)
  1322. {
  1323. if(today.Left(4)<=birthday.Left (4))continue;
  1324. birthday=today.Left(4)+birthday.Right(6);
  1325. CTime tm=GetTmFromStr(birthday);
  1326. CTimeSpan dt=tm-todaytm;
  1327. ndays=dt.GetDays();
  1328. days.Format("%d天后结婚纪念日", ndays);
  1329. if(ndays==0)
  1330. days="今天结婚纪念日";
  1331. }
  1332. else
  1333. {
  1334. birthday=today.Left(4)+birthday.Right(6);
  1335. CTime tm=GetTmFromStr(birthday);
  1336. CTimeSpan dt=tm-todaytm;
  1337. ndays=dt.GetDays();
  1338. days.Format("%d天后生日", ndays);
  1339. if(ndays==0)
  1340. days="今天生日";
  1341. }
  1342. }
  1343. else if(birthday.GetLength()==10)
  1344. {
  1345. if(m_radio2==1)
  1346. {
  1347. CovertDate3(birthday);
  1348. CTime tm=GetTmFromStr(birthday);
  1349. CTimeSpan dt=tm-todaytm;
  1350. ndays=dt.GetDays();
  1351. days.Format("%d天后结婚", ndays);
  1352. if(ndays==0)
  1353. days="今天结婚";
  1354. }
  1355. else if(m_radio2==2)
  1356. {
  1357. if(todaynl.Left(4)<=birthday.Left (4))continue;
  1358. birthday=todaynl.Left(4)+birthday.Right(6);
  1359. CovertDate3(birthday);
  1360. CTime tm=GetTmFromStr(birthday);
  1361. CTimeSpan dt=tm-todaytm;
  1362. ndays=dt.GetDays();
  1363. days.Format("%d天后结婚纪念日", ndays);
  1364. if(ndays==0)
  1365. days="今天结婚纪念日";
  1366. }
  1367. else
  1368. {
  1369. birthday=todaynl.Left(4)+birthday.Right(6);
  1370. CovertDate3(birthday);
  1371. CTime tm=GetTmFromStr(birthday);
  1372. CTimeSpan dt=tm-todaytm;
  1373. ndays=dt.GetDays();
  1374. days.Format("%d天后生日", ndays);
  1375. if(ndays==0)
  1376. days="今天生日";
  1377. }
  1378. }
  1379. if(ndays<checkdays && ndays>=0 && name!="")
  1380. {
  1381. m_List6array.SetSize( size+1, 1 );
  1382. m_List6array.ElementAt (size).Add(name);
  1383. m_List6array.ElementAt (size).Add(sex);
  1384. m_List6array.ElementAt (size).Add(birthdaybak);
  1385. if(checknl)
  1386. m_List6array.ElementAt (size).Add("农历");
  1387. else
  1388. m_List6array.ElementAt (size).Add("公历");
  1389. m_List6array.ElementAt (size).Add(clienttype);
  1390. m_List6array.ElementAt (size).Add(phone);
  1391. m_List6array.ElementAt (size).Add(days);
  1392. size++;
  1393. }
  1394. sex="女";
  1395. name=List1array.ElementAt (i).ElementAt (1);
  1396. phone=List1array.ElementAt (i).ElementAt (3);
  1397. birthday=List1array.ElementAt (i).ElementAt (6);
  1398. birthdaybak=birthday;
  1399. checknl=atoi(List1array.ElementAt (i).ElementAt (11));
  1400. if(m_radio2==1 || m_radio2==2)
  1401. {
  1402. birthday=List1array.ElementAt (i).ElementAt (4);
  1403. birthdaybak=birthday;
  1404. checknl=atoi(List1array.ElementAt (i).ElementAt (12));
  1405. }
  1406. ndays=-1;
  1407. if(checknl==0 && birthday.GetLength()==10)
  1408. {
  1409. if(m_radio2==1)
  1410. {
  1411. CTime tm=GetTmFromStr(birthday);
  1412. CTimeSpan dt=tm-todaytm;
  1413. ndays=dt.GetDays();
  1414. days.Format("%d天后结婚", ndays);
  1415. if(ndays==0)
  1416. days="今天结婚";
  1417. }
  1418. else if(m_radio2==2)
  1419. {
  1420. if(today.Left(4)<=birthday.Left (4))continue;
  1421. birthday=today.Left(4)+birthday.Right(6);
  1422. CTime tm=GetTmFromStr(birthday);
  1423. CTimeSpan dt=tm-todaytm;
  1424. ndays=dt.GetDays();
  1425. days.Format("%d天后结婚纪念日", ndays);
  1426. if(ndays==0)
  1427. days="今天结婚纪念日";
  1428. }
  1429. else
  1430. {
  1431. birthday=today.Left(4)+birthday.Right(6);
  1432. CTime tm=GetTmFromStr(birthday);
  1433. CTimeSpan dt=tm-todaytm;
  1434. ndays=dt.GetDays();
  1435. days.Format("%d天后生日", ndays);
  1436. if(ndays==0)
  1437. days="今天生日";
  1438. }
  1439. }
  1440. else if(birthday.GetLength()==10)
  1441. {
  1442. if(m_radio2==1)
  1443. {
  1444. CovertDate3(birthday);
  1445. CTime tm=GetTmFromStr(birthday);
  1446. CTimeSpan dt=tm-todaytm;
  1447. ndays=dt.GetDays();
  1448. days.Format("%d天后结婚", ndays);
  1449. if(ndays==0)
  1450. days="今天结婚";
  1451. }
  1452. else if(m_radio2==2)
  1453. {
  1454. if(todaynl.Left(4)<=birthday.Left (4))continue;
  1455. birthday=todaynl.Left(4)+birthday.Right(6);
  1456. CovertDate3(birthday);
  1457. CTime tm=GetTmFromStr(birthday);
  1458. CTimeSpan dt=tm-todaytm;
  1459. ndays=dt.GetDays();
  1460. days.Format("%d天后结婚纪念日", ndays);
  1461. if(ndays==0)
  1462. days="今天结婚纪念日";
  1463. }
  1464. else
  1465. {
  1466. birthday=todaynl.Left(4)+birthday.Right(6);
  1467. CovertDate3(birthday);
  1468. CTime tm=GetTmFromStr(birthday);
  1469. CTimeSpan dt=tm-todaytm;
  1470. ndays=dt.GetDays();
  1471. days.Format("%d天后生日", ndays);
  1472. if(ndays==0)
  1473. days="今天生日";
  1474. }
  1475. }
  1476. if(ndays<checkdays && ndays>=0 && name!="")
  1477. {
  1478. m_List6array.SetSize( size+1, 1 );
  1479. m_List6array.ElementAt (size).Add(name);
  1480. m_List6array.ElementAt (size).Add(sex);
  1481. m_List6array.ElementAt (size).Add(birthdaybak);
  1482. if(checknl)
  1483. m_List6array.ElementAt (size).Add("农历");
  1484. else
  1485. m_List6array.ElementAt (size).Add("公历");
  1486. m_List6array.ElementAt (size).Add(clienttype);
  1487. m_List6array.ElementAt (size).Add(phone);
  1488. m_List6array.ElementAt (size).Add(days);
  1489. size++;
  1490. }
  1491. }
  1492. }
  1493. catch(...)
  1494. {
  1495. MessageBox(name+birthday);
  1496. }
  1497. clienttype="老客户";
  1498. for( i=0; i<List2array.GetSize(); i++)
  1499. {
  1500. sex="男";
  1501. name=List2array.ElementAt (i).ElementAt (1);
  1502. phone=List2array.ElementAt (i).ElementAt (3);
  1503. birthday=List2array.ElementAt (i).ElementAt (7);
  1504. birthdaybak=birthday;
  1505. checknl=atoi(List2array.ElementAt (i).ElementAt (17));
  1506. if(m_radio2==1 || m_radio2==2)
  1507. {
  1508. birthday=List2array.ElementAt (i).ElementAt (9);
  1509. birthdaybak=birthday;
  1510. checknl=atoi(List2array.ElementAt (i).ElementAt (19));
  1511. }
  1512. ndays=-1;
  1513. if(checknl==0 && birthday.GetLength()==10)
  1514. {
  1515. if(m_radio2==1)
  1516. {
  1517. CTime tm=GetTmFromStr(birthday);
  1518. CTimeSpan dt=tm-todaytm;
  1519. ndays=dt.GetDays();
  1520. days.Format("%d天后结婚", ndays);
  1521. if(ndays==0)
  1522. days="今天结婚";
  1523. }
  1524. else if(m_radio2==2)
  1525. {
  1526. if(today.Left(4)<=birthday.Left (4))continue;
  1527. birthday=today.Left(4)+birthday.Right(6);
  1528. CTime tm=GetTmFromStr(birthday);
  1529. CTimeSpan dt=tm-todaytm;
  1530. ndays=dt.GetDays();
  1531. days.Format("%d天后结婚纪念日", ndays);
  1532. if(ndays==0)
  1533. days="今天结婚纪念日";
  1534. }
  1535. else
  1536. {
  1537. birthday=today.Left(4)+birthday.Right(6);
  1538. CTime tm=GetTmFromStr(birthday);
  1539. CTimeSpan dt=tm-todaytm;
  1540. ndays=dt.GetDays();
  1541. days.Format("%d天后生日", ndays);
  1542. if(ndays==0)
  1543. days="今天生日";
  1544. }
  1545. }
  1546. else if(birthday.GetLength()==10)
  1547. {
  1548. if(m_radio2==1)
  1549. {
  1550. CovertDate3(birthday);
  1551. CTime tm=GetTmFromStr(birthday);
  1552. CTimeSpan dt=tm-todaytm;
  1553. ndays=dt.GetDays();
  1554. days.Format("%d天后结婚", ndays);
  1555. if(ndays==0)
  1556. days="今天结婚";
  1557. }
  1558. else if(m_radio2==2)
  1559. {
  1560. if(todaynl.Left(4)<=birthday.Left (4))continue;
  1561. birthday=todaynl.Left(4)+birthday.Right(6);
  1562. CovertDate3(birthday);
  1563. CTime tm=GetTmFromStr(birthday);
  1564. CTimeSpan dt=tm-todaytm;
  1565. ndays=dt.GetDays();
  1566. days.Format("%d天后结婚纪念日", ndays);
  1567. if(ndays==0)
  1568. days="今天结婚纪念日";
  1569. }
  1570. else
  1571. {
  1572. birthday=todaynl.Left(4)+birthday.Right(6);
  1573. CovertDate3(birthday);
  1574. CTime tm=GetTmFromStr(birthday);
  1575. CTimeSpan dt=tm-todaytm;
  1576. ndays=dt.GetDays();
  1577. days.Format("%d天后生日", ndays);
  1578. if(ndays==0)
  1579. days="今天生日";
  1580. }
  1581. }
  1582. if(ndays<checkdays && ndays>=0 && name!="")
  1583. {
  1584. m_List6array.SetSize( size+1, 1 );
  1585. m_List6array.ElementAt (size).Add(name);
  1586. m_List6array.ElementAt (size).Add(sex);
  1587. m_List6array.ElementAt (size).Add(birthdaybak);
  1588. if(checknl)
  1589. m_List6array.ElementAt (size).Add("农历");
  1590. else
  1591. m_List6array.ElementAt (size).Add("公历");
  1592. m_List6array.ElementAt (size).Add(clienttype);
  1593. m_List6array.ElementAt (size).Add(phone);
  1594. m_List6array.ElementAt (size).Add(days);
  1595. size++;
  1596. }
  1597. sex="女";
  1598. name=List2array.ElementAt (i).ElementAt (2);
  1599. phone=List2array.ElementAt (i).ElementAt (4);
  1600. birthday=List2array.ElementAt (i).ElementAt (8);
  1601. birthdaybak=birthday;
  1602. checknl=atoi(List2array.ElementAt (i).ElementAt (18));
  1603. if(m_radio2==1 || m_radio2==2)
  1604. {
  1605. birthday=List2array.ElementAt (i).ElementAt (9);
  1606. birthdaybak=birthday;
  1607. checknl=atoi(List2array.ElementAt (i).ElementAt (19));
  1608. }
  1609. ndays=-1;
  1610. if(checknl==0 && birthday.GetLength()==10)
  1611. {
  1612. if(m_radio2==1)
  1613. {
  1614. CTime tm=GetTmFromStr(birthday);
  1615. CTimeSpan dt=tm-todaytm;
  1616. ndays=dt.GetDays();
  1617. days.Format("%d天后结婚", ndays);
  1618. if(ndays==0)
  1619. days="今天结婚";
  1620. }
  1621. else if(m_radio2==2)
  1622. {
  1623. if(today.Left(4)<=birthday.Left (4))continue;
  1624. birthday=today.Left(4)+birthday.Right(6);
  1625. CTime tm=GetTmFromStr(birthday);
  1626. CTimeSpan dt=tm-todaytm;
  1627. ndays=dt.GetDays();
  1628. days.Format("%d天后结婚纪念日", ndays);
  1629. if(ndays==0)
  1630. days="今天结婚纪念日";
  1631. }
  1632. else
  1633. {
  1634. birthday=today.Left(4)+birthday.Right(6);
  1635. CTime tm=GetTmFromStr(birthday);
  1636. CTimeSpan dt=tm-todaytm;
  1637. ndays=dt.GetDays();
  1638. days.Format("%d天后生日", ndays);
  1639. if(ndays==0)
  1640. days="今天生日";
  1641. }
  1642. }
  1643. else if(birthday.GetLength()==10)
  1644. {
  1645. if(m_radio2==1)
  1646. {
  1647. CovertDate3(birthday);
  1648. CTime tm=GetTmFromStr(birthday);
  1649. CTimeSpan dt=tm-todaytm;
  1650. ndays=dt.GetDays();
  1651. days.Format("%d天后结婚", ndays);
  1652. if(ndays==0)
  1653. days="今天结婚";
  1654. }
  1655. else if(m_radio2==2)
  1656. {
  1657. if(todaynl.Left(4)<=birthday.Left (4))continue;
  1658. birthday=todaynl.Left(4)+birthday.Right(6);
  1659. CovertDate3(birthday);
  1660. CTime tm=GetTmFromStr(birthday);
  1661. CTimeSpan dt=tm-todaytm;
  1662. ndays=dt.GetDays();
  1663. days.Format("%d天后结婚纪念日", ndays);
  1664. if(ndays==0)
  1665. days="今天结婚纪念日";
  1666. }
  1667. else
  1668. {
  1669. birthday=todaynl.Left(4)+birthday.Right(6);
  1670. CovertDate3(birthday);
  1671. CTime tm=GetTmFromStr(birthday);
  1672. CTimeSpan dt=tm-todaytm;
  1673. ndays=dt.GetDays();
  1674. days.Format("%d天后生日", ndays);
  1675. if(ndays==0)
  1676. days="今天生日";
  1677. }
  1678. }
  1679. if(ndays<checkdays && ndays>=0 && name!="")
  1680. {
  1681. m_List6array.SetSize( size+1, 1 );
  1682. m_List6array.ElementAt (size).Add(name);
  1683. m_List6array.ElementAt (size).Add(sex);
  1684. m_List6array.ElementAt (size).Add(birthdaybak);
  1685. if(checknl)
  1686. m_List6array.ElementAt (size).Add("农历");
  1687. else
  1688. m_List6array.ElementAt (size).Add("公历");
  1689. m_List6array.ElementAt (size).Add(clienttype);
  1690. m_List6array.ElementAt (size).Add(phone);
  1691. m_List6array.ElementAt (size).Add(days);
  1692. size++;
  1693. }
  1694. }
  1695. clienttype="意向客户";
  1696. for( i=0; i<List3array.GetSize(); i++)//
  1697. {
  1698. sex=List3array.ElementAt (i).ElementAt (2);
  1699. birthday=List3array.ElementAt (i).ElementAt (9);
  1700. birthdaybak=birthday;
  1701. checknl=atoi(List3array.ElementAt (i).ElementAt (13));
  1702. name=List3array.ElementAt (i).ElementAt (1);
  1703. phone=List3array.ElementAt (i).ElementAt (3);
  1704. if(m_radio2==1 || m_radio2==2)
  1705. {
  1706. break;
  1707. }
  1708. ndays=-1;
  1709. if(checknl==0 && birthday.GetLength()==10)
  1710. {
  1711. birthday=today.Left(4)+birthday.Right(6);
  1712. CTime tm=GetTmFromStr(birthday);
  1713. CTimeSpan dt=tm-todaytm;
  1714. ndays=dt.GetDays();
  1715. days.Format("%d天后生日", ndays);
  1716. if(ndays==0)
  1717. days="今天生日";
  1718. }
  1719. else if(birthday.GetLength()==10)
  1720. {
  1721. birthday=todaynl.Left(4)+birthday.Right(6);
  1722. CovertDate3(birthday);
  1723. CTime tm=GetTmFromStr(birthday);
  1724. CTimeSpan dt=tm-todaytm;
  1725. ndays=dt.GetDays();
  1726. days.Format("%d天后生日", ndays);
  1727. if(ndays==0)
  1728. days="今天生日";
  1729. }
  1730. if(ndays<checkdays && ndays>=0)
  1731. {
  1732. m_List6array.SetSize( size+1, 1 );
  1733. m_List6array.ElementAt (size).Add(name);
  1734. m_List6array.ElementAt (size).Add(sex);
  1735. m_List6array.ElementAt (size).Add(birthdaybak);
  1736. if(checknl)
  1737. m_List6array.ElementAt (size).Add("农历");
  1738. else
  1739. m_List6array.ElementAt (size).Add("公历");
  1740. m_List6array.ElementAt (size).Add(clienttype);
  1741. m_List6array.ElementAt (size).Add(phone);
  1742. m_List6array.ElementAt (size).Add(days);
  1743. size++;
  1744. }
  1745. }
  1746. #endif
  1747. /* g_sendhead.bsql=0;
  1748. g_sendhead.code[0]=135;
  1749. g_sendhead.code[1]=136;
  1750. g_sendhead.tabcount=2;
  1751. CString sql;
  1752. sql.Format ("time5>='"+strdate+"' and time5<='"+strdate2+"' and [status3]='未取'");
  1753. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  1754. DataToArray(&m_List6array,&g_List1array);
  1755. for(int i=0; i<g_List1array.GetSize (); i++)
  1756. {
  1757. for(int j=0; j<m_List6array.GetSize (); j++)
  1758. {
  1759. if(g_List1array.ElementAt (i).ElementAt (0)==m_List6array.ElementAt (j).ElementAt (0))
  1760. {
  1761. if(g_List1array.ElementAt (i).ElementAt (1)!="" && g_List1array.ElementAt (i).ElementAt (3)!="" && g_List1array.ElementAt (i).ElementAt (5)!="")
  1762. {
  1763. m_List6array.ElementAt (j).SetAt (4, "已安排");
  1764. }
  1765. else
  1766. {
  1767. m_List6array.ElementAt (j).SetAt (4, m_List6array.ElementAt (j).ElementAt (4)+g_List1array.ElementAt (i).ElementAt (1));
  1768. m_List6array.ElementAt (j).SetAt (6, m_List6array.ElementAt (j).ElementAt (6)+g_List1array.ElementAt (i).ElementAt (3));
  1769. m_List6array.ElementAt (j).SetAt (7, m_List6array.ElementAt (j).ElementAt (7)+g_List1array.ElementAt (i).ElementAt (5));
  1770. }
  1771. }
  1772. }
  1773. }
  1774. for( i=m_List6array.GetSize ()-1; i>=0; i--)
  1775. {
  1776. if(m_List6array.ElementAt (i).ElementAt (4)=="已安排")
  1777. m_List6array.RemoveAt(i);
  1778. }
  1779. qsort( static_cast<void*>(&m_List6array[0]), m_List6array.GetSize (), sizeof(m_List6array[0]), CompareByLabel3 );
  1780. */
  1781. }
  1782. HidePrice();
  1783. FillGrid();
  1784. m_spinyear.EnableWindow(1);
  1785. m_spinmonth.EnableWindow(1);
  1786. m_spinday.EnableWindow(1);
  1787. }
  1788. void TodayForm::OnCheck1()
  1789. {
  1790. // TODO: Add your control notification handler code here
  1791. UpdateData();
  1792. m_check2=0; UpdateData(false);
  1793. DateChange();
  1794. }
  1795. void TodayForm::OnCheck2()
  1796. {
  1797. // TODO: Add your control notification handler code here
  1798. UpdateData();
  1799. m_check=0; UpdateData(false);
  1800. DateChange();
  1801. }
  1802. void TodayForm::OnChangeEDITyear()
  1803. {
  1804. // TODO: If this is a RICHEDIT control, the control will not
  1805. // send this notification unless you override the MyFormView::OnInitDialog()
  1806. // function and call CRichEditCtrl().SetEventMask()
  1807. // with the ENM_CHANGE flag ORed into the mask.
  1808. DateChange(); GetCalendarData();
  1809. // TODO: Add your control notification handler code here
  1810. }
  1811. void TodayForm::OnChangeEDITmonth()
  1812. {
  1813. // TODO: If this is a RICHEDIT control, the control will not
  1814. // send this notification unless you override the MyFormView::OnInitDialog()
  1815. // function and call CRichEditCtrl().SetEventMask()
  1816. // with the ENM_CHANGE flag ORed into the mask.
  1817. DateChange(); GetCalendarData();
  1818. // TODO: Add your control notification handler code here
  1819. }
  1820. void TodayForm::OnChangeEDITday()
  1821. {
  1822. // TODO: If this is a RICHEDIT control, the control will not
  1823. // send this notification unless you override the MyFormView::OnInitDialog()
  1824. // function and call CRichEditCtrl().SetEventMask()
  1825. // with the ENM_CHANGE flag ORed into the mask.
  1826. DateChange();
  1827. if(m_bInit==0)return;
  1828. if(m_bShowCalendar==0)return;
  1829. UpdateData();
  1830. m_CalendarFrm.DateChange2(m_year, m_month, m_day);
  1831. m_CalendarFrm.m_oCalendar.Invalidate ();
  1832. // TODO: Add your control notification handler code her
  1833. }
  1834. void TodayForm::OnRadio3() //拍照客人;
  1835. {
  1836. // TODO: Add your control notification handler code here
  1837. OnRadio8();
  1838. }
  1839. void TodayForm::OnRadio4()
  1840. {
  1841. // TODO: Add your control notification handler code here
  1842. OnRadio8();
  1843. }
  1844. void TodayForm::OnRadio5()
  1845. {
  1846. // TODO: Add your control notification handler code here
  1847. OnRadio8();
  1848. }
  1849. void TodayForm::OnRadio6()
  1850. {
  1851. // TODO: Add your control notification handler code here
  1852. OnRadio8();
  1853. }
  1854. void TodayForm::OnRadio7()
  1855. {
  1856. // TODO: Add your control notification handler code here
  1857. OnRadio8();
  1858. }
  1859. void TodayForm::OnRadio8()
  1860. {
  1861. // TODO: Add your control notification handler code here
  1862. UpdateData();
  1863. if(m_radio==6)
  1864. {
  1865. m_List1.ShowWindow (SW_HIDE);
  1866. m_List2.ShowWindow (SW_HIDE);
  1867. m_List3.ShowWindow (SW_HIDE);
  1868. m_List4.ShowWindow (SW_HIDE);
  1869. m_List5.ShowWindow (SW_HIDE);
  1870. m_List6.ShowWindow (SW_HIDE);
  1871. m_CalendarFrm.ShowWindow (SW_HIDE);
  1872. m_table.ShowWindow(SW_SHOW);
  1873. m_childdlg.ShowWindow(SW_SHOW);
  1874. m_scrollbar.ShowWindow(SW_SHOW);
  1875. DateChange();
  1876. return;
  1877. }
  1878. m_table.ShowWindow(SW_HIDE);
  1879. m_childdlg.ShowWindow(SW_HIDE);
  1880. m_scrollbar.ShowWindow(SW_HIDE);
  1881. if(m_bShowCalendar)
  1882. {
  1883. m_List1.ShowWindow (SW_HIDE);
  1884. m_List2.ShowWindow (SW_HIDE);
  1885. m_List3.ShowWindow (SW_HIDE);
  1886. m_List4.ShowWindow (SW_HIDE);
  1887. m_List5.ShowWindow (SW_HIDE);
  1888. m_List6.ShowWindow (SW_HIDE);
  1889. m_CalendarFrm.ShowWindow (SW_SHOW);
  1890. if(m_radio==5)
  1891. {
  1892. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0);
  1893. GetDlgItem(IDC_BUTall)->ShowWindow(0);
  1894. GetDlgItem(IDC_BUTtake3)->ShowWindow(0);
  1895. GetDlgItem(IDC_BUTtake)->ShowWindow(0);
  1896. GetDlgItem(IDC_BUTchoose)->ShowWindow(0);
  1897. GetDlgItem(IDC_RADIO9)->ShowWindow(1);
  1898. GetDlgItem(IDC_RADIO14)->ShowWindow(1);
  1899. GetDlgItem(IDC_RADIO15)->ShowWindow(1);
  1900. }
  1901. else if(m_radio==6 )
  1902. {
  1903. m_childdlg.m_table.ModeChange(10);
  1904. m_table.ModeChange(10);
  1905. m_table.Test2 ();
  1906. m_table.ShowWindow(SW_SHOW);
  1907. m_childdlg.ShowWindow(SW_SHOW);
  1908. m_scrollbar.ShowWindow(SW_SHOW);
  1909. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0);
  1910. GetDlgItem(IDC_BUTall)->ShowWindow(0);
  1911. GetDlgItem(IDC_BUTtake3)->ShowWindow(0);
  1912. GetDlgItem(IDC_BUTtake)->ShowWindow(1);
  1913. GetDlgItem(IDC_BUTchoose)->ShowWindow(1);
  1914. GetDlgItem(IDC_BUTtake)->SetWindowText("另约日期");
  1915. GetDlgItem(IDC_BUTchoose)->SetWindowText("取消预约");
  1916. GetDlgItem(IDC_RADIO9)->ShowWindow(0);
  1917. GetDlgItem(IDC_RADIO14)->ShowWindow(0);
  1918. GetDlgItem(IDC_RADIO15)->ShowWindow(0);
  1919. }
  1920. else
  1921. {
  1922. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(1);
  1923. if(!g_bAllBranch)GetDlgItem(IDC_BUTall)->ShowWindow(1);
  1924. GetDlgItem(IDC_BUTtake3)->ShowWindow(1);
  1925. GetDlgItem(IDC_BUTtake)->ShowWindow(1);
  1926. GetDlgItem(IDC_BUTchoose)->ShowWindow(1);
  1927. GetDlgItem(IDC_BUTtake)->SetWindowText("客人预约");
  1928. GetDlgItem(IDC_BUTchoose)->SetWindowText("重新安排");
  1929. GetDlgItem(IDC_RADIO9)->ShowWindow(0);
  1930. GetDlgItem(IDC_RADIO14)->ShowWindow(0);
  1931. GetDlgItem(IDC_RADIO15)->ShowWindow(0);
  1932. }
  1933. }
  1934. else
  1935. {
  1936. m_CalendarFrm.ShowWindow (SW_HIDE);
  1937. }
  1938. // if(m_bShowCalendar)
  1939. // OnBUTall();
  1940. // else
  1941. DateChange();
  1942. }
  1943. void TodayForm::OnBUTtake() // 客人预约按钮;
  1944. {
  1945. // TODO: Add your control notification handler code here
  1946. if(IsHasRights2new(2)==0)return;
  1947. UpdateData();
  1948. if(m_radio==6)
  1949. {
  1950. m_childdlg.OtherDate();
  1951. return;
  1952. }
  1953. if(m_radio==0) // 拍照客人预约;
  1954. {
  1955. TakeControlDlg1 dlg;
  1956. dlg.DoModal ();
  1957. if(g_bAllBranch)
  1958. {
  1959. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  1960. }
  1961. DateChange();
  1962. GetCalendarData();
  1963. }
  1964. else if(m_radio==1) // 选片客人预约;
  1965. {
  1966. TakeControlDlg2 dlg;
  1967. dlg.DoModal ();
  1968. if(g_bAllBranch)
  1969. {
  1970. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  1971. }
  1972. DateChange();
  1973. GetCalendarData();
  1974. }
  1975. else if(m_radio==2) // 看设计客人预约;
  1976. {
  1977. TakeControlDlg3 dlg;
  1978. dlg.DoModal ();
  1979. if(g_bAllBranch)
  1980. {
  1981. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  1982. }
  1983. DateChange();GetCalendarData();
  1984. }
  1985. else if(m_radio==3) // 取件客人预约;
  1986. {
  1987. TakeControlDlg4 dlg;
  1988. dlg.DoModal ();
  1989. if(g_bAllBranch)
  1990. {
  1991. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  1992. }
  1993. DateChange();GetCalendarData();
  1994. }
  1995. else if(m_radio==4)
  1996. {
  1997. TakeControlDlg9 dlg;
  1998. dlg.DoModal ();
  1999. if(g_bAllBranch)
  2000. {
  2001. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  2002. }
  2003. DateChange();GetCalendarData();
  2004. }
  2005. }
  2006. void TodayForm::OnBUTchoose() //重新安排
  2007. {
  2008. // TODO: Add your control notification handler code here
  2009. if(IsHasRights2new(2)==0)return;
  2010. UpdateData();
  2011. if(m_radio==6)
  2012. {
  2013. m_childdlg.DeleteCur();
  2014. return;
  2015. }
  2016. if(m_radio==0)
  2017. {
  2018. POSITION pos;
  2019. pos=m_List1.GetFirstSelectedItemPosition();
  2020. if(pos==NULL)
  2021. {
  2022. AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
  2023. return;
  2024. }
  2025. int iItem=m_List1.GetNextSelectedItem(pos);
  2026. CString id=m_List1.GetItemText (iItem, 0+m_nAdd);
  2027. TakeControlDlg1 dlg;
  2028. if(g_bAllBranch)
  2029. dlg.m_branch=m_List1.GetItemText (iItem, 0);
  2030. dlg.id=id;
  2031. dlg.m_bModify=1;
  2032. dlg.DoModal ();
  2033. if(g_bAllBranch)
  2034. {
  2035. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  2036. }
  2037. DateChange();GetCalendarData();
  2038. }
  2039. else if(m_radio==1)
  2040. {
  2041. POSITION pos;
  2042. pos=m_List2.GetFirstSelectedItemPosition();
  2043. if(pos==NULL)
  2044. {
  2045. AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
  2046. return;
  2047. }
  2048. int iItem=m_List2.GetNextSelectedItem(pos);
  2049. CString id=m_List2.GetItemText (iItem, 0+m_nAdd);
  2050. TakeControlDlg2 dlg;
  2051. if(g_bAllBranch)
  2052. dlg.m_branch=m_List2.GetItemText (iItem, 0);
  2053. dlg.id=id;
  2054. dlg.m_bModify=1;
  2055. dlg.DoModal ();
  2056. if(g_bAllBranch)
  2057. {
  2058. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  2059. }
  2060. DateChange();GetCalendarData();
  2061. }
  2062. else if(m_radio==2)
  2063. {
  2064. POSITION pos;
  2065. pos=m_List3.GetFirstSelectedItemPosition();
  2066. if(pos==NULL)
  2067. {
  2068. AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
  2069. return;
  2070. }
  2071. int iItem=m_List3.GetNextSelectedItem(pos);
  2072. CString id=m_List3.GetItemText (iItem, 0+m_nAdd);
  2073. TakeControlDlg3 dlg;
  2074. if(g_bAllBranch)
  2075. dlg.m_branch=m_List3.GetItemText (iItem, 0);
  2076. dlg.id=id;
  2077. dlg.m_bModify=1;
  2078. dlg.DoModal ();
  2079. if(g_bAllBranch)
  2080. {
  2081. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  2082. }
  2083. DateChange();GetCalendarData();
  2084. }
  2085. else if(m_radio==3)
  2086. {
  2087. POSITION pos;
  2088. pos=m_List4.GetFirstSelectedItemPosition();
  2089. if(pos==NULL)
  2090. {
  2091. AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
  2092. return;
  2093. }
  2094. int iItem=m_List4.GetNextSelectedItem(pos);
  2095. CString id=m_List4.GetItemText (iItem, 0+m_nAdd);
  2096. TakeControlDlg4 dlg;
  2097. if(g_bAllBranch)
  2098. dlg.m_branch=m_List4.GetItemText (iItem, 0);
  2099. dlg.id=id;
  2100. dlg.m_bModify=1;
  2101. dlg.DoModal ();
  2102. if(g_bAllBranch)
  2103. {
  2104. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  2105. }
  2106. DateChange();GetCalendarData();
  2107. }
  2108. else if(m_radio==4)
  2109. {
  2110. POSITION pos;
  2111. pos=m_List5.GetFirstSelectedItemPosition();
  2112. if(pos==NULL)
  2113. {
  2114. AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
  2115. return;
  2116. }
  2117. int iItem=m_List5.GetNextSelectedItem(pos);
  2118. CString id=m_List5.GetItemText (iItem, 0+m_nAdd);
  2119. while(id=="")
  2120. {
  2121. iItem--;
  2122. id=m_List5.GetItemText (iItem, 0+m_nAdd);
  2123. }
  2124. TakeControlDlg9 dlg;
  2125. if(g_bAllBranch)
  2126. dlg.m_branch=m_List5.GetItemText (iItem, 0);
  2127. dlg.id=id;
  2128. dlg.m_bModify=1;
  2129. dlg.DoModal ();
  2130. if(g_bAllBranch)
  2131. {
  2132. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  2133. }
  2134. DateChange();GetCalendarData();
  2135. }
  2136. }
  2137. void TodayForm::OnCustomdrawList4 ( NMHDR* pNMHDR, LRESULT* pResult )
  2138. {
  2139. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  2140. // Take the default processing unless we set this to something else below.
  2141. *pResult = 0;
  2142. // First thing - check the draw stage. If it's the control's prepaint
  2143. // stage, then tell Windows we want messages for every item.
  2144. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  2145. {
  2146. *pResult = CDRF_NOTIFYITEMDRAW;
  2147. }
  2148. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  2149. {
  2150. // This is the prepaint stage for an item. Here's where we set the
  2151. // item's text color. Our return value will tell Windows to draw the
  2152. // item itself, but it will use the new color we set here.
  2153. // We'll cycle the colors through red, green, and light blue.
  2154. #ifdef CHILD_VERSION
  2155. if(m_List4.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (8+m_nAdd)!="OK")
  2156. #else
  2157. if(m_List4.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (9+m_nAdd)!="OK")
  2158. #endif
  2159. pLVCD->clrText = RGB(220,0,0);
  2160. else
  2161. pLVCD->clrText = RGB(20,133,20);
  2162. if(pLVCD->nmcd.dwItemSpec%2)
  2163. pLVCD->clrTextBk = g_gridcol1;
  2164. else
  2165. pLVCD->clrTextBk = g_gridcol2;
  2166. // Store the color back in the NMLVCUSTOMDRAW struct.
  2167. // Tell Windows to paint the control itself.
  2168. *pResult = CDRF_DODEFAULT;
  2169. }
  2170. }
  2171. void TodayForm::OnCustomdrawList3 ( NMHDR* pNMHDR, LRESULT* pResult )
  2172. {
  2173. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  2174. // Take the default processing unless we set this to something else below.
  2175. *pResult = 0;
  2176. // First thing - check the draw stage. If it's the control's prepaint
  2177. // stage, then tell Windows we want messages for every item.
  2178. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  2179. {
  2180. *pResult = CDRF_NOTIFYITEMDRAW;
  2181. }
  2182. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  2183. {
  2184. // This is the prepaint stage for an item. Here's where we set the
  2185. // item's text color. Our return value will tell Windows to draw the
  2186. // item itself, but it will use the new color we set here.
  2187. // We'll cycle the colors through red, green, and light blue.
  2188. #ifdef CHILD_VERSION
  2189. 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")
  2190. #else
  2191. 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")
  2192. #endif
  2193. {
  2194. pLVCD->clrText = RGB(220,0,0);
  2195. }
  2196. else
  2197. {
  2198. pLVCD->clrText = RGB(20,133,20);
  2199. }
  2200. if(pLVCD->nmcd.dwItemSpec%2)
  2201. pLVCD->clrTextBk = g_gridcol1;
  2202. else
  2203. pLVCD->clrTextBk = g_gridcol2;
  2204. // Store the color back in the NMLVCUSTOMDRAW struct.
  2205. // Tell Windows to paint the control itself.
  2206. *pResult = CDRF_DODEFAULT;
  2207. }
  2208. }
  2209. void TodayForm::OnBUTmsg() //短信;
  2210. {
  2211. // TODO: Add your control notification handler code here
  2212. UpdateData();
  2213. POSITION pos;
  2214. CStringArray array; CString name;
  2215. if(m_radio==0)
  2216. {
  2217. pos=m_List1.GetFirstSelectedItemPosition();
  2218. if(pos==NULL)
  2219. {
  2220. AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
  2221. return;
  2222. }
  2223. int iItem;
  2224. while (pos)
  2225. {
  2226. iItem = m_List1.GetNextSelectedItem(pos);
  2227. #ifdef CHILD_VERSION
  2228. array.Add (m_List1.GetItemText (iItem, 5+m_nAdd));
  2229. array.Add (m_List1.GetItemText (iItem, 6+m_nAdd));
  2230. #else
  2231. array.Add (m_List1.GetItemText (iItem, 3+m_nAdd));
  2232. array.Add (m_List1.GetItemText (iItem, 4+m_nAdd));
  2233. #endif
  2234. }
  2235. }
  2236. else if(m_radio==1)
  2237. {
  2238. pos=m_List2.GetFirstSelectedItemPosition();
  2239. if(pos==NULL)
  2240. {
  2241. AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
  2242. return;
  2243. }
  2244. int iItem;
  2245. while (pos)
  2246. {
  2247. iItem = m_List2.GetNextSelectedItem(pos);
  2248. array.Add (m_List2.GetItemText (iItem, 3+m_nAdd));
  2249. array.Add (m_List2.GetItemText (iItem, 4+m_nAdd));
  2250. }
  2251. }
  2252. else if(m_radio==2)
  2253. {
  2254. pos=m_List3.GetFirstSelectedItemPosition();
  2255. if(pos==NULL)
  2256. {
  2257. AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
  2258. return;
  2259. }
  2260. int iItem;
  2261. while (pos)
  2262. {
  2263. iItem = m_List3.GetNextSelectedItem(pos);
  2264. array.Add (m_List3.GetItemText (iItem, 3+m_nAdd));
  2265. array.Add (m_List3.GetItemText (iItem, 4+m_nAdd));
  2266. }
  2267. }
  2268. else if(m_radio==3)
  2269. {
  2270. pos=m_List4.GetFirstSelectedItemPosition();
  2271. if(pos==NULL)
  2272. {
  2273. AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
  2274. return;
  2275. }
  2276. int iItem;
  2277. while (pos)
  2278. {
  2279. iItem = m_List4.GetNextSelectedItem(pos);
  2280. array.Add (m_List4.GetItemText (iItem, 3+m_nAdd));
  2281. array.Add (m_List4.GetItemText (iItem, 4+m_nAdd));
  2282. }
  2283. }
  2284. else if(m_radio==4)
  2285. {
  2286. pos=m_List5.GetFirstSelectedItemPosition();
  2287. if(pos==NULL)
  2288. {
  2289. AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
  2290. return;
  2291. }
  2292. int iItem;
  2293. while (pos)
  2294. {
  2295. iItem = m_List5.GetNextSelectedItem(pos);
  2296. array.Add (m_List5.GetItemText (iItem, 3+m_nAdd));
  2297. array.Add (m_List5.GetItemText (iItem, 4+m_nAdd));
  2298. }
  2299. }
  2300. else if(m_radio==5)
  2301. {
  2302. pos=m_List6.GetFirstSelectedItemPosition();
  2303. if(pos==NULL)
  2304. {
  2305. AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
  2306. return;
  2307. }
  2308. int iItem;
  2309. while (pos)
  2310. {
  2311. iItem = m_List6.GetNextSelectedItem(pos);
  2312. array.Add (m_List6.GetItemText (iItem, 5));
  2313. }
  2314. }
  2315. else if(m_radio==6)
  2316. {
  2317. array.Add(m_childdlg.GetCurPhone(name));
  2318. }
  2319. SendMsgDlg dlg;
  2320. if(m_radio==5)
  2321. dlg.m_mode=1;
  2322. dlg.m_pArray=&array;
  2323. if(name!="")
  2324. dlg.m_strSendSms=name+"您好,";
  2325. dlg.DoModal ();
  2326. }
  2327. void TodayForm::OnBUTtake3() //统计未拍;
  2328. {
  2329. // TODO: Add your control notification handler code here
  2330. if(IsHasRights2new(2)==0)return;
  2331. if(m_radio==0)
  2332. {
  2333. SearchTake dlg;
  2334. dlg.DoModal();
  2335. }
  2336. else if(m_radio==1)
  2337. {
  2338. SearchTake2 dlg;
  2339. dlg.DoModal();
  2340. }
  2341. else if(m_radio==2)
  2342. {
  2343. SearchTake3 dlg;
  2344. dlg.DoModal();
  2345. }
  2346. else if(m_radio==3)
  2347. {
  2348. SearchTake4 dlg;
  2349. dlg.DoModal();
  2350. }
  2351. else if(m_radio==4)
  2352. {
  2353. SearchTake5 dlg;
  2354. dlg.DoModal();
  2355. }
  2356. if(g_bAllBranch)
  2357. {
  2358. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  2359. }
  2360. DateChange();
  2361. GetCalendarData();
  2362. }
  2363. void TodayForm::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  2364. {
  2365. // TODO: Add your control notification handler code here
  2366. POSITION pos;
  2367. pos=m_List1.GetFirstSelectedItemPosition();
  2368. if(pos==NULL)return;
  2369. int iItem=m_List1.GetNextSelectedItem(pos);
  2370. g_id = m_List1.GetItemText (iItem, 0+m_nAdd);
  2371. *pResult = 0;
  2372. }
  2373. void TodayForm::OnClickList3(NMHDR* pNMHDR, LRESULT* pResult)
  2374. {
  2375. // TODO: Add your control notification handler code here
  2376. POSITION pos;
  2377. pos=m_List2.GetFirstSelectedItemPosition();
  2378. if(pos==NULL)return;
  2379. int iItem=m_List2.GetNextSelectedItem(pos);
  2380. g_id = m_List2.GetItemText (iItem, 0+m_nAdd);
  2381. *pResult = 0;
  2382. }
  2383. void TodayForm::OnClickList4(NMHDR* pNMHDR, LRESULT* pResult)
  2384. {
  2385. // TODO: Add your control notification handler code here
  2386. POSITION pos;
  2387. pos=m_List3.GetFirstSelectedItemPosition();
  2388. if(pos==NULL)return;
  2389. int iItem=m_List3.GetNextSelectedItem(pos);
  2390. g_id = m_List3.GetItemText (iItem, 0+m_nAdd);
  2391. *pResult = 0;
  2392. }
  2393. void TodayForm::OnClickList7(NMHDR* pNMHDR, LRESULT* pResult)
  2394. {
  2395. // TODO: Add your control notification handler code here
  2396. POSITION pos;
  2397. pos=m_List4.GetFirstSelectedItemPosition();
  2398. if(pos==NULL)return;
  2399. int iItem=m_List4.GetNextSelectedItem(pos);
  2400. g_id = m_List4.GetItemText (iItem, 0+m_nAdd);
  2401. *pResult = 0;
  2402. }
  2403. void TodayForm::OnClickList8(NMHDR* pNMHDR, LRESULT* pResult)
  2404. {
  2405. // TODO: Add your control notification handler code here
  2406. POSITION pos;
  2407. pos=m_List5.GetFirstSelectedItemPosition();
  2408. if(pos==NULL)return;
  2409. int iItem=m_List5.GetNextSelectedItem(pos);
  2410. g_id = m_List5.GetItemText (iItem, 0+m_nAdd);
  2411. *pResult = 0;
  2412. }
  2413. void TodayForm::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
  2414. {
  2415. // TODO: Add your control notification handler code here
  2416. OnBUTchoose();
  2417. *pResult = 0;
  2418. }
  2419. void TodayForm::OnDblclkList3(NMHDR* pNMHDR, LRESULT* pResult)
  2420. {
  2421. // TODO: Add your control notification handler code here
  2422. OnBUTchoose();
  2423. *pResult = 0;
  2424. }
  2425. void TodayForm::OnDblclkList4(NMHDR* pNMHDR, LRESULT* pResult)
  2426. {
  2427. // TODO: Add your control notification handler code here
  2428. OnBUTchoose();
  2429. *pResult = 0;
  2430. }
  2431. void TodayForm::OnDblclkList7(NMHDR* pNMHDR, LRESULT* pResult)
  2432. {
  2433. // TODO: Add your control notification handler code here
  2434. // if(IsHasRights2new(3)==0)return;
  2435. OnBUTchoose();
  2436. // g_pMainWnd->OnOutbarNotify("发片/取件");
  2437. *pResult = 0;
  2438. }
  2439. void TodayForm::OnCustomdrawList1 ( NMHDR* pNMHDR, LRESULT* pResult )
  2440. {
  2441. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  2442. // Take the default processing unless we set this to something else below.
  2443. *pResult = 0;
  2444. // First thing - check the draw stage. If it's the control's prepaint
  2445. // stage, then tell Windows we want messages for every item.
  2446. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  2447. {
  2448. *pResult = CDRF_NOTIFYITEMDRAW;
  2449. }
  2450. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  2451. {
  2452. // This is the prepaint stage for an item. Here's where we set the
  2453. // item's text color. Our return value will tell Windows to draw the
  2454. // item itself, but it will use the new color we set here.
  2455. // We'll cycle the colors through red, green, and light blue.
  2456. pLVCD->clrText =RGB(0,0,0);
  2457. #ifdef ENTERPRISE_VERSION
  2458. COLORREF col[10]={\
  2459. RGB(190,76,195),\
  2460. RGB(76,176,76),\
  2461. RGB(136,113,200),\
  2462. RGB(76,186,198),\
  2463. RGB(209,127,213),\
  2464. RGB(127,209,127),\
  2465. RGB(170,154,215),\
  2466. RGB(127,206,215),\
  2467. RGB(0,127,0),\
  2468. RGB(0,0,127)};
  2469. int nAdd2=0;
  2470. #ifndef CHILD_VERSION
  2471. nAdd2=-1;
  2472. #endif
  2473. int pos=::FindArray (&m_datearray1, m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (9+m_nAdd+nAdd2) )%10;
  2474. if(pos<10)
  2475. pLVCD->clrTextBk = col[pos];
  2476. else if(pLVCD->nmcd.dwItemSpec%2)
  2477. pLVCD->clrTextBk = g_gridcol1;
  2478. else
  2479. pLVCD->clrTextBk = g_gridcol2;
  2480. #else
  2481. #ifdef CHILD_VERSION
  2482. int pos=::FindArray (&m_datearray1, m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (10+m_nAdd) )%10;
  2483. #else
  2484. int pos=::FindArray (&m_datearray1, m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (9+m_nAdd) )%10;
  2485. #endif
  2486. COLORREF col[10]={\
  2487. RGB(209,127,213),\
  2488. RGB(127,209,127),\
  2489. RGB(170,154,215),\
  2490. RGB(127,206,215),\
  2491. RGB(190,76,195),\
  2492. RGB(76,176,76),\
  2493. RGB(136,113,200),\
  2494. RGB(76,186,198),\
  2495. RGB(0,127,0),\
  2496. RGB(0,0,127)};
  2497. if(pos<10)
  2498. pLVCD->clrTextBk = col[pos];
  2499. else if(pLVCD->nmcd.dwItemSpec%2)
  2500. pLVCD->clrTextBk = g_gridcol1;
  2501. else
  2502. pLVCD->clrTextBk = g_gridcol2;
  2503. #endif
  2504. // Store the color back in the NMLVCUSTOMDRAW struct.
  2505. // Tell Windows to paint the control itself.
  2506. *pResult = CDRF_DODEFAULT;
  2507. }
  2508. }
  2509. void TodayForm::OnCustomdrawList2 ( NMHDR* pNMHDR, LRESULT* pResult )
  2510. {
  2511. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  2512. // Take the default processing unless we set this to something else below.
  2513. *pResult = 0;
  2514. // First thing - check the draw stage. If it's the control's prepaint
  2515. // stage, then tell Windows we want messages for every item.
  2516. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  2517. {
  2518. *pResult = CDRF_NOTIFYITEMDRAW;
  2519. }
  2520. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  2521. {
  2522. // This is the prepaint stage for an item. Here's where we set the
  2523. // item's text color. Our return value will tell Windows to draw the
  2524. // item itself, but it will use the new color we set here.
  2525. // We'll cycle the colors through red, green, and light blue.
  2526. if(::FindArray (&m_datearray2, m_List2.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (5+m_nAdd) )%2)
  2527. pLVCD->clrText = RGB(0,0,220);
  2528. else
  2529. pLVCD->clrText = RGB(0,0,50);
  2530. if(pLVCD->nmcd.dwItemSpec%2)
  2531. pLVCD->clrTextBk = g_gridcol1;
  2532. else
  2533. pLVCD->clrTextBk = g_gridcol2;
  2534. // Store the color back in the NMLVCUSTOMDRAW struct.
  2535. // Tell Windows to paint the control itself.
  2536. *pResult = CDRF_DODEFAULT;
  2537. }
  2538. }
  2539. void TodayForm::OnCustomdrawList5 ( NMHDR* pNMHDR, LRESULT* pResult )
  2540. {
  2541. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  2542. // Take the default processing unless we set this to something else below.
  2543. *pResult = 0;
  2544. // First thing - check the draw stage. If it's the control's prepaint
  2545. // stage, then tell Windows we want messages for every item.
  2546. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  2547. {
  2548. *pResult = CDRF_NOTIFYITEMDRAW;
  2549. }
  2550. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  2551. {
  2552. // This is the prepaint stage for an item. Here's where we set the
  2553. // item's text color. Our return value will tell Windows to draw the
  2554. // item itself, but it will use the new color we set here.
  2555. // We'll cycle the colors through red, green, and light blue.
  2556. CString date=m_List5.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (7+m_nAdd);
  2557. // MessageBox(date);
  2558. // MessageBox(m_date1);
  2559. // MessageBox(m_date2);
  2560. if(date.GetLength()==10 && date>=m_date1 && date<=m_date2)
  2561. pLVCD->clrText = RGB(0,0,220);
  2562. else
  2563. pLVCD->clrText = RGB(0,0,50);
  2564. if(pLVCD->nmcd.dwItemSpec%2)
  2565. pLVCD->clrTextBk = g_gridcol1;
  2566. else
  2567. pLVCD->clrTextBk = g_gridcol2;
  2568. // Store the color back in the NMLVCUSTOMDRAW struct.
  2569. // Tell Windows to paint the control itself.
  2570. *pResult = CDRF_DODEFAULT;
  2571. }
  2572. }
  2573. void TodayForm::OnCustomdrawList6 ( NMHDR* pNMHDR, LRESULT* pResult )
  2574. {
  2575. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  2576. // Take the default processing unless we set this to something else below.
  2577. *pResult = 0;
  2578. // First thing - check the draw stage. If it's the control's prepaint
  2579. // stage, then tell Windows we want messages for every item.
  2580. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  2581. {
  2582. *pResult = CDRF_NOTIFYITEMDRAW;
  2583. }
  2584. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  2585. {
  2586. // This is the prepaint stage for an item. Here's where we set the
  2587. // item's text color. Our return value will tell Windows to draw the
  2588. // item itself, but it will use the new color we set here.
  2589. // We'll cycle the colors through red, green, and light blue.
  2590. // if(::FindArray (&m_datearray6, m_List6.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (9+m_nAdd) )%2)
  2591. // pLVCD->clrText = RGB(0,0,220);
  2592. // else
  2593. // pLVCD->clrText = RGB(0,0,50);
  2594. if(pLVCD->nmcd.dwItemSpec%2)
  2595. pLVCD->clrTextBk = g_gridcol1;
  2596. else
  2597. pLVCD->clrTextBk = g_gridcol2;
  2598. // Store the color back in the NMLVCUSTOMDRAW struct.
  2599. // Tell Windows to paint the control itself.
  2600. *pResult = CDRF_DODEFAULT;
  2601. }
  2602. }
  2603. BOOL TodayForm::PreTranslateMessage(MSG* pMsg)
  2604. {
  2605. // TODO: Add your specialized code here and/or call the base class
  2606. if(pMsg->message==WM_KEYDOWN)
  2607. {
  2608. switch (pMsg->wParam)
  2609. {
  2610. case VK_F9:
  2611. GetClientPhone();
  2612. return 1;
  2613. case 0x43: // copy
  2614. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  2615. {
  2616. GetFocus()->SendMessage(WM_COPY);
  2617. return TRUE;
  2618. }
  2619. break;
  2620. case 0x56: //Ctrl + V:
  2621. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  2622. {
  2623. GetFocus()->SendMessage(WM_PASTE);
  2624. return TRUE;
  2625. }
  2626. break;
  2627. case 0x58: // cut
  2628. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  2629. {
  2630. GetFocus()->SendMessage(WM_CUT);
  2631. return TRUE;
  2632. }
  2633. break;
  2634. case 0x5A: //undo
  2635. case 0x59: //redo
  2636. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  2637. {
  2638. GetFocus()->SendMessage(WM_UNDO);
  2639. return TRUE;
  2640. }
  2641. break;
  2642. }
  2643. }
  2644. return MyFormView::PreTranslateMessage(pMsg);
  2645. }
  2646. void TodayForm::GetClientPhone()
  2647. {
  2648. UpdateData();
  2649. if(m_radio==1)
  2650. {
  2651. GetClientPhone2();
  2652. return;
  2653. }
  2654. else if(m_radio==2)
  2655. {
  2656. GetClientPhone3();
  2657. return;
  2658. }
  2659. else if(m_radio==3)
  2660. {
  2661. GetClientPhone4();
  2662. return;
  2663. }
  2664. else if(m_radio==4)
  2665. {
  2666. GetClientPhone5();
  2667. return;
  2668. }
  2669. CString path;
  2670. if(m_radio==0)
  2671. path="c:\\拍照客人.txt";
  2672. else if(m_radio==1)
  2673. path="c:\\选片客人.txt";
  2674. else if(m_radio==2)
  2675. path="c:\\看设计客人.txt";
  2676. else if(m_radio==3)
  2677. path="c:\\取件客人.txt";
  2678. else if(m_radio==4)
  2679. path="c:\\婚庆客人.txt";
  2680. CStdioFile fp;
  2681. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  2682. CString str;
  2683. CString name,m_name1,m_name2;
  2684. CString phone,m_phone1,m_phone2;
  2685. CString str1,str2,str3,str4,str5,str6,str7,str8,str9;
  2686. int leng1=20;
  2687. int leng2=30;
  2688. int leng3=15;
  2689. int leng4=15;
  2690. int leng5=15;
  2691. int leng6=15;
  2692. int leng7=15;
  2693. int leng8=15;
  2694. int leng9=15;
  2695. str1="姓名";
  2696. str2="电话";
  2697. str3="景点";
  2698. str4="日期";
  2699. str5="时间";
  2700. str6="摄影";
  2701. str7="化妆";
  2702. str8="套系";
  2703. str9="价格";
  2704. FillLength(str1, leng1);
  2705. FillLength(str2, leng2);
  2706. FillLength(str3, leng3);
  2707. FillLength(str4, leng4);
  2708. FillLength(str5, leng5);
  2709. FillLength(str6, leng6);
  2710. FillLength(str7, leng7);
  2711. FillLength(str8, leng8);
  2712. FillLength(str9, leng9);
  2713. str=str1+str2+str3+str4+str5+str6+str7+str8+str9+"\n";
  2714. fp.WriteString (str);
  2715. for(int i=0; i<m_List1.GetItemCount (); i++)
  2716. {
  2717. name.Empty ();
  2718. phone.Empty ();
  2719. m_name1=m_List1.GetItemText (i, 1+m_nAdd);
  2720. m_name2=m_List1.GetItemText (i, 2+m_nAdd);
  2721. m_phone1=m_List1.GetItemText (i, 3+m_nAdd);
  2722. m_phone2=m_List1.GetItemText (i, 4+m_nAdd);
  2723. str3=m_List1.GetItemText (i, 5+m_nAdd);
  2724. str4=m_List1.GetItemText (i, 6+m_nAdd);
  2725. str5=m_List1.GetItemText (i, 7+m_nAdd);
  2726. str6=m_List1.GetItemText (i, 8+m_nAdd);
  2727. str7=m_List1.GetItemText (i, 9+m_nAdd);
  2728. str8=m_List1.GetItemText (i, 12+m_nAdd);
  2729. str9=m_List1.GetItemText (i, 13+m_nAdd);
  2730. if(!m_name1.IsEmpty ())
  2731. name=m_name1+",";
  2732. name+=m_name2;
  2733. name.TrimRight (",");
  2734. if(!m_phone1.IsEmpty ())
  2735. phone=m_phone1+",";
  2736. phone+=m_phone2;phone.TrimRight (",");
  2737. str1=name;
  2738. str2=phone;
  2739. FillLength(str1, leng1);
  2740. FillLength(str2, leng2);
  2741. FillLength(str3, leng3);
  2742. FillLength(str4, leng4);
  2743. FillLength(str5, leng5);
  2744. FillLength(str6, leng6);
  2745. FillLength(str7, leng7);
  2746. FillLength(str8, leng8);
  2747. FillLength(str9, leng9);
  2748. str=str1+str2+str3+str4+str5+str6+str7+str8+str9+"\n";
  2749. fp.WriteString (str);
  2750. }
  2751. fp.Close ();
  2752. MessageBox("资料已保存到"+path);
  2753. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  2754. }
  2755. void TodayForm::GetClientPhone2()
  2756. {
  2757. CString path;
  2758. path="c:\\选片客人.txt";
  2759. CStdioFile fp;
  2760. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  2761. CString str;
  2762. CString name,m_name1,m_name2;
  2763. CString phone,m_phone1,m_phone2;
  2764. CString str1,str2,str3,str4,str5,str6,str7,str8,str9;
  2765. int leng1=25;
  2766. int leng2=30;
  2767. int leng3=20;
  2768. int leng4=20;
  2769. int leng5=20;
  2770. int leng6=20;
  2771. str1="姓名";
  2772. str2="电话";
  2773. str3="日期";
  2774. str4="时间";
  2775. str5="套系";
  2776. str6="价格";
  2777. FillLength(str1, leng1);
  2778. FillLength(str2, leng2);
  2779. FillLength(str3, leng3);
  2780. FillLength(str4, leng4);
  2781. FillLength(str5, leng5);
  2782. FillLength(str6, leng6);
  2783. str=str1+str2+str3+str4+str5+str6+"\n";
  2784. fp.WriteString (str);
  2785. for(int i=0; i<m_List2.GetItemCount (); i++)
  2786. {
  2787. name.Empty ();
  2788. phone.Empty ();
  2789. m_name1=m_List2.GetItemText (i, 1+m_nAdd);
  2790. m_name2=m_List2.GetItemText (i, 2+m_nAdd);
  2791. m_phone1=m_List2.GetItemText (i, 3+m_nAdd);
  2792. m_phone2=m_List2.GetItemText (i, 4+m_nAdd);
  2793. str3=m_List2.GetItemText (i, 5+m_nAdd);
  2794. str4=m_List2.GetItemText (i, 6+m_nAdd);
  2795. str5=m_List2.GetItemText (i, 9+m_nAdd);
  2796. str6=m_List2.GetItemText (i, 10+m_nAdd);
  2797. if(!m_name1.IsEmpty ())
  2798. name=m_name1+",";
  2799. name+=m_name2;
  2800. name.TrimRight (",");
  2801. if(!m_phone1.IsEmpty ())
  2802. phone=m_phone1+",";
  2803. phone+=m_phone2;phone.TrimRight (",");
  2804. str1=name;
  2805. str2=phone;
  2806. FillLength(str1, leng1);
  2807. FillLength(str2, leng2);
  2808. FillLength(str3, leng3);
  2809. FillLength(str4, leng4);
  2810. FillLength(str5, leng5);
  2811. FillLength(str6, leng6);
  2812. str=str1+str2+str3+str4+str5+str6+"\n";
  2813. fp.WriteString (str);
  2814. }
  2815. fp.Close ();
  2816. MessageBox("资料已保存到"+path);
  2817. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  2818. }
  2819. void TodayForm::GetClientPhone3()
  2820. {
  2821. CString path;
  2822. path="c:\\看设计客人.txt";
  2823. CStdioFile fp;
  2824. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  2825. CString str;
  2826. CString name,m_name1,m_name2;
  2827. CString phone,m_phone1,m_phone2;
  2828. CString str1,str2,str3,str4,str5,str6,str7,str8,str9;
  2829. int leng1=25;
  2830. int leng2=30;
  2831. int leng3=20;
  2832. int leng4=20;
  2833. int leng5=20;
  2834. int leng6=20;
  2835. str1="姓名";
  2836. str2="电话";
  2837. str3="日期";
  2838. str4="时间";
  2839. str5="套系";
  2840. str6="价格";
  2841. FillLength(str1, leng1);
  2842. FillLength(str2, leng2);
  2843. FillLength(str3, leng3);
  2844. FillLength(str4, leng4);
  2845. FillLength(str5, leng5);
  2846. FillLength(str6, leng6);
  2847. str=str1+str2+str3+str4+str5+str6+"\n";
  2848. fp.WriteString (str);
  2849. for(int i=0; i<m_List3.GetItemCount (); i++)
  2850. {
  2851. name.Empty ();
  2852. phone.Empty ();
  2853. m_name1=m_List3.GetItemText (i, 1+m_nAdd);
  2854. m_name2=m_List3.GetItemText (i, 2+m_nAdd);
  2855. m_phone1=m_List3.GetItemText (i, 3+m_nAdd);
  2856. m_phone2=m_List3.GetItemText (i, 4+m_nAdd);
  2857. str3=m_List3.GetItemText (i, 5+m_nAdd);
  2858. str4=m_List3.GetItemText (i, 6+m_nAdd);
  2859. str5=m_List3.GetItemText (i, 10+m_nAdd);
  2860. str6=m_List3.GetItemText (i, 11+m_nAdd);
  2861. if(!m_name1.IsEmpty ())
  2862. name=m_name1+",";
  2863. name+=m_name2;
  2864. name.TrimRight (",");
  2865. if(!m_phone1.IsEmpty ())
  2866. phone=m_phone1+",";
  2867. phone+=m_phone2;phone.TrimRight (",");
  2868. str1=name;
  2869. str2=phone;
  2870. FillLength(str1, leng1);
  2871. FillLength(str2, leng2);
  2872. FillLength(str3, leng3);
  2873. FillLength(str4, leng4);
  2874. FillLength(str5, leng5);
  2875. FillLength(str6, leng6);
  2876. str=str1+str2+str3+str4+str5+str6+"\n";
  2877. fp.WriteString (str);
  2878. }
  2879. fp.Close ();
  2880. MessageBox("资料已保存到"+path);
  2881. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  2882. }
  2883. void TodayForm::GetClientPhone4()
  2884. {
  2885. CString path;
  2886. path="c:\\取件客人.txt";
  2887. CStdioFile fp;
  2888. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  2889. CString str;
  2890. CString name,m_name1,m_name2;
  2891. CString phone,m_phone1,m_phone2;
  2892. CString str1,str2,str3,str4,str5,str6,str7,str8,str9;
  2893. int leng1=25;
  2894. int leng2=30;
  2895. int leng3=20;
  2896. int leng4=20;
  2897. int leng5=20;
  2898. int leng6=20;
  2899. str1="姓名";
  2900. str2="电话";
  2901. str3="日期";
  2902. str4="时间";
  2903. str5="套系";
  2904. str6="价格";
  2905. FillLength(str1, leng1);
  2906. FillLength(str2, leng2);
  2907. FillLength(str3, leng3);
  2908. FillLength(str4, leng4);
  2909. FillLength(str5, leng5);
  2910. FillLength(str6, leng6);
  2911. str=str1+str2+str3+str4+str5+str6+"\n";
  2912. fp.WriteString (str);
  2913. for(int i=0; i<m_List4.GetItemCount (); i++)
  2914. {
  2915. name.Empty ();
  2916. phone.Empty ();
  2917. m_name1=m_List4.GetItemText (i, 1+m_nAdd);
  2918. m_name2=m_List4.GetItemText (i, 2+m_nAdd);
  2919. m_phone1=m_List4.GetItemText (i, 3+m_nAdd);
  2920. m_phone2=m_List4.GetItemText (i, 4+m_nAdd);
  2921. str3=m_List4.GetItemText (i, 5+m_nAdd);
  2922. str4=m_List4.GetItemText (i, 6+m_nAdd);
  2923. str5=m_List4.GetItemText (i, 10+m_nAdd);
  2924. str6=m_List4.GetItemText (i, 11+m_nAdd);
  2925. if(!m_name1.IsEmpty ())
  2926. name=m_name1+",";
  2927. name+=m_name2;
  2928. name.TrimRight (",");
  2929. if(!m_phone1.IsEmpty ())
  2930. phone=m_phone1+",";
  2931. phone+=m_phone2;phone.TrimRight (",");
  2932. str1=name;
  2933. str2=phone;
  2934. FillLength(str1, leng1);
  2935. FillLength(str2, leng2);
  2936. FillLength(str3, leng3);
  2937. FillLength(str4, leng4);
  2938. FillLength(str5, leng5);
  2939. FillLength(str6, leng6);
  2940. str=str1+str2+str3+str4+str5+str6+"\n";
  2941. fp.WriteString (str);
  2942. }
  2943. fp.Close ();
  2944. MessageBox("资料已保存到"+path);
  2945. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  2946. }
  2947. void TodayForm::GetClientPhone5()
  2948. {
  2949. CString path;
  2950. path="c:\\婚庆客人.txt";
  2951. CStdioFile fp;
  2952. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  2953. CString str;
  2954. CString name,m_name1,m_name2;
  2955. CString phone,m_phone1,m_phone2;
  2956. CString str1,str2,str3,str4,str5,str6,str7,str8,str9;
  2957. int leng1=25;
  2958. int leng2=30;
  2959. int leng3=20;
  2960. int leng4=20;
  2961. int leng5=20;
  2962. int leng6=20;
  2963. int leng7=20;
  2964. str1="姓名";
  2965. str2="电话";
  2966. str3="婚庆内容";
  2967. str4="日期";
  2968. str5="时间";
  2969. str6="套系";
  2970. str7="价格";
  2971. FillLength(str1, leng1);
  2972. FillLength(str2, leng2);
  2973. FillLength(str3, leng3);
  2974. FillLength(str4, leng4);
  2975. FillLength(str5, leng5);
  2976. FillLength(str6, leng6);
  2977. FillLength(str7, leng7);
  2978. str=str1+str2+str3+str4+str5+str6+str7+"\n";
  2979. fp.WriteString (str);
  2980. for(int i=0; i<m_List5.GetItemCount (); i++)
  2981. {
  2982. name.Empty ();
  2983. phone.Empty ();
  2984. m_name1=m_List5.GetItemText (i, 1+m_nAdd);
  2985. m_name2=m_List5.GetItemText (i, 2+m_nAdd);
  2986. m_phone1=m_List5.GetItemText (i, 3+m_nAdd);
  2987. m_phone2=m_List5.GetItemText (i, 4+m_nAdd);
  2988. str3=m_List5.GetItemText (i, 5+m_nAdd);
  2989. str4=m_List5.GetItemText (i, 6+m_nAdd);
  2990. str5=m_List5.GetItemText (i, 7+m_nAdd);
  2991. str6=m_List5.GetItemText (i, 12+m_nAdd);
  2992. str7=m_List5.GetItemText (i, 13+m_nAdd);
  2993. if(!m_name1.IsEmpty ())
  2994. name=m_name1+",";
  2995. name+=m_name2;
  2996. name.TrimRight (",");
  2997. if(!m_phone1.IsEmpty ())
  2998. phone=m_phone1+",";
  2999. phone+=m_phone2;phone.TrimRight (",");
  3000. str1=name;
  3001. str2=phone;
  3002. FillLength(str1, leng1);
  3003. FillLength(str2, leng2);
  3004. FillLength(str3, leng3);
  3005. FillLength(str4, leng4);
  3006. FillLength(str5, leng5);
  3007. FillLength(str6, leng6);
  3008. FillLength(str7, leng7);
  3009. str=str1+str2+str3+str4+str5+str6+str7+"\n";
  3010. fp.WriteString (str);
  3011. }
  3012. fp.Close ();
  3013. MessageBox("资料已保存到"+path);
  3014. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  3015. }
  3016. void TodayForm::OnClickList10(NMHDR* pNMHDR, LRESULT* pResult)
  3017. {
  3018. // TODO: Add your control notification handler code here
  3019. POSITION pos;
  3020. pos=m_List6.GetFirstSelectedItemPosition();
  3021. if(pos==NULL)return;
  3022. int iItem=m_List6.GetNextSelectedItem(pos);
  3023. g_id = m_List6.GetItemText (iItem, 0+m_nAdd);
  3024. *pResult = 0;
  3025. }
  3026. void TodayForm::HidePrice()
  3027. {
  3028. #ifdef LKAY_VERSION
  3029. if(IsHasRights2new(31))return;
  3030. for(int i=0; i< m_List1array.GetSize (); i++)
  3031. {
  3032. m_List1array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3033. m_List1array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3034. m_List1array.ElementAt (i).SetAt (12+m_nAdd, "***");
  3035. m_List1array.ElementAt (i).SetAt (13+m_nAdd, "***");
  3036. }
  3037. for( i=0; i< m_List2array.GetSize (); i++)
  3038. {
  3039. m_List2array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3040. m_List2array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3041. m_List2array.ElementAt (i).SetAt (9+m_nAdd, "***");
  3042. m_List2array.ElementAt (i).SetAt (10+m_nAdd, "***");
  3043. }
  3044. for( i=0; i< m_List3array.GetSize (); i++)
  3045. {
  3046. m_List3array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3047. m_List3array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3048. m_List3array.ElementAt (i).SetAt (10+m_nAdd, "***");
  3049. m_List3array.ElementAt (i).SetAt (11+m_nAdd, "***");
  3050. }
  3051. for( i=0; i< m_List4array.GetSize (); i++)
  3052. {
  3053. m_List4array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3054. m_List4array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3055. m_List4array.ElementAt (i).SetAt (10+m_nAdd, "***");
  3056. m_List4array.ElementAt (i).SetAt (11+m_nAdd, "***");
  3057. }
  3058. #else
  3059. int i = 0;
  3060. if(IsHasRights2new(31))return;
  3061. for( i=0; i< m_List1array.GetSize (); i++)
  3062. {
  3063. m_List1array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3064. m_List1array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3065. }
  3066. for( i=0; i< m_List2array.GetSize (); i++)
  3067. {
  3068. m_List2array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3069. m_List2array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3070. }
  3071. for( i=0; i< m_List3array.GetSize (); i++)
  3072. {
  3073. m_List3array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3074. m_List3array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3075. }
  3076. for( i=0; i< m_List4array.GetSize (); i++)
  3077. {
  3078. m_List4array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3079. m_List4array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3080. }
  3081. for( i=0; i< m_List5array.GetSize (); i++)
  3082. {
  3083. m_List5array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3084. m_List5array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3085. }
  3086. /* for( i=0; i< m_List6array.GetSize (); i++)
  3087. {
  3088. m_List6array.ElementAt (i).SetAt (16+m_nAdd, "***");
  3089. m_List6array.ElementAt (i).SetAt (17+m_nAdd, "***");
  3090. }*/
  3091. #endif
  3092. }
  3093. extern BOOL CovertDate(CString &date, CString &date2);
  3094. //--------------------------------------------------------------------------
  3095. // Remak by Jeff 2014.11.03
  3096. // 函数:GetData1
  3097. // 描述:获取指定时期段内的拍照预约客人详情。
  3098. // 参数:
  3099. // strBeginTime:时间段起始时刻;
  3100. // strEndofTime:时间段结束时刻
  3101. // 返回:
  3102. //--------------------------------------------------------------------------
  3103. void TodayForm::GetData1(CString strBeginTime, CString strEndofTime)//拍照客人;
  3104. {
  3105. CString sql;
  3106. sql.Format("bookingdate>='" + strBeginTime + "' and bookingdate<='" + strEndofTime + "'");
  3107. if(g_bAllBranch==0)
  3108. {
  3109. g_sendhead.code[0]=120; // takeview视图;
  3110. g_sendhead.tabcount=1;
  3111. g_sendhead.bsql=0;
  3112. g_pMainWnd->ProcessChatMessageRequest2(sql);
  3113. if(g_bSendOK==0)return;
  3114. DataToArray(&m_List1array);
  3115. // qsort( static_cast<void*>(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel3 );
  3116. #ifdef CHILD_VERSION
  3117. CString strBirthday; // 阳历生日;
  3118. CString strLunarBirthday, str;
  3119. COleDateTime tCurrentTime = COleDateTime::GetCurrentTime();
  3120. int days;
  3121. for(int i=0; i<m_List1array.GetSize(); i++)
  3122. {
  3123. strBirthday=m_List1array.ElementAt(i).ElementAt(24+m_nAdd2); // Jeff:出生日期;
  3124. if(m_List1array.ElementAt (i).ElementAt(25+m_nAdd2)=="1") // Jeff:是否农历生日;
  3125. {
  3126. strLunarBirthday.Empty();
  3127. CovertDate(strBirthday,strLunarBirthday);
  3128. if(strLunarBirthday!="")
  3129. strBirthday=strLunarBirthday;
  3130. }
  3131. if(strBirthday.GetLength()==10)
  3132. {
  3133. 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());
  3134. #if JEFF_TEST_ON
  3135. // Jeff:闰年和平年需要考虑;
  3136. // 1.today != 生日
  3137. // 2.today > birthday;
  3138. // 2.1.获取出生年 compare 今年; 相等,则不足1周岁;可细化月数:差多少天满月、满月、2月……
  3139. // 2.2.获取出生年 compare 今年; < 则 求模判断几周岁;
  3140. // 3.today < birthday;
  3141. // 3.1.获取出生年 compare 今年; 相等,2周岁;
  3142. // 3.2.获取出生年 compare 今年; < 则 求模判断几周岁;
  3143. // -------------------------------------------------
  3144. // 4.today == birthday; 模求周岁;
  3145. // -------------------------------------------------
  3146. //
  3147. // -------------------------------------------------
  3148. // 1.先获取birthday年份和今年年份值,对比;
  3149. // 2.获取birthday月份和今年月份;
  3150. // 3.获取birthday日号和今年日号;
  3151. // ------------------------------------------------
  3152. //printf("Jeff:姓名:%s,出生日期:%d-%d-%d\n\n",m_List1array.ElementAt(i).ElementAt(2),tBirthdayTime.GetYear(),tBirthdayTime.GetMonth(),tBirthdayTime.GetDay());
  3153. //printf("Jeff:姓名:%s,今天日期:%d-%d-%d\n\n",m_List1array.ElementAt(i).ElementAt(2),tCurrentTime.GetYear(),tCurrentTime.GetMonth(),tCurrentTime.GetDay());
  3154. // tCurrentTime今天; tBirthdayTime生日;
  3155. if ( tBirthdayTime.GetYear() < tCurrentTime.GetYear()) // 未到1周岁、1周岁及以上:
  3156. {
  3157. if ( tCurrentTime.GetYear() - tBirthdayTime.GetYear() == 1) // 判断是否1周岁生日到了;
  3158. {
  3159. if ( tCurrentTime.GetMonth() == tBirthdayTime.GetMonth() && tCurrentTime.GetDay() == tBirthdayTime.GetDay())
  3160. {
  3161. // 1周岁生日;
  3162. str.Format ("1周岁");
  3163. }
  3164. else
  3165. {
  3166. if ( tCurrentTime.GetMonth() < tBirthdayTime.GetMonth())
  3167. {
  3168. // 未满一周岁;
  3169. // str.Format ("%d岁", days);
  3170. int nMonthCount = tBirthdayTime.GetMonth() - tCurrentTime.GetMonth();
  3171. if ( tCurrentTime.GetDay() > tBirthdayTime.GetDay())
  3172. {
  3173. str.Format ("%d月", 12-nMonthCount);
  3174. }
  3175. else
  3176. {
  3177. str.Format ("%d月", 12-nMonthCount-1);
  3178. }
  3179. }
  3180. else
  3181. {
  3182. str.Format ("1岁");
  3183. }
  3184. }
  3185. }
  3186. else if ( tCurrentTime.GetYear() - tBirthdayTime.GetYear() > 1)
  3187. {
  3188. int nYearCount = 0;
  3189. nYearCount = tCurrentTime.GetYear()-tBirthdayTime.GetYear();
  3190. if ( tCurrentTime.GetMonth() >= tBirthdayTime.GetMonth() && tCurrentTime.GetDay() >= tBirthdayTime.GetDay()) // 满nYearCount周岁;
  3191. {
  3192. str.Format ("%d周岁", nYearCount);
  3193. }
  3194. else // 不满nYearCount-1周岁;
  3195. {
  3196. str.Format ("%d周岁", nYearCount-1);
  3197. }
  3198. }
  3199. }
  3200. else if ( tBirthdayTime.GetYear() == tCurrentTime.GetYear()) // 1周岁以下;
  3201. {
  3202. if ( tCurrentTime.GetMonth() == tBirthdayTime.GetMonth() )
  3203. {
  3204. if (tCurrentTime.GetDay() == tBirthdayTime.GetDay() )
  3205. {
  3206. // 满月;
  3207. str.Format ("满月");
  3208. }
  3209. else
  3210. {
  3211. // 差多少天满月;
  3212. str.Format ("差%d天满月", tCurrentTime.GetDay()-tBirthdayTime.GetDay());
  3213. }
  3214. }
  3215. else if ( tCurrentTime.GetMonth() > tBirthdayTime.GetMonth() )
  3216. {
  3217. int nMonthCount = tCurrentTime.GetMonth() - tBirthdayTime.GetMonth();
  3218. if ( tCurrentTime.GetDay() > tBirthdayTime.GetDay() ) // 满nMonthCount月;
  3219. {
  3220. str.Format ("%d月", nMonthCount);
  3221. }
  3222. else // 满nMonthCount-1月;
  3223. {
  3224. str.Format ("%d月", nMonthCount-1);
  3225. }
  3226. }
  3227. }
  3228. #else // Jeff:儿童版开单后,摄控本里显示的岁数不对;
  3229. CTimeSpan dt = tCurrentTime - tBirthdayTime;
  3230. days = dt.GetDays() + 1;
  3231. if (days % 365 == 0)
  3232. days /= 365;
  3233. else
  3234. {
  3235. days /= 365;
  3236. days++;
  3237. }
  3238. str.Format("%d岁", days);
  3239. #endif
  3240. m_List1array.ElementAt (i).InsertAt (3, str);
  3241. }
  3242. else
  3243. {
  3244. m_List1array.ElementAt (i).InsertAt (3, "未知");
  3245. }
  3246. m_List1array.ElementAt (i).InsertAt (3, m_List1array.ElementAt (i).ElementAt (28+m_nAdd2));
  3247. }
  3248. #endif
  3249. #ifdef ENTERPRISE_VERSION
  3250. qsort( static_cast<void*>(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel8 );
  3251. qsort( static_cast<void*>(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel7 );
  3252. qsort( static_cast<void*>(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel5 );
  3253. #endif
  3254. return;
  3255. }
  3256. //////////////数据汇总
  3257. m_List1array.RemoveAll ();
  3258. CStringArray failbrancharray;
  3259. CString branch;
  3260. int i = 0;
  3261. for( i=-1; i<g_brancharray.GetSize ()-1; i++)
  3262. {
  3263. if(i!=-1)
  3264. {
  3265. branch=g_brancharray.ElementAt (i).ElementAt (0);
  3266. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  3267. g_pMainWnd->OnDisconnect();
  3268. g_branchname=branch;
  3269. g_bBranchModify=1;
  3270. }
  3271. else
  3272. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  3273. g_sendhead.bsql=0;
  3274. g_sendhead.code[0]=120;
  3275. g_sendhead.tabcount=1;
  3276. g_pMainWnd->ProcessChatMessageRequest2(sql);
  3277. if(g_bSendOK==0)
  3278. {
  3279. failbrancharray.Add (branch);
  3280. continue;
  3281. }
  3282. CArray<CStringArray, CStringArray>List1array;
  3283. DataToArray(&List1array);
  3284. int size=m_List1array.GetSize ();
  3285. for(int j=0; j<List1array.GetSize (); j++)
  3286. {
  3287. size++;
  3288. m_List1array.SetSize(size , 1 );
  3289. size--;
  3290. m_List1array.ElementAt (size).Copy (List1array.ElementAt (j));
  3291. m_List1array.ElementAt (size).InsertAt (0, branch);
  3292. size++;
  3293. }
  3294. }
  3295. #ifdef CHILD_VERSION
  3296. CString strBirthday; // 阳历生日;
  3297. CString strLunarBirthday, str;
  3298. COleDateTime tCurrentTime = COleDateTime::GetCurrentTime();
  3299. int days;
  3300. for( i=0; i<m_List1array.GetSize (); i++)
  3301. {
  3302. strBirthday=m_List1array.ElementAt (i).ElementAt (25+m_nAdd2);
  3303. if(m_List1array.ElementAt (i).ElementAt (26+m_nAdd2)=="1")
  3304. {
  3305. strLunarBirthday.Empty ();
  3306. CovertDate(strBirthday,strLunarBirthday);
  3307. if(strLunarBirthday!="")strBirthday=strLunarBirthday;
  3308. }
  3309. if(strBirthday.GetLength ()==10)
  3310. {
  3311. 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());
  3312. #if JEFF_TEST_ON
  3313. if (tBirthdayTime.GetYear() < tCurrentTime.GetYear()) // 未到1周岁、1周岁及以上:
  3314. {
  3315. if ( tCurrentTime.GetYear() - tBirthdayTime.GetYear() == 1) // 判断是否1周岁生日到了;
  3316. {
  3317. if ( tCurrentTime.GetMonth() == tBirthdayTime.GetMonth() && tCurrentTime.GetDay() == tBirthdayTime.GetDay())
  3318. {
  3319. // 1周岁生日;
  3320. str.Format ("1周岁");
  3321. }
  3322. else
  3323. {
  3324. if ( tCurrentTime.GetMonth() < tBirthdayTime.GetMonth())
  3325. {
  3326. // 未满一周岁;
  3327. // str.Format ("%d岁", days);
  3328. int nMonthCount = tBirthdayTime.GetMonth() - tCurrentTime.GetMonth();
  3329. if (tCurrentTime.GetDay() > tBirthdayTime.GetDay())
  3330. {
  3331. str.Format("%d月", 12 - nMonthCount);
  3332. }
  3333. else
  3334. {
  3335. str.Format("%d月", 12 - nMonthCount - 1);
  3336. }
  3337. }
  3338. else
  3339. {
  3340. str.Format("1岁");
  3341. }
  3342. }
  3343. }
  3344. else if (tCurrentTime.GetYear() - tBirthdayTime.GetYear() > 1)
  3345. {
  3346. int nYearCount = 0;
  3347. nYearCount = tCurrentTime.GetYear() - tBirthdayTime.GetYear();
  3348. if (tCurrentTime.GetMonth() >= tBirthdayTime.GetMonth() && tCurrentTime.GetDay() >= tBirthdayTime.GetDay()) // 满nYearCount周岁;
  3349. {
  3350. str.Format("%d周岁", nYearCount);
  3351. }
  3352. else // 不满nYearCount-1周岁;
  3353. {
  3354. str.Format("%d周岁", nYearCount - 1);
  3355. }
  3356. }
  3357. }
  3358. else if (tBirthdayTime.GetYear() == tCurrentTime.GetYear()) // 1周岁以下;
  3359. {
  3360. if (tCurrentTime.GetMonth() == tBirthdayTime.GetMonth())
  3361. {
  3362. if (tCurrentTime.GetDay() == tBirthdayTime.GetDay())
  3363. {
  3364. // 满月;
  3365. str.Format("满月");
  3366. }
  3367. else
  3368. {
  3369. // 差多少天满月;
  3370. str.Format("差%d天满月", tCurrentTime.GetDay() - tBirthdayTime.GetDay());
  3371. }
  3372. }
  3373. else if (tCurrentTime.GetMonth() > tBirthdayTime.GetMonth())
  3374. {
  3375. int nMonthCount = tCurrentTime.GetMonth() - tBirthdayTime.GetMonth();
  3376. if (tCurrentTime.GetDay() > tBirthdayTime.GetDay()) // 满nMonthCount月;
  3377. {
  3378. str.Format("%d月", nMonthCount);
  3379. }
  3380. else // 满nMonthCount-1月;
  3381. {
  3382. str.Format("%d月", nMonthCount - 1);
  3383. }
  3384. }
  3385. }
  3386. #else
  3387. CTimeSpan dt=tCurrentTime-tBirthdayTime;
  3388. days=dt.GetDays ()+1;
  3389. if(days%365==0)
  3390. days/=365;
  3391. else
  3392. {
  3393. days/=365;
  3394. days++;
  3395. }
  3396. str.Format ("%d岁", days);
  3397. #endif
  3398. m_List1array.ElementAt (i).InsertAt (4, str);
  3399. }
  3400. else
  3401. {
  3402. m_List1array.ElementAt (i).InsertAt (4, "未知");
  3403. }
  3404. m_List1array.ElementAt (i).InsertAt (4, m_List1array.ElementAt (i).ElementAt (29+m_nAdd2));
  3405. }
  3406. #endif
  3407. qsort( static_cast<void*>(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel8 );
  3408. qsort( static_cast<void*>(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel7 );
  3409. qsort( static_cast<void*>(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel5 );
  3410. for(i=0; i<failbrancharray.GetSize (); i++)
  3411. {
  3412. // AfxMessageBox("连接"+failbrancharray.ElementAt(i)+"服务器失败!", MB_ICONINFORMATION);
  3413. }
  3414. g_pMainWnd->OnDisconnect();
  3415. g_bBranchModify=0;g_branchip=g_branchname="";
  3416. }
  3417. void TodayForm::GetData2(CString strdate, CString strdate2)//选片客人;
  3418. {
  3419. CString sql;
  3420. sql.Format ("time4>='"+strdate+"' and time4<='"+strdate2+"'");
  3421. if(g_bAllBranch==0)
  3422. {
  3423. g_sendhead.code[0]=121;
  3424. g_sendhead.tabcount=1;
  3425. g_sendhead.bsql=0;
  3426. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  3427. DataToArray(&m_List2array);
  3428. return;
  3429. }
  3430. //////////////数据汇总
  3431. m_List2array.RemoveAll ();
  3432. CStringArray failbrancharray;
  3433. CString branch;
  3434. for(int i=-1; i<g_brancharray.GetSize()-1; i++)
  3435. {
  3436. if(i!=-1)
  3437. {
  3438. branch=g_brancharray.ElementAt (i).ElementAt (0);
  3439. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  3440. g_pMainWnd->OnDisconnect();
  3441. g_branchname=branch;
  3442. g_bBranchModify=1;
  3443. }
  3444. else
  3445. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  3446. g_sendhead.bsql=0;
  3447. g_sendhead.code[0]=121;
  3448. g_sendhead.tabcount=1;
  3449. g_pMainWnd->ProcessChatMessageRequest2(sql);
  3450. if(g_bSendOK==0)
  3451. {
  3452. failbrancharray.Add(branch);
  3453. continue;
  3454. }
  3455. CArray<CStringArray, CStringArray>List1array;
  3456. DataToArray(&List1array);
  3457. int size=m_List2array.GetSize ();
  3458. for(int j=0; j<List1array.GetSize (); j++)
  3459. {
  3460. size++;
  3461. m_List2array.SetSize(size , 1 );
  3462. size--;
  3463. m_List2array.ElementAt (size).Copy (List1array.ElementAt (j));
  3464. m_List2array.ElementAt (size).InsertAt (0, branch);
  3465. size++;
  3466. }
  3467. }
  3468. g_pMainWnd->OnDisconnect();
  3469. g_bBranchModify=0;g_branchip=g_branchname="";
  3470. }
  3471. void TodayForm::GetData3(CString strdate, CString strdate2)//看设计客人;
  3472. {
  3473. CString sql;
  3474. sql.Format ("time6>='"+strdate+"' and time6<='"+strdate2+"'");
  3475. if(g_bAllBranch==0)
  3476. {
  3477. g_sendhead.code[0]=122;
  3478. g_sendhead.tabcount=1;
  3479. g_sendhead.bsql=0;
  3480. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  3481. DataToArray(&m_List3array);
  3482. return;
  3483. }
  3484. //////////////数据汇总
  3485. m_List3array.RemoveAll ();
  3486. CStringArray failbrancharray;
  3487. CString branch;
  3488. for(int i=-1; i<g_brancharray.GetSize ()-1; i++)
  3489. {
  3490. if(i!=-1)
  3491. {
  3492. branch=g_brancharray.ElementAt (i).ElementAt (0);
  3493. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  3494. g_pMainWnd->OnDisconnect();
  3495. g_branchname=branch;
  3496. g_bBranchModify=1;
  3497. }
  3498. else
  3499. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  3500. g_sendhead.bsql=0;
  3501. g_sendhead.code[0]=122;
  3502. g_sendhead.tabcount=1;
  3503. g_pMainWnd->ProcessChatMessageRequest2(sql);
  3504. if(g_bSendOK==0)
  3505. {
  3506. failbrancharray.Add (branch);
  3507. continue;
  3508. }
  3509. CArray<CStringArray, CStringArray>List1array;
  3510. DataToArray(&List1array);
  3511. int size=m_List3array.GetSize ();
  3512. for(int j=0; j<List1array.GetSize (); j++)
  3513. {
  3514. size++;
  3515. m_List3array.SetSize(size , 1 );
  3516. size--;
  3517. m_List3array.ElementAt (size).Copy (List1array.ElementAt (j));
  3518. m_List3array.ElementAt (size).InsertAt (0, branch);
  3519. size++;
  3520. }
  3521. }
  3522. g_pMainWnd->OnDisconnect();
  3523. g_bBranchModify=0;g_branchip=g_branchname="";
  3524. }
  3525. void TodayForm::GetData4(CString strdate, CString strdate2)//取件客人
  3526. {
  3527. CString sql;
  3528. sql.Format ("time5>='"+strdate+"' and time5<='"+strdate2+"' and [status3]='未取'");
  3529. if(g_bAllBranch==0)
  3530. {
  3531. g_sendhead.code[0]=123;
  3532. g_sendhead.tabcount=1;
  3533. g_sendhead.bsql=0;
  3534. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  3535. DataToArray(&m_List4array);
  3536. return;
  3537. }
  3538. //////////////数据汇总
  3539. m_List4array.RemoveAll ();
  3540. CStringArray failbrancharray;
  3541. CString branch;
  3542. for(int i=-1; i<g_brancharray.GetSize ()-1; i++)
  3543. {
  3544. if(i!=-1)
  3545. {
  3546. branch=g_brancharray.ElementAt (i).ElementAt (0);
  3547. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  3548. g_pMainWnd->OnDisconnect();
  3549. g_branchname=branch;
  3550. g_bBranchModify=1;
  3551. }
  3552. else
  3553. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  3554. g_sendhead.bsql=0;
  3555. g_sendhead.code[0]=123;
  3556. g_sendhead.tabcount=1;
  3557. g_pMainWnd->ProcessChatMessageRequest2(sql);
  3558. if(g_bSendOK==0)
  3559. {
  3560. failbrancharray.Add (branch);
  3561. continue;
  3562. }
  3563. CArray<CStringArray, CStringArray>List1array;
  3564. DataToArray(&List1array);
  3565. int size=m_List4array.GetSize ();
  3566. for(int j=0; j<List1array.GetSize (); j++)
  3567. {
  3568. size++;
  3569. m_List4array.SetSize(size , 1 );
  3570. size--;
  3571. m_List4array.ElementAt (size).Copy (List1array.ElementAt (j));
  3572. m_List4array.ElementAt (size).InsertAt (0, branch);
  3573. size++;
  3574. }
  3575. }
  3576. g_pMainWnd->OnDisconnect();
  3577. g_bBranchModify=0;g_branchip=g_branchname="";
  3578. }
  3579. void TodayForm::GetData5(CString strdate, CString strdate2)// 近期生日;
  3580. {//MessageBox("fd");
  3581. CString sql;
  3582. sql.Format ("hqdate>='"+strdate+"' and hqdate<='"+strdate2+"' and kind='2'");
  3583. // sql.Format ("%s,%s", strdate,strdate2);
  3584. if(g_bAllBranch==0)
  3585. {
  3586. g_sendhead.code[0]=227;
  3587. g_sendhead.tabcount=1;
  3588. g_sendhead.bsql=0;
  3589. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  3590. DataToArray(&m_List5array);
  3591. return;
  3592. }
  3593. //////////////数据汇总
  3594. m_List5array.RemoveAll ();
  3595. CStringArray failbrancharray;
  3596. CString branch;
  3597. for(int i=-1; i<g_brancharray.GetSize ()-1; i++)
  3598. {
  3599. if(i!=-1)
  3600. {
  3601. branch=g_brancharray.ElementAt (i).ElementAt (0);
  3602. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  3603. g_pMainWnd->OnDisconnect();
  3604. g_branchname=branch;
  3605. g_bBranchModify=1;
  3606. }
  3607. else
  3608. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  3609. g_sendhead.bsql=0;
  3610. g_sendhead.code[0]=227;
  3611. g_sendhead.tabcount=1;
  3612. g_pMainWnd->ProcessChatMessageRequest2(sql);
  3613. if(g_bSendOK==0)
  3614. {
  3615. failbrancharray.Add (branch);
  3616. continue;
  3617. }
  3618. CArray<CStringArray, CStringArray>List1array;
  3619. DataToArray(&List1array);
  3620. int size=m_List5array.GetSize ();
  3621. for(int j=0; j<List1array.GetSize (); j++)
  3622. {
  3623. size++;
  3624. m_List5array.SetSize(size , 1 );
  3625. size--;
  3626. m_List5array.ElementAt (size).Copy (List1array.ElementAt (j));
  3627. m_List5array.ElementAt (size).InsertAt (0, branch);
  3628. size++;
  3629. }
  3630. }
  3631. g_pMainWnd->OnDisconnect();
  3632. g_bBranchModify=0;g_branchip=g_branchname="";
  3633. }
  3634. void TodayForm::OnBUTtakeaway() // 打印;
  3635. {
  3636. // TODO: Add your control notification handler code here
  3637. if(IsHasRights2new(2)==0)return;
  3638. if(m_radio==0)
  3639. {
  3640. SelMemberCardFund seldlg;
  3641. seldlg.m_mode=1;
  3642. if(seldlg.DoModal ()!=IDOK)return;
  3643. if(seldlg.m_radio1==0)
  3644. {
  3645. OnBUTtakeaway1();return;
  3646. }
  3647. }
  3648. else if(m_radio==1)
  3649. {
  3650. OnBUTtakeaway2();return;
  3651. }
  3652. else if(m_radio==2)
  3653. {
  3654. OnBUTtakeaway3();return;
  3655. }
  3656. else if(m_radio==3)
  3657. {
  3658. OnBUTtakeaway4();return;
  3659. }
  3660. else if(m_radio==4)
  3661. {
  3662. OnBUTtakeaway5();return;
  3663. }
  3664. POSITION pos;
  3665. pos=m_List1.GetFirstSelectedItemPosition();
  3666. if(pos==NULL)
  3667. {
  3668. AfxMessageBox("请先选中您要打印的项目!", MB_ICONINFORMATION);
  3669. return;
  3670. }
  3671. int iItem;
  3672. CArray<CStringArray, CStringArray>Listarray;
  3673. int count=m_List1.GetItemCount ();
  3674. Listarray.SetSize(count, 1);
  3675. count=0;
  3676. int curpos=0;
  3677. CString str;
  3678. int nChild=1;
  3679. CString name,m_name1,m_name2;
  3680. CString phone,m_phone1,m_phone2;
  3681. #ifdef CHILD_VERSION
  3682. nChild=2;
  3683. #endif
  3684. while (pos)
  3685. {
  3686. name="";
  3687. phone="";
  3688. iItem = m_List1.GetNextSelectedItem(pos);
  3689. Listarray.ElementAt (curpos).Add ("日期");
  3690. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 8+nChild+m_nAdd+m_nAdd2));
  3691. Listarray.ElementAt (curpos).Add ("时间");
  3692. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 9+nChild+m_nAdd+m_nAdd2));
  3693. m_name1=m_List1.GetItemText (iItem, 1+m_nAdd);
  3694. m_name2=m_List1.GetItemText (iItem, 2+m_nAdd);
  3695. m_phone1=m_List1.GetItemText (iItem, 3+m_nAdd);
  3696. m_phone2=m_List1.GetItemText (iItem, 4+m_nAdd);
  3697. #ifdef CHILD_VERSION
  3698. m_phone1=m_List1.GetItemText (iItem, 5+m_nAdd);
  3699. m_phone2=m_List1.GetItemText (iItem, 6+m_nAdd);
  3700. #endif
  3701. if(!m_name1.IsEmpty ())
  3702. name=m_name1+",";
  3703. name+=m_name2;
  3704. name.TrimRight (",");
  3705. if(!m_phone1.IsEmpty ())
  3706. phone=m_phone1+",";
  3707. phone+=m_phone2;phone.TrimRight (",");
  3708. Listarray.ElementAt (curpos).Add ("客人姓名");
  3709. Listarray.ElementAt (curpos).Add (name);
  3710. Listarray.ElementAt (curpos).Add ("联系电话");
  3711. Listarray.ElementAt (curpos).Add (phone);
  3712. Listarray.ElementAt (curpos).Add ("景点");
  3713. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 6+nChild+m_nAdd));
  3714. Listarray.ElementAt (curpos).Add ("摄影师");
  3715. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 12+nChild+m_nAdd+m_nAdd2));
  3716. Listarray.ElementAt (curpos).Add ("助理");
  3717. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 13+nChild+m_nAdd+m_nAdd2));
  3718. #ifdef CHILD_VERSION
  3719. Listarray.ElementAt (curpos).Add ("引导师");
  3720. #else
  3721. Listarray.ElementAt (curpos).Add ("化妆师");
  3722. #endif
  3723. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 14+nChild+m_nAdd+m_nAdd2));
  3724. Listarray.ElementAt (curpos).Add ("助理");
  3725. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 15+nChild+m_nAdd+m_nAdd2));
  3726. Listarray.ElementAt (curpos).Add ("服装");
  3727. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 16+nChild+m_nAdd+m_nAdd2));
  3728. Listarray.ElementAt (curpos).Add ("门市");
  3729. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 18+nChild+m_nAdd+m_nAdd2));
  3730. Listarray.ElementAt (curpos).Add ("备注");
  3731. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 17+nChild+m_nAdd+m_nAdd2));
  3732. curpos++;
  3733. }
  3734. Listarray.SetSize(curpos, 1);
  3735. g_pMainWnd->PrintTakeForm(&Listarray);
  3736. }
  3737. void TodayForm::GetCalendarData()
  3738. {
  3739. if(m_bInit==0)return;
  3740. if(m_bShowCalendar==0)return;
  3741. m_spinyear.EnableWindow(0);
  3742. m_spinmonth.EnableWindow(0);
  3743. m_spinday.EnableWindow(0);
  3744. UpdateData();
  3745. CString strdate,strdate2;
  3746. strdate.Format ("%04d-%02d-%02d", m_year, m_month, 1);
  3747. strdate2.Format ("%04d-%02d-%02d", m_year, m_month, 31);
  3748. CString sql;
  3749. 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'";
  3750. g_sendhead.code[0]=120;
  3751. g_sendhead.code[1]=121;
  3752. g_sendhead.code[2]=122;
  3753. g_sendhead.code[3]=123;
  3754. g_sendhead.code[4]=139;
  3755. g_sendhead.tabcount=5;
  3756. g_sendhead.bsql=0;
  3757. g_pMainWnd->ProcessChatMessageRequest2(sql);
  3758. m_spinyear.EnableWindow(1);
  3759. m_spinmonth.EnableWindow(1);
  3760. m_spinday.EnableWindow(1);
  3761. if(g_bSendOK==0)return;
  3762. CArray<CStringArray, CStringArray>m_List1array;
  3763. CArray<CStringArray, CStringArray>m_List2array;
  3764. CArray<CStringArray, CStringArray>m_List3array;
  3765. CArray<CStringArray, CStringArray>m_List4array;
  3766. CArray<CStringArray, CStringArray>m_List5array;
  3767. DataToArray(&m_List1array, &m_List2array, &m_List3array, &m_List4array, &m_List5array);
  3768. CArray<int,int>array1;
  3769. CArray<int,int>array2;
  3770. CArray<int,int>array3;
  3771. CArray<int,int>array4;
  3772. CArray<int,int>array5;
  3773. int pos;
  3774. int i = 0;
  3775. for( i=0; i<32; i++)
  3776. {
  3777. array1.Add (0);
  3778. array2.Add (0);
  3779. array3.Add (0);
  3780. array4.Add (0);
  3781. array5.Add (0);
  3782. }
  3783. for(i=0; i<m_List1array.GetSize (); i++)
  3784. {
  3785. // - old code: Jeff remark:没有对集团版进行处理;
  3786. // #ifdef CHILD_VERSION
  3787. // pos=atoi(m_List1array.ElementAt (i).ElementAt (8).Right (2));
  3788. // #else
  3789. // pos=atoi(m_List1array.ElementAt (i).ElementAt (9).Right (2));
  3790. // #endif
  3791. // the follow is modify by Jeff;
  3792. #ifdef CHILD_VERSION // 儿童版
  3793. #ifdef ENTERPRISE_VERSION
  3794. pos=atoi(m_List1array.ElementAt (i).ElementAt (9).Right (2));
  3795. #else
  3796. pos=atoi(m_List1array.ElementAt (i).ElementAt (8).Right (2));
  3797. #endif
  3798. #else // 婚纱版
  3799. #ifdef ENTERPRISE_VERSION
  3800. pos=atoi(m_List1array.ElementAt (i).ElementAt (10).Right (2));
  3801. #else
  3802. pos=atoi(m_List1array.ElementAt (i).ElementAt (9).Right (2));
  3803. #endif
  3804. #endif
  3805. array1.SetAt (pos, array1.ElementAt (pos)+1);
  3806. }
  3807. for(i=0; i<m_List2array.GetSize (); i++)
  3808. {
  3809. pos=atoi(m_List2array.ElementAt (i).ElementAt (5).Right (2));
  3810. array2.SetAt (pos, array2.ElementAt (pos)+1);
  3811. }
  3812. for(i=0; i<m_List3array.GetSize (); i++)
  3813. {
  3814. pos=atoi(m_List3array.ElementAt (i).ElementAt (5).Right (2));
  3815. array3.SetAt (pos, array3.ElementAt (pos)+1);
  3816. }
  3817. for(i=0; i<m_List4array.GetSize (); i++)
  3818. {
  3819. pos=atoi(m_List4array.ElementAt (i).ElementAt (5).Right (2));
  3820. array4.SetAt (pos, array4.ElementAt (pos)+1);
  3821. }
  3822. for(i=0; i<m_List5array.GetSize (); i++)
  3823. {
  3824. pos=atoi(m_List5array.ElementAt (i).ElementAt (6).Right (2));
  3825. array5.SetAt (pos, array5.ElementAt (pos)+1);
  3826. }
  3827. m_CalendarFrm.m_oCalendar.m_Array.RemoveAll ();
  3828. CString str;
  3829. for(i=0; i<32; i++)
  3830. {
  3831. #ifndef CHILD_VERSION //wangwenbin mark
  3832. str.Format ("拍照客人: %d\n选片客人: %d\n看样客人: %d\n取件客人: %d\n婚庆客人: %d\n",
  3833. array1.ElementAt (i), array2.ElementAt (i), array3.ElementAt (i), array4.ElementAt (i), array5.ElementAt (i));
  3834. #else
  3835. str.Format ("拍照客人: %d\n选片客人: %d\n看样客人: %d\n取件客人: %d\n",
  3836. array1.ElementAt (i), array2.ElementAt (i), array3.ElementAt (i), array4.ElementAt (i));
  3837. #endif
  3838. m_CalendarFrm.m_oCalendar.m_Array.Add (str); // Jeff:添加到日历控件中;
  3839. }
  3840. //SetDate(iYear, iMonth, iDay);
  3841. m_CalendarFrm.DateChange(m_year, m_month);
  3842. m_CalendarFrm.m_oCalendar.Invalidate ();
  3843. }
  3844. // Jeff:按钮:详情图表;
  3845. void TodayForm::OnBUTall() // 详情;
  3846. {
  3847. // TODO: Add your control notification handler code here
  3848. m_bShowCalendar=!m_bShowCalendar;
  3849. if(m_bShowCalendar)
  3850. {
  3851. GetDlgItem(IDC_BUTall)->SetWindowText("详情");
  3852. m_List1.ShowWindow (SW_HIDE);
  3853. m_List2.ShowWindow (SW_HIDE);
  3854. m_List3.ShowWindow (SW_HIDE);
  3855. m_List4.ShowWindow (SW_HIDE);
  3856. m_List5.ShowWindow (SW_HIDE);
  3857. m_List6.ShowWindow (SW_HIDE);
  3858. m_CalendarFrm.ShowWindow (SW_SHOW);
  3859. }
  3860. else
  3861. {
  3862. GetDlgItem(IDC_BUTall)->SetWindowText("图表");
  3863. m_CalendarFrm.ShowWindow (SW_HIDE);
  3864. DateChange();
  3865. }
  3866. }
  3867. void TodayForm::SetDate(int m_iYear, int m_iMonth, int m_iDay)
  3868. {
  3869. UpdateData();
  3870. m_year = m_iYear;
  3871. m_month = m_iMonth;
  3872. m_day = m_iDay;
  3873. UpdateData(false);
  3874. }
  3875. void TodayForm::OnBUTall2()
  3876. {
  3877. OnBUTall();
  3878. }
  3879. void TodayForm::OnRadio9()
  3880. {
  3881. // TODO: Add your control notification handler code here
  3882. OnRadio8();
  3883. }
  3884. void TodayForm::OnRadio14()
  3885. {
  3886. // TODO: Add your control notification handler code here
  3887. OnRadio8();
  3888. }
  3889. void TodayForm::OnRadio15()
  3890. {
  3891. // TODO: Add your control notification handler code here
  3892. OnRadio8();
  3893. }
  3894. //hideprice
  3895. void TodayForm::OnRadio10()
  3896. {
  3897. // TODO: Add your control notification handler code here
  3898. OnRadio8();
  3899. }
  3900. void TodayForm::ReLoad1()
  3901. {
  3902. DateChange();
  3903. }
  3904. CString TodayForm::GetDate()
  3905. {
  3906. UpdateData();
  3907. CString strdate;
  3908. strdate.Format ("%04d-%02d-%02d", m_year, m_month, m_day);
  3909. return strdate;
  3910. }
  3911. //天后生日
  3912. void TodayForm::OnBUTtakeaway1()
  3913. {
  3914. CArray<CStringArray, CStringArray>Listarray;
  3915. CString name,m_name1,m_name2;
  3916. CString phone,m_phone1,m_phone2;
  3917. int nChild=1;
  3918. #ifdef CHILD_VERSION
  3919. nChild=2;
  3920. #endif
  3921. int count=m_List1.GetItemCount ()/45;
  3922. if(m_List1.GetItemCount ()%45)count++;
  3923. Listarray.SetSize(m_List1.GetItemCount ()+count, 1);
  3924. int pos=0;
  3925. for(int i=0; i<m_List1.GetItemCount (); i++)
  3926. {
  3927. if(i%45==0)
  3928. {
  3929. Listarray.ElementAt (pos).Add ("客人/电话");
  3930. Listarray.ElementAt (pos).Add ("景点");
  3931. Listarray.ElementAt (pos).Add ("日期/时间");
  3932. Listarray.ElementAt (pos).Add ("摄影/助理");
  3933. Listarray.ElementAt (pos).Add ("化妆/助理");
  3934. Listarray.ElementAt (pos).Add ("服装");
  3935. Listarray.ElementAt (pos).Add ("门市");
  3936. pos++;
  3937. }
  3938. name=""; phone="";
  3939. m_name1=m_List1.GetItemText (i, 1+m_nAdd);
  3940. m_name2=m_List1.GetItemText (i, 2+m_nAdd);
  3941. if(!m_name1.IsEmpty ())
  3942. name=m_name1+",";
  3943. name+=m_name2;
  3944. name.TrimRight (",");
  3945. m_phone1=m_List1.GetItemText (i, 3+m_nAdd);
  3946. m_phone2=m_List1.GetItemText (i, 4+m_nAdd);
  3947. #ifdef CHILD_VERSION
  3948. m_phone1=m_List1.GetItemText (i, 5+m_nAdd);
  3949. m_phone2=m_List1.GetItemText (i, 6+m_nAdd);
  3950. #endif
  3951. if(!m_phone1.IsEmpty ())
  3952. phone=m_phone1+",";
  3953. phone+=m_phone2;phone.TrimRight (",");
  3954. Listarray.ElementAt (pos).Add (name+"/"+phone);
  3955. Listarray.ElementAt (pos).Add (m_List1.GetItemText (i, 6+nChild+m_nAdd));
  3956. Listarray.ElementAt (pos).Add (m_List1.GetItemText (i, 8+nChild+m_nAdd+m_nAdd2)+"/"+m_List1.GetItemText (i, 9+nChild+m_nAdd+m_nAdd2));
  3957. Listarray.ElementAt (pos).Add (m_List1.GetItemText (i, 12+nChild+m_nAdd+m_nAdd2)+"/"+m_List1.GetItemText (i, 13+nChild+m_nAdd+m_nAdd2));
  3958. Listarray.ElementAt (pos).Add (m_List1.GetItemText (i, 14+nChild+m_nAdd+m_nAdd2)+"/"+m_List1.GetItemText (i, 15+nChild+m_nAdd+m_nAdd2));
  3959. Listarray.ElementAt (pos).Add (m_List1.GetItemText (i, 16+nChild+m_nAdd+m_nAdd2));
  3960. Listarray.ElementAt (pos).Add (m_List1.GetItemText (i, 18+nChild+m_nAdd+m_nAdd2));
  3961. pos++;
  3962. }
  3963. Listarray.SetSize(pos, 1);
  3964. g_pMainWnd->PrintTakeForm1(&Listarray);
  3965. }
  3966. void TodayForm::OnBUTtakeaway2()
  3967. {
  3968. CArray<CStringArray, CStringArray>Listarray;
  3969. CString name,m_name1,m_name2;
  3970. CString phone,m_phone1,m_phone2;
  3971. int nChild=0;
  3972. #ifdef CHILD_VERSION
  3973. nChild=-1;
  3974. #endif
  3975. int count=m_List2.GetItemCount ()/45;
  3976. if(m_List2.GetItemCount ()%45)count++;
  3977. Listarray.SetSize(m_List2.GetItemCount ()+count, 1);
  3978. int pos=0;
  3979. for(int i=0; i<m_List2.GetItemCount (); i++)
  3980. {
  3981. if(i%45==0)
  3982. {
  3983. Listarray.ElementAt (pos).Add ("客人/电话");
  3984. Listarray.ElementAt (pos).Add ("日期/时间");
  3985. Listarray.ElementAt (pos).Add ("选片人");
  3986. Listarray.ElementAt (pos).Add ("套系");
  3987. Listarray.ElementAt (pos).Add ("门市");
  3988. pos++;
  3989. }
  3990. name=""; phone="";
  3991. m_name1=m_List2.GetItemText (i, 1+m_nAdd);
  3992. m_name2=m_List2.GetItemText (i, 2+m_nAdd);
  3993. if(!m_name1.IsEmpty ())
  3994. name=m_name1+",";
  3995. name+=m_name2;
  3996. name.TrimRight (",");
  3997. m_phone1=m_List2.GetItemText (i, 3+m_nAdd);
  3998. m_phone2=m_List2.GetItemText (i, 4+m_nAdd);
  3999. #ifdef CHILD_VERSION
  4000. m_phone1=m_List2.GetItemText (i, 3+m_nAdd);
  4001. m_phone2=m_List2.GetItemText (i, 4+m_nAdd);
  4002. #endif
  4003. if(!m_phone1.IsEmpty ())
  4004. phone=m_phone1+",";
  4005. phone+=m_phone2;phone.TrimRight (",");
  4006. Listarray.ElementAt (pos).Add (name+"/"+phone);
  4007. Listarray.ElementAt (pos).Add (m_List2.GetItemText (i, 5+m_nAdd)+"/"+m_List2.GetItemText (i, 6+m_nAdd));
  4008. Listarray.ElementAt (pos).Add (m_List2.GetItemText (i, 9+nChild+m_nAdd));
  4009. Listarray.ElementAt (pos).Add (m_List2.GetItemText (i, 11+nChild+m_nAdd));
  4010. Listarray.ElementAt (pos).Add (m_List2.GetItemText (i, 10+nChild+m_nAdd));
  4011. pos++;
  4012. }
  4013. Listarray.SetSize(pos, 1);
  4014. g_pMainWnd->PrintTakeForm2(&Listarray);
  4015. }
  4016. void TodayForm::OnBUTtakeaway3()
  4017. {
  4018. CArray<CStringArray, CStringArray>Listarray;
  4019. CString name,m_name1,m_name2;
  4020. CString phone,m_phone1,m_phone2;
  4021. int nChild=0;
  4022. #ifdef CHILD_VERSION
  4023. nChild=-1;
  4024. #endif
  4025. int count=m_List3.GetItemCount ()/45;
  4026. if(m_List3.GetItemCount ()%45)count++;
  4027. Listarray.SetSize(m_List3.GetItemCount ()+count, 1);
  4028. int pos=0;
  4029. for(int i=0; i<m_List3.GetItemCount (); i++)
  4030. {
  4031. if(i%45==0)
  4032. {
  4033. Listarray.ElementAt (pos).Add ("客人/电话");
  4034. Listarray.ElementAt (pos).Add ("日期/时间");
  4035. Listarray.ElementAt (pos).Add ("看设计人");
  4036. Listarray.ElementAt (pos).Add ("套系");
  4037. Listarray.ElementAt (pos).Add ("门市");
  4038. pos++;
  4039. }
  4040. name=""; phone="";
  4041. m_name1=m_List3.GetItemText (i, 1+m_nAdd);
  4042. m_name2=m_List3.GetItemText (i, 2+m_nAdd);
  4043. if(!m_name1.IsEmpty ())
  4044. name=m_name1+",";
  4045. name+=m_name2;
  4046. name.TrimRight (",");
  4047. m_phone1=m_List3.GetItemText (i, 3+m_nAdd);
  4048. m_phone2=m_List3.GetItemText (i, 4+m_nAdd);
  4049. #ifdef CHILD_VERSION
  4050. m_phone1=m_List3.GetItemText (i, 3+m_nAdd);
  4051. m_phone2=m_List3.GetItemText (i, 4+m_nAdd);
  4052. #endif
  4053. if(!m_phone1.IsEmpty ())
  4054. phone=m_phone1+",";
  4055. phone+=m_phone2;phone.TrimRight (",");
  4056. Listarray.ElementAt (pos).Add (name+"/"+phone);
  4057. Listarray.ElementAt (pos).Add (m_List3.GetItemText (i, 5+m_nAdd)+"/"+m_List3.GetItemText (i, 6+m_nAdd));
  4058. Listarray.ElementAt (pos).Add (m_List3.GetItemText (i, 10+nChild+m_nAdd));
  4059. Listarray.ElementAt (pos).Add (m_List3.GetItemText (i, 12+nChild+m_nAdd));
  4060. Listarray.ElementAt (pos).Add (m_List3.GetItemText (i, 11+nChild+m_nAdd));
  4061. pos++;
  4062. }
  4063. Listarray.SetSize(pos, 1);
  4064. g_pMainWnd->PrintTakeForm3(&Listarray);
  4065. }
  4066. void TodayForm::OnBUTtakeaway4()
  4067. {
  4068. CArray<CStringArray, CStringArray>Listarray;
  4069. CString name,m_name1,m_name2;
  4070. CString phone,m_phone1,m_phone2;
  4071. int nChild=0;
  4072. #ifdef CHILD_VERSION
  4073. nChild=-1;
  4074. #endif
  4075. int count=m_List4.GetItemCount ()/45;
  4076. if(m_List4.GetItemCount ()%45)count++;
  4077. Listarray.SetSize(m_List4.GetItemCount ()+count, 1);
  4078. int pos=0;
  4079. for(int i=0; i<m_List4.GetItemCount (); i++)
  4080. {
  4081. if(i%45==0)
  4082. {
  4083. Listarray.ElementAt (pos).Add ("客人/电话");
  4084. Listarray.ElementAt (pos).Add ("日期/时间");
  4085. Listarray.ElementAt (pos).Add ("取件人");
  4086. Listarray.ElementAt (pos).Add ("是否完件");
  4087. Listarray.ElementAt (pos).Add ("门市");
  4088. pos++;
  4089. }
  4090. name=""; phone="";
  4091. m_name1=m_List4.GetItemText (i, 1+m_nAdd);
  4092. m_name2=m_List4.GetItemText (i, 2+m_nAdd);
  4093. if(!m_name1.IsEmpty ())
  4094. name=m_name1+",";
  4095. name+=m_name2;
  4096. name.TrimRight (",");
  4097. m_phone1=m_List4.GetItemText (i, 3+m_nAdd);
  4098. m_phone2=m_List4.GetItemText (i, 4+m_nAdd);
  4099. #ifdef CHILD_VERSION
  4100. m_phone1=m_List4.GetItemText (i, 3+m_nAdd);
  4101. m_phone2=m_List4.GetItemText (i, 4+m_nAdd);
  4102. #endif
  4103. if(!m_phone1.IsEmpty ())
  4104. phone=m_phone1+",";
  4105. phone+=m_phone2;phone.TrimRight (",");
  4106. Listarray.ElementAt (pos).Add (name+"/"+phone);
  4107. Listarray.ElementAt (pos).Add (m_List4.GetItemText (i, 5+m_nAdd)+"/"+m_List4.GetItemText (i, 6+m_nAdd));
  4108. Listarray.ElementAt (pos).Add (m_List4.GetItemText (i, 10+nChild+m_nAdd));
  4109. Listarray.ElementAt (pos).Add (m_List4.GetItemText (i, 9+nChild+m_nAdd));
  4110. Listarray.ElementAt (pos).Add (m_List4.GetItemText (i, 11+nChild+m_nAdd));
  4111. pos++;
  4112. }
  4113. Listarray.SetSize(pos, 1);
  4114. g_pMainWnd->PrintTakeForm4(&Listarray);
  4115. }
  4116. void TodayForm::OnBUTtakeaway5()
  4117. {
  4118. CArray<CStringArray, CStringArray>Listarray;
  4119. CString name,m_name1,m_name2;
  4120. CString phone,m_phone1,m_phone2;
  4121. int count=m_List5.GetItemCount ()/45;
  4122. if(m_List5.GetItemCount ()%45)count++;
  4123. Listarray.SetSize(m_List5.GetItemCount ()+count, 1);
  4124. int pos=0;
  4125. int aa=0;
  4126. for(int i=0; i<m_List5.GetItemCount (); i++)
  4127. {
  4128. CString date=m_List5.GetItemText (i, 7+m_nAdd);
  4129. if(!(date.GetLength()==10 && date>=m_date1 && date<=m_date2))continue;
  4130. if(aa%45==0)
  4131. {
  4132. Listarray.ElementAt (pos).Add ("客人/电话");
  4133. Listarray.ElementAt (pos).Add ("婚庆内容");
  4134. Listarray.ElementAt (pos).Add ("日期/时间");
  4135. Listarray.ElementAt (pos).Add ("服务人员");
  4136. Listarray.ElementAt (pos).Add ("服务人员2");
  4137. Listarray.ElementAt (pos).Add ("套系");
  4138. Listarray.ElementAt (pos).Add ("门市");
  4139. pos++;
  4140. }
  4141. aa++;
  4142. name=""; phone="";
  4143. int idpos=i;
  4144. while(m_List5.GetItemText (idpos, 0+m_nAdd)=="")
  4145. idpos--;
  4146. m_name1=m_List5.GetItemText (idpos, 1+m_nAdd);
  4147. m_name2=m_List5.GetItemText (idpos, 2+m_nAdd);
  4148. if(!m_name1.IsEmpty ())
  4149. name=m_name1+",";
  4150. name+=m_name2;
  4151. name.TrimRight (",");
  4152. m_phone1=m_List5.GetItemText (idpos, 3+m_nAdd);
  4153. m_phone2=m_List5.GetItemText (idpos, 4+m_nAdd);
  4154. if(!m_phone1.IsEmpty ())
  4155. phone=m_phone1+",";
  4156. phone+=m_phone2;phone.TrimRight (",");
  4157. Listarray.ElementAt (pos).Add (name+"/"+phone);
  4158. Listarray.ElementAt (pos).Add (m_List5.GetItemText (i, 6+m_nAdd));
  4159. Listarray.ElementAt (pos).Add (m_List5.GetItemText (i, 7+m_nAdd)+"/"+m_List5.GetItemText (i, 8+m_nAdd));
  4160. Listarray.ElementAt (pos).Add (m_List5.GetItemText (i, 9+m_nAdd));
  4161. Listarray.ElementAt (pos).Add (m_List5.GetItemText (i, 10+m_nAdd));
  4162. Listarray.ElementAt (pos).Add (m_List5.GetItemText (idpos, 14+m_nAdd));
  4163. Listarray.ElementAt (pos).Add (m_List5.GetItemText (idpos, 13+m_nAdd));
  4164. pos++;
  4165. }
  4166. Listarray.SetSize(pos, 1);
  4167. g_pMainWnd->PrintTakeForm5(&Listarray);
  4168. }
  4169. void TodayForm::OnDblclkList8(NMHDR* pNMHDR, LRESULT* pResult)
  4170. {
  4171. // TODO: Add your control notification handler code here
  4172. OnBUTchoose();
  4173. *pResult = 0;
  4174. }