TodayForm.cpp 141 KB

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