TodayForm.cpp 127 KB

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