TodayForm.cpp 128 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. if(0)
  739. {
  740. CTime tm=GetTmFromStr("1512-00-12");
  741. CString ss;
  742. ss.Format ("%d-%d-%d", tm.GetYear (), tm.GetMonth (), tm.GetDay ());
  743. MessageBox(ss);
  744. return ;
  745. }
  746. if(m_radio==5)
  747. {
  748. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0);
  749. GetDlgItem(IDC_BUTall)->ShowWindow(0);
  750. GetDlgItem(IDC_BUTtake3)->ShowWindow(0);
  751. GetDlgItem(IDC_BUTtake)->ShowWindow(0);
  752. GetDlgItem(IDC_BUTchoose)->ShowWindow(0);
  753. GetDlgItem(IDC_RADIO9)->ShowWindow(1);
  754. GetDlgItem(IDC_RADIO14)->ShowWindow(1);
  755. GetDlgItem(IDC_RADIO15)->ShowWindow(1);
  756. }
  757. else if(m_radio==6 )
  758. {
  759. m_childdlg.m_table.ModeChange(10);
  760. m_table.ModeChange(10);
  761. m_table.Test2 ();
  762. m_table.ShowWindow(SW_SHOW);
  763. m_childdlg.ShowWindow(SW_SHOW);
  764. m_scrollbar.ShowWindow(SW_SHOW);
  765. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0);
  766. GetDlgItem(IDC_BUTall)->ShowWindow(0);
  767. GetDlgItem(IDC_BUTtake3)->ShowWindow(0);
  768. GetDlgItem(IDC_BUTtake)->ShowWindow(1);
  769. GetDlgItem(IDC_BUTchoose)->ShowWindow(1);
  770. GetDlgItem(IDC_BUTtake)->SetWindowText("另约日期");
  771. GetDlgItem(IDC_BUTchoose)->SetWindowText("取消预约");
  772. GetDlgItem(IDC_RADIO9)->ShowWindow(0);
  773. GetDlgItem(IDC_RADIO14)->ShowWindow(0);
  774. GetDlgItem(IDC_RADIO15)->ShowWindow(0);
  775. }
  776. else
  777. {
  778. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(1);
  779. if(!g_bAllBranch)GetDlgItem(IDC_BUTall)->ShowWindow(1);
  780. GetDlgItem(IDC_BUTtake3)->ShowWindow(1);
  781. GetDlgItem(IDC_BUTtake)->ShowWindow(1);
  782. GetDlgItem(IDC_BUTchoose)->ShowWindow(1);
  783. GetDlgItem(IDC_BUTtake)->SetWindowText("客人预约");
  784. GetDlgItem(IDC_BUTchoose)->SetWindowText("重新安排");
  785. GetDlgItem(IDC_RADIO9)->ShowWindow(0);
  786. GetDlgItem(IDC_RADIO14)->ShowWindow(0);
  787. GetDlgItem(IDC_RADIO15)->ShowWindow(0);
  788. }
  789. if(0)//m_radio==5)
  790. {
  791. GetDlgItem(IDC_CHECK1)->SetWindowText("近半个月");
  792. GetDlgItem(IDC_CHECK2)->SetWindowText("近一个月");
  793. }
  794. else
  795. {
  796. GetDlgItem(IDC_CHECK1)->SetWindowText("近一个星期");
  797. GetDlgItem(IDC_CHECK2)->SetWindowText("近半个月");
  798. }
  799. if(m_radio==0||m_radio==1||m_radio==2||m_radio==3||m_radio==4)
  800. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(1);
  801. else
  802. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0);
  803. if(m_radio==0)
  804. GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未拍");
  805. if(m_radio==1)
  806. GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未选");
  807. if(m_radio==2)
  808. GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未看");
  809. if(m_radio==3)
  810. GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未取");
  811. if(m_radio==4)
  812. GetDlgItem(IDC_BUTtake3)->SetWindowText("统计婚庆");
  813. g_todayradio=m_radio;
  814. g_todaycheck=0;
  815. CTime tm=CTime(m_year, m_month, m_day, 0, 0, 0);
  816. g_todaytm=tm;
  817. CString strdate,strdate2;
  818. strdate.Format ("%04d-%02d-%02d", m_year, m_month, m_day);
  819. if(m_check)
  820. {
  821. CTime tm=CTime(m_year, m_month, m_day, 0, 0, 0);
  822. if(m_radio==5)
  823. tm+=CTimeSpan(15, 0, 0, 0);
  824. else
  825. tm+=CTimeSpan(7, 0, 0, 0);
  826. strdate2=tm.Format ("%Y-%m-%d");
  827. g_todaycheck=1;
  828. }
  829. else if(m_check2)
  830. {
  831. CTime tm=CTime(m_year, m_month, m_day, 0, 0, 0);
  832. if(m_radio==5)
  833. tm+=CTimeSpan(31, 0, 0, 0);
  834. else
  835. tm+=CTimeSpan(15, 0, 0, 0);
  836. strdate2=tm.Format ("%Y-%m-%d");
  837. g_todaycheck=2;
  838. }
  839. else
  840. strdate2=strdate;
  841. COleDateTime dtDay(m_year, m_month, m_day, 0, 0, 0);
  842. int nDayWeek = dtDay.GetDayOfWeek()-1; //得到星期几,1=Sunday, 2=Monday,
  843. CString DayOfWeek[7]={"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};
  844. CString sdate;
  845. if(nDayWeek>=0 && nDayWeek<=6)
  846. sdate=DayOfWeek[nDayWeek];
  847. else
  848. sdate="无效日期";
  849. // LOG4C((LOG_NOTICE,"==%s,%s",strdate,sdate));
  850. m_static1.SetWindowText (strdate+"("+sdate+")小秘书");
  851. int i = 0;
  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(/*int*/ 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. int i;
  1302. try
  1303. {
  1304. for( i=0; i<List1array.GetSize(); i++)
  1305. {
  1306. sex="男";
  1307. name=List1array.ElementAt (i).ElementAt (0);
  1308. phone=List1array.ElementAt (i).ElementAt (2);
  1309. birthday=List1array.ElementAt (i).ElementAt (5);
  1310. birthdaybak=birthday;
  1311. checknl=atoi(List1array.ElementAt (i).ElementAt (10));
  1312. if(m_radio2==1 || m_radio2==2)
  1313. {
  1314. birthday=List1array.ElementAt (i).ElementAt (4);
  1315. birthdaybak=birthday;
  1316. checknl=atoi(List1array.ElementAt (i).ElementAt (12));
  1317. }
  1318. ndays=-1;
  1319. if(checknl==0 && birthday.GetLength()==10)
  1320. {
  1321. if(m_radio2==1)
  1322. {
  1323. CTime tm=GetTmFromStr(birthday);
  1324. CTimeSpan dt=tm-todaytm;
  1325. ndays=dt.GetDays();
  1326. days.Format("%d天后结婚", ndays);
  1327. if(ndays==0)
  1328. days="今天结婚";
  1329. }
  1330. else if(m_radio2==2)
  1331. {
  1332. if(today.Left(4)<=birthday.Left (4))continue;
  1333. birthday=today.Left(4)+birthday.Right(6);
  1334. CTime tm=GetTmFromStr(birthday);
  1335. CTimeSpan dt=tm-todaytm;
  1336. ndays=dt.GetDays();
  1337. days.Format("%d天后结婚纪念日", ndays);
  1338. if(ndays==0)
  1339. days="今天结婚纪念日";
  1340. }
  1341. else
  1342. {
  1343. birthday=today.Left(4)+birthday.Right(6);
  1344. CTime tm=GetTmFromStr(birthday);
  1345. CTimeSpan dt=tm-todaytm;
  1346. ndays=dt.GetDays();
  1347. days.Format("%d天后生日", ndays);
  1348. if(ndays==0)
  1349. days="今天生日";
  1350. }
  1351. }
  1352. else if(birthday.GetLength()==10)
  1353. {
  1354. if(m_radio2==1)
  1355. {
  1356. CovertDate3(birthday);
  1357. CTime tm=GetTmFromStr(birthday);
  1358. CTimeSpan dt=tm-todaytm;
  1359. ndays=dt.GetDays();
  1360. days.Format("%d天后结婚", ndays);
  1361. if(ndays==0)
  1362. days="今天结婚";
  1363. }
  1364. else if(m_radio2==2)
  1365. {
  1366. if(todaynl.Left(4)<=birthday.Left (4))continue;
  1367. birthday=todaynl.Left(4)+birthday.Right(6);
  1368. CovertDate3(birthday);
  1369. CTime tm=GetTmFromStr(birthday);
  1370. CTimeSpan dt=tm-todaytm;
  1371. ndays=dt.GetDays();
  1372. days.Format("%d天后结婚纪念日", ndays);
  1373. if(ndays==0)
  1374. days="今天结婚纪念日";
  1375. }
  1376. else
  1377. {
  1378. birthday=todaynl.Left(4)+birthday.Right(6);
  1379. CovertDate3(birthday);
  1380. CTime tm=GetTmFromStr(birthday);
  1381. CTimeSpan dt=tm-todaytm;
  1382. ndays=dt.GetDays();
  1383. days.Format("%d天后生日", ndays);
  1384. if(ndays==0)
  1385. days="今天生日";
  1386. }
  1387. }
  1388. if(ndays<checkdays && ndays>=0 && name!="")
  1389. {
  1390. m_List6array.SetSize( size+1, 1 );
  1391. m_List6array.ElementAt (size).Add(name);
  1392. m_List6array.ElementAt (size).Add(sex);
  1393. m_List6array.ElementAt (size).Add(birthdaybak);
  1394. if(checknl)
  1395. m_List6array.ElementAt (size).Add("农历");
  1396. else
  1397. m_List6array.ElementAt (size).Add("公历");
  1398. m_List6array.ElementAt (size).Add(clienttype);
  1399. m_List6array.ElementAt (size).Add(phone);
  1400. m_List6array.ElementAt (size).Add(days);
  1401. size++;
  1402. }
  1403. sex="女";
  1404. name=List1array.ElementAt (i).ElementAt (1);
  1405. phone=List1array.ElementAt (i).ElementAt (3);
  1406. birthday=List1array.ElementAt (i).ElementAt (6);
  1407. birthdaybak=birthday;
  1408. checknl=atoi(List1array.ElementAt (i).ElementAt (11));
  1409. if(m_radio2==1 || m_radio2==2)
  1410. {
  1411. birthday=List1array.ElementAt (i).ElementAt (4);
  1412. birthdaybak=birthday;
  1413. checknl=atoi(List1array.ElementAt (i).ElementAt (12));
  1414. }
  1415. ndays=-1;
  1416. if(checknl==0 && birthday.GetLength()==10)
  1417. {
  1418. if(m_radio2==1)
  1419. {
  1420. CTime tm=GetTmFromStr(birthday);
  1421. CTimeSpan dt=tm-todaytm;
  1422. ndays=dt.GetDays();
  1423. days.Format("%d天后结婚", ndays);
  1424. if(ndays==0)
  1425. days="今天结婚";
  1426. }
  1427. else if(m_radio2==2)
  1428. {
  1429. if(today.Left(4)<=birthday.Left (4))continue;
  1430. birthday=today.Left(4)+birthday.Right(6);
  1431. CTime tm=GetTmFromStr(birthday);
  1432. CTimeSpan dt=tm-todaytm;
  1433. ndays=dt.GetDays();
  1434. days.Format("%d天后结婚纪念日", ndays);
  1435. if(ndays==0)
  1436. days="今天结婚纪念日";
  1437. }
  1438. else
  1439. {
  1440. birthday=today.Left(4)+birthday.Right(6);
  1441. CTime tm=GetTmFromStr(birthday);
  1442. CTimeSpan dt=tm-todaytm;
  1443. ndays=dt.GetDays();
  1444. days.Format("%d天后生日", ndays);
  1445. if(ndays==0)
  1446. days="今天生日";
  1447. }
  1448. }
  1449. else if(birthday.GetLength()==10)
  1450. {
  1451. if(m_radio2==1)
  1452. {
  1453. CovertDate3(birthday);
  1454. CTime tm=GetTmFromStr(birthday);
  1455. CTimeSpan dt=tm-todaytm;
  1456. ndays=dt.GetDays();
  1457. days.Format("%d天后结婚", ndays);
  1458. if(ndays==0)
  1459. days="今天结婚";
  1460. }
  1461. else if(m_radio2==2)
  1462. {
  1463. if(todaynl.Left(4)<=birthday.Left (4))continue;
  1464. birthday=todaynl.Left(4)+birthday.Right(6);
  1465. CovertDate3(birthday);
  1466. CTime tm=GetTmFromStr(birthday);
  1467. CTimeSpan dt=tm-todaytm;
  1468. ndays=dt.GetDays();
  1469. days.Format("%d天后结婚纪念日", ndays);
  1470. if(ndays==0)
  1471. days="今天结婚纪念日";
  1472. }
  1473. else
  1474. {
  1475. birthday=todaynl.Left(4)+birthday.Right(6);
  1476. CovertDate3(birthday);
  1477. CTime tm=GetTmFromStr(birthday);
  1478. CTimeSpan dt=tm-todaytm;
  1479. ndays=dt.GetDays();
  1480. days.Format("%d天后生日", ndays);
  1481. if(ndays==0)
  1482. days="今天生日";
  1483. }
  1484. }
  1485. if(ndays<checkdays && ndays>=0 && name!="")
  1486. {
  1487. m_List6array.SetSize( size+1, 1 );
  1488. m_List6array.ElementAt (size).Add(name);
  1489. m_List6array.ElementAt (size).Add(sex);
  1490. m_List6array.ElementAt (size).Add(birthdaybak);
  1491. if(checknl)
  1492. m_List6array.ElementAt (size).Add("农历");
  1493. else
  1494. m_List6array.ElementAt (size).Add("公历");
  1495. m_List6array.ElementAt (size).Add(clienttype);
  1496. m_List6array.ElementAt (size).Add(phone);
  1497. m_List6array.ElementAt (size).Add(days);
  1498. size++;
  1499. }
  1500. }
  1501. }
  1502. catch(...)
  1503. {
  1504. MessageBox(name+birthday);
  1505. }
  1506. clienttype="老客户";
  1507. for( i=0; i<List2array.GetSize(); i++)
  1508. {
  1509. sex="男";
  1510. name=List2array.ElementAt (i).ElementAt (1);
  1511. phone=List2array.ElementAt (i).ElementAt (3);
  1512. birthday=List2array.ElementAt (i).ElementAt (7);
  1513. birthdaybak=birthday;
  1514. checknl=atoi(List2array.ElementAt (i).ElementAt (17));
  1515. if(m_radio2==1 || m_radio2==2)
  1516. {
  1517. birthday=List2array.ElementAt (i).ElementAt (9);
  1518. birthdaybak=birthday;
  1519. checknl=atoi(List2array.ElementAt (i).ElementAt (19));
  1520. }
  1521. ndays=-1;
  1522. if(checknl==0 && birthday.GetLength()==10)
  1523. {
  1524. if(m_radio2==1)
  1525. {
  1526. CTime tm=GetTmFromStr(birthday);
  1527. CTimeSpan dt=tm-todaytm;
  1528. ndays=dt.GetDays();
  1529. days.Format("%d天后结婚", ndays);
  1530. if(ndays==0)
  1531. days="今天结婚";
  1532. }
  1533. else if(m_radio2==2)
  1534. {
  1535. if(today.Left(4)<=birthday.Left (4))continue;
  1536. birthday=today.Left(4)+birthday.Right(6);
  1537. CTime tm=GetTmFromStr(birthday);
  1538. CTimeSpan dt=tm-todaytm;
  1539. ndays=dt.GetDays();
  1540. days.Format("%d天后结婚纪念日", ndays);
  1541. if(ndays==0)
  1542. days="今天结婚纪念日";
  1543. }
  1544. else
  1545. {
  1546. birthday=today.Left(4)+birthday.Right(6);
  1547. CTime tm=GetTmFromStr(birthday);
  1548. CTimeSpan dt=tm-todaytm;
  1549. ndays=dt.GetDays();
  1550. days.Format("%d天后生日", ndays);
  1551. if(ndays==0)
  1552. days="今天生日";
  1553. }
  1554. }
  1555. else if(birthday.GetLength()==10)
  1556. {
  1557. if(m_radio2==1)
  1558. {
  1559. CovertDate3(birthday);
  1560. CTime tm=GetTmFromStr(birthday);
  1561. CTimeSpan dt=tm-todaytm;
  1562. ndays=dt.GetDays();
  1563. days.Format("%d天后结婚", ndays);
  1564. if(ndays==0)
  1565. days="今天结婚";
  1566. }
  1567. else if(m_radio2==2)
  1568. {
  1569. if(todaynl.Left(4)<=birthday.Left (4))continue;
  1570. birthday=todaynl.Left(4)+birthday.Right(6);
  1571. CovertDate3(birthday);
  1572. CTime tm=GetTmFromStr(birthday);
  1573. CTimeSpan dt=tm-todaytm;
  1574. ndays=dt.GetDays();
  1575. days.Format("%d天后结婚纪念日", ndays);
  1576. if(ndays==0)
  1577. days="今天结婚纪念日";
  1578. }
  1579. else
  1580. {
  1581. birthday=todaynl.Left(4)+birthday.Right(6);
  1582. CovertDate3(birthday);
  1583. CTime tm=GetTmFromStr(birthday);
  1584. CTimeSpan dt=tm-todaytm;
  1585. ndays=dt.GetDays();
  1586. days.Format("%d天后生日", ndays);
  1587. if(ndays==0)
  1588. days="今天生日";
  1589. }
  1590. }
  1591. if(ndays<checkdays && ndays>=0 && name!="")
  1592. {
  1593. m_List6array.SetSize( size+1, 1 );
  1594. m_List6array.ElementAt (size).Add(name);
  1595. m_List6array.ElementAt (size).Add(sex);
  1596. m_List6array.ElementAt (size).Add(birthdaybak);
  1597. if(checknl)
  1598. m_List6array.ElementAt (size).Add("农历");
  1599. else
  1600. m_List6array.ElementAt (size).Add("公历");
  1601. m_List6array.ElementAt (size).Add(clienttype);
  1602. m_List6array.ElementAt (size).Add(phone);
  1603. m_List6array.ElementAt (size).Add(days);
  1604. size++;
  1605. }
  1606. sex="女";
  1607. name=List2array.ElementAt (i).ElementAt (2);
  1608. phone=List2array.ElementAt (i).ElementAt (4);
  1609. birthday=List2array.ElementAt (i).ElementAt (8);
  1610. birthdaybak=birthday;
  1611. checknl=atoi(List2array.ElementAt (i).ElementAt (18));
  1612. if(m_radio2==1 || m_radio2==2)
  1613. {
  1614. birthday=List2array.ElementAt (i).ElementAt (9);
  1615. birthdaybak=birthday;
  1616. checknl=atoi(List2array.ElementAt (i).ElementAt (19));
  1617. }
  1618. ndays=-1;
  1619. if(checknl==0 && birthday.GetLength()==10)
  1620. {
  1621. if(m_radio2==1)
  1622. {
  1623. CTime tm=GetTmFromStr(birthday);
  1624. CTimeSpan dt=tm-todaytm;
  1625. ndays=dt.GetDays();
  1626. days.Format("%d天后结婚", ndays);
  1627. if(ndays==0)
  1628. days="今天结婚";
  1629. }
  1630. else if(m_radio2==2)
  1631. {
  1632. if(today.Left(4)<=birthday.Left (4))continue;
  1633. birthday=today.Left(4)+birthday.Right(6);
  1634. CTime tm=GetTmFromStr(birthday);
  1635. CTimeSpan dt=tm-todaytm;
  1636. ndays=dt.GetDays();
  1637. days.Format("%d天后结婚纪念日", ndays);
  1638. if(ndays==0)
  1639. days="今天结婚纪念日";
  1640. }
  1641. else
  1642. {
  1643. birthday=today.Left(4)+birthday.Right(6);
  1644. CTime tm=GetTmFromStr(birthday);
  1645. CTimeSpan dt=tm-todaytm;
  1646. ndays=dt.GetDays();
  1647. days.Format("%d天后生日", ndays);
  1648. if(ndays==0)
  1649. days="今天生日";
  1650. }
  1651. }
  1652. else if(birthday.GetLength()==10)
  1653. {
  1654. if(m_radio2==1)
  1655. {
  1656. CovertDate3(birthday);
  1657. CTime tm=GetTmFromStr(birthday);
  1658. CTimeSpan dt=tm-todaytm;
  1659. ndays=dt.GetDays();
  1660. days.Format("%d天后结婚", ndays);
  1661. if(ndays==0)
  1662. days="今天结婚";
  1663. }
  1664. else if(m_radio2==2)
  1665. {
  1666. if(todaynl.Left(4)<=birthday.Left (4))continue;
  1667. birthday=todaynl.Left(4)+birthday.Right(6);
  1668. CovertDate3(birthday);
  1669. CTime tm=GetTmFromStr(birthday);
  1670. CTimeSpan dt=tm-todaytm;
  1671. ndays=dt.GetDays();
  1672. days.Format("%d天后结婚纪念日", ndays);
  1673. if(ndays==0)
  1674. days="今天结婚纪念日";
  1675. }
  1676. else
  1677. {
  1678. birthday=todaynl.Left(4)+birthday.Right(6);
  1679. CovertDate3(birthday);
  1680. CTime tm=GetTmFromStr(birthday);
  1681. CTimeSpan dt=tm-todaytm;
  1682. ndays=dt.GetDays();
  1683. days.Format("%d天后生日", ndays);
  1684. if(ndays==0)
  1685. days="今天生日";
  1686. }
  1687. }
  1688. if(ndays<checkdays && ndays>=0 && name!="")
  1689. {
  1690. m_List6array.SetSize( size+1, 1 );
  1691. m_List6array.ElementAt (size).Add(name);
  1692. m_List6array.ElementAt (size).Add(sex);
  1693. m_List6array.ElementAt (size).Add(birthdaybak);
  1694. if(checknl)
  1695. m_List6array.ElementAt (size).Add("农历");
  1696. else
  1697. m_List6array.ElementAt (size).Add("公历");
  1698. m_List6array.ElementAt (size).Add(clienttype);
  1699. m_List6array.ElementAt (size).Add(phone);
  1700. m_List6array.ElementAt (size).Add(days);
  1701. size++;
  1702. }
  1703. }
  1704. clienttype="意向客户";
  1705. for( i=0; i<List3array.GetSize(); i++)//
  1706. {
  1707. sex=List3array.ElementAt (i).ElementAt (2);
  1708. birthday=List3array.ElementAt (i).ElementAt (9);
  1709. birthdaybak=birthday;
  1710. checknl=atoi(List3array.ElementAt (i).ElementAt (13));
  1711. name=List3array.ElementAt (i).ElementAt (1);
  1712. phone=List3array.ElementAt (i).ElementAt (3);
  1713. if(m_radio2==1 || m_radio2==2)
  1714. {
  1715. break;
  1716. }
  1717. ndays=-1;
  1718. if(checknl==0 && birthday.GetLength()==10)
  1719. {
  1720. birthday=today.Left(4)+birthday.Right(6);
  1721. CTime tm=GetTmFromStr(birthday);
  1722. CTimeSpan dt=tm-todaytm;
  1723. ndays=dt.GetDays();
  1724. days.Format("%d天后生日", ndays);
  1725. if(ndays==0)
  1726. days="今天生日";
  1727. }
  1728. else if(birthday.GetLength()==10)
  1729. {
  1730. birthday=todaynl.Left(4)+birthday.Right(6);
  1731. CovertDate3(birthday);
  1732. CTime tm=GetTmFromStr(birthday);
  1733. CTimeSpan dt=tm-todaytm;
  1734. ndays=dt.GetDays();
  1735. days.Format("%d天后生日", ndays);
  1736. if(ndays==0)
  1737. days="今天生日";
  1738. }
  1739. if(ndays<checkdays && ndays>=0)
  1740. {
  1741. m_List6array.SetSize( size+1, 1 );
  1742. m_List6array.ElementAt (size).Add(name);
  1743. m_List6array.ElementAt (size).Add(sex);
  1744. m_List6array.ElementAt (size).Add(birthdaybak);
  1745. if(checknl)
  1746. m_List6array.ElementAt (size).Add("农历");
  1747. else
  1748. m_List6array.ElementAt (size).Add("公历");
  1749. m_List6array.ElementAt (size).Add(clienttype);
  1750. m_List6array.ElementAt (size).Add(phone);
  1751. m_List6array.ElementAt (size).Add(days);
  1752. size++;
  1753. }
  1754. }
  1755. #endif
  1756. /* g_sendhead.bsql=0;
  1757. g_sendhead.code[0]=135;
  1758. g_sendhead.code[1]=136;
  1759. g_sendhead.tabcount=2;
  1760. CString sql;
  1761. sql.Format ("time5>='"+strdate+"' and time5<='"+strdate2+"' and [status3]='未取'");
  1762. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  1763. DataToArray(&m_List6array,&g_List1array);
  1764. for(int i=0; i<g_List1array.GetSize (); i++)
  1765. {
  1766. for(int j=0; j<m_List6array.GetSize (); j++)
  1767. {
  1768. if(g_List1array.ElementAt (i).ElementAt (0)==m_List6array.ElementAt (j).ElementAt (0))
  1769. {
  1770. if(g_List1array.ElementAt (i).ElementAt (1)!="" && g_List1array.ElementAt (i).ElementAt (3)!="" && g_List1array.ElementAt (i).ElementAt (5)!="")
  1771. {
  1772. m_List6array.ElementAt (j).SetAt (4, "已安排");
  1773. }
  1774. else
  1775. {
  1776. m_List6array.ElementAt (j).SetAt (4, m_List6array.ElementAt (j).ElementAt (4)+g_List1array.ElementAt (i).ElementAt (1));
  1777. m_List6array.ElementAt (j).SetAt (6, m_List6array.ElementAt (j).ElementAt (6)+g_List1array.ElementAt (i).ElementAt (3));
  1778. m_List6array.ElementAt (j).SetAt (7, m_List6array.ElementAt (j).ElementAt (7)+g_List1array.ElementAt (i).ElementAt (5));
  1779. }
  1780. }
  1781. }
  1782. }
  1783. for( i=m_List6array.GetSize ()-1; i>=0; i--)
  1784. {
  1785. if(m_List6array.ElementAt (i).ElementAt (4)=="已安排")
  1786. m_List6array.RemoveAt(i);
  1787. }
  1788. qsort( static_cast<void*>(&m_List6array[0]), m_List6array.GetSize (), sizeof(m_List6array[0]), CompareByLabel3 );
  1789. */
  1790. }
  1791. HidePrice();
  1792. FillGrid();
  1793. m_spinyear.EnableWindow(1);
  1794. m_spinmonth.EnableWindow(1);
  1795. m_spinday.EnableWindow(1);
  1796. }
  1797. void TodayForm::OnCheck1()
  1798. {
  1799. // TODO: Add your control notification handler code here
  1800. UpdateData();
  1801. m_check2=0; UpdateData(false);
  1802. DateChange();
  1803. }
  1804. void TodayForm::OnCheck2()
  1805. {
  1806. // TODO: Add your control notification handler code here
  1807. UpdateData();
  1808. m_check=0; UpdateData(false);
  1809. DateChange();
  1810. }
  1811. void TodayForm::OnChangeEDITyear()
  1812. {
  1813. // TODO: If this is a RICHEDIT control, the control will not
  1814. // send this notification unless you override the MyFormView::OnInitDialog()
  1815. // function and call CRichEditCtrl().SetEventMask()
  1816. // with the ENM_CHANGE flag ORed into the mask.
  1817. DateChange(); GetCalendarData();
  1818. // TODO: Add your control notification handler code here
  1819. }
  1820. void TodayForm::OnChangeEDITmonth()
  1821. {
  1822. // TODO: If this is a RICHEDIT control, the control will not
  1823. // send this notification unless you override the MyFormView::OnInitDialog()
  1824. // function and call CRichEditCtrl().SetEventMask()
  1825. // with the ENM_CHANGE flag ORed into the mask.
  1826. DateChange(); GetCalendarData();
  1827. // TODO: Add your control notification handler code here
  1828. }
  1829. void TodayForm::OnChangeEDITday()
  1830. {
  1831. // TODO: If this is a RICHEDIT control, the control will not
  1832. // send this notification unless you override the MyFormView::OnInitDialog()
  1833. // function and call CRichEditCtrl().SetEventMask()
  1834. // with the ENM_CHANGE flag ORed into the mask.
  1835. DateChange();
  1836. if(m_bInit==0)return;
  1837. if(m_bShowCalendar==0)return;
  1838. UpdateData();
  1839. m_CalendarFrm.DateChange2(m_year, m_month, m_day);
  1840. m_CalendarFrm.m_oCalendar.Invalidate ();
  1841. // TODO: Add your control notification handler code her
  1842. }
  1843. void TodayForm::OnRadio3() //拍照客人;
  1844. {
  1845. // TODO: Add your control notification handler code here
  1846. OnRadio8();
  1847. }
  1848. void TodayForm::OnRadio4()
  1849. {
  1850. // TODO: Add your control notification handler code here
  1851. OnRadio8();
  1852. }
  1853. void TodayForm::OnRadio5()
  1854. {
  1855. // TODO: Add your control notification handler code here
  1856. OnRadio8();
  1857. }
  1858. void TodayForm::OnRadio6()
  1859. {
  1860. // TODO: Add your control notification handler code here
  1861. OnRadio8();
  1862. }
  1863. void TodayForm::OnRadio7()
  1864. {
  1865. // TODO: Add your control notification handler code here
  1866. OnRadio8();
  1867. }
  1868. void TodayForm::OnRadio8()
  1869. {
  1870. // TODO: Add your control notification handler code here
  1871. UpdateData();
  1872. if(m_radio==6)
  1873. {
  1874. m_List1.ShowWindow (SW_HIDE);
  1875. m_List2.ShowWindow (SW_HIDE);
  1876. m_List3.ShowWindow (SW_HIDE);
  1877. m_List4.ShowWindow (SW_HIDE);
  1878. m_List5.ShowWindow (SW_HIDE);
  1879. m_List6.ShowWindow (SW_HIDE);
  1880. m_CalendarFrm.ShowWindow (SW_HIDE);
  1881. m_table.ShowWindow(SW_SHOW);
  1882. m_childdlg.ShowWindow(SW_SHOW);
  1883. m_scrollbar.ShowWindow(SW_SHOW);
  1884. DateChange();
  1885. return;
  1886. }
  1887. m_table.ShowWindow(SW_HIDE);
  1888. m_childdlg.ShowWindow(SW_HIDE);
  1889. m_scrollbar.ShowWindow(SW_HIDE);
  1890. if(m_bShowCalendar)
  1891. {
  1892. m_List1.ShowWindow (SW_HIDE);
  1893. m_List2.ShowWindow (SW_HIDE);
  1894. m_List3.ShowWindow (SW_HIDE);
  1895. m_List4.ShowWindow (SW_HIDE);
  1896. m_List5.ShowWindow (SW_HIDE);
  1897. m_List6.ShowWindow (SW_HIDE);
  1898. m_CalendarFrm.ShowWindow (SW_SHOW);
  1899. if(m_radio==5)
  1900. {
  1901. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0);
  1902. GetDlgItem(IDC_BUTall)->ShowWindow(0);
  1903. GetDlgItem(IDC_BUTtake3)->ShowWindow(0);
  1904. GetDlgItem(IDC_BUTtake)->ShowWindow(0);
  1905. GetDlgItem(IDC_BUTchoose)->ShowWindow(0);
  1906. GetDlgItem(IDC_RADIO9)->ShowWindow(1);
  1907. GetDlgItem(IDC_RADIO14)->ShowWindow(1);
  1908. GetDlgItem(IDC_RADIO15)->ShowWindow(1);
  1909. }
  1910. else if(m_radio==6 )
  1911. {
  1912. m_childdlg.m_table.ModeChange(10);
  1913. m_table.ModeChange(10);
  1914. m_table.Test2 ();
  1915. m_table.ShowWindow(SW_SHOW);
  1916. m_childdlg.ShowWindow(SW_SHOW);
  1917. m_scrollbar.ShowWindow(SW_SHOW);
  1918. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0);
  1919. GetDlgItem(IDC_BUTall)->ShowWindow(0);
  1920. GetDlgItem(IDC_BUTtake3)->ShowWindow(0);
  1921. GetDlgItem(IDC_BUTtake)->ShowWindow(1);
  1922. GetDlgItem(IDC_BUTchoose)->ShowWindow(1);
  1923. GetDlgItem(IDC_BUTtake)->SetWindowText("另约日期");
  1924. GetDlgItem(IDC_BUTchoose)->SetWindowText("取消预约");
  1925. GetDlgItem(IDC_RADIO9)->ShowWindow(0);
  1926. GetDlgItem(IDC_RADIO14)->ShowWindow(0);
  1927. GetDlgItem(IDC_RADIO15)->ShowWindow(0);
  1928. }
  1929. else
  1930. {
  1931. GetDlgItem(IDC_BUTtakeaway)->ShowWindow(1);
  1932. if(!g_bAllBranch)GetDlgItem(IDC_BUTall)->ShowWindow(1);
  1933. GetDlgItem(IDC_BUTtake3)->ShowWindow(1);
  1934. GetDlgItem(IDC_BUTtake)->ShowWindow(1);
  1935. GetDlgItem(IDC_BUTchoose)->ShowWindow(1);
  1936. GetDlgItem(IDC_BUTtake)->SetWindowText("客人预约");
  1937. GetDlgItem(IDC_BUTchoose)->SetWindowText("重新安排");
  1938. GetDlgItem(IDC_RADIO9)->ShowWindow(0);
  1939. GetDlgItem(IDC_RADIO14)->ShowWindow(0);
  1940. GetDlgItem(IDC_RADIO15)->ShowWindow(0);
  1941. }
  1942. }
  1943. else
  1944. {
  1945. m_CalendarFrm.ShowWindow (SW_HIDE);
  1946. }
  1947. // if(m_bShowCalendar)
  1948. // OnBUTall();
  1949. // else
  1950. DateChange();
  1951. }
  1952. void TodayForm::OnBUTtake() // 客人预约按钮;
  1953. {
  1954. // TODO: Add your control notification handler code here
  1955. if(IsHasRights2new(2)==0)return;
  1956. UpdateData();
  1957. if(m_radio==6)
  1958. {
  1959. m_childdlg.OtherDate();
  1960. return;
  1961. }
  1962. if(m_radio==0) // 拍照客人预约;
  1963. {
  1964. TakeControlDlg1 dlg;
  1965. dlg.DoModal ();
  1966. if(g_bAllBranch)
  1967. {
  1968. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  1969. }
  1970. DateChange();GetCalendarData();
  1971. }
  1972. else if(m_radio==1) // 选片客人预约;
  1973. {
  1974. TakeControlDlg2 dlg;
  1975. dlg.DoModal ();
  1976. if(g_bAllBranch)
  1977. {
  1978. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  1979. }
  1980. DateChange();GetCalendarData();
  1981. }
  1982. else if(m_radio==2) // 看设计客人预约;
  1983. {
  1984. TakeControlDlg3 dlg;
  1985. dlg.DoModal ();
  1986. if(g_bAllBranch)
  1987. {
  1988. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  1989. }
  1990. DateChange();GetCalendarData();
  1991. }
  1992. else if(m_radio==3) // 取件客人预约;
  1993. {
  1994. TakeControlDlg4 dlg;
  1995. dlg.DoModal ();
  1996. if(g_bAllBranch)
  1997. {
  1998. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  1999. }
  2000. DateChange();GetCalendarData();
  2001. }
  2002. else if(m_radio==4)
  2003. {
  2004. TakeControlDlg9 dlg;
  2005. dlg.DoModal ();
  2006. if(g_bAllBranch)
  2007. {
  2008. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  2009. }
  2010. DateChange();GetCalendarData();
  2011. }
  2012. }
  2013. void TodayForm::OnBUTchoose() //重新安排
  2014. {
  2015. // TODO: Add your control notification handler code here
  2016. if(IsHasRights2new(2)==0)return;
  2017. UpdateData();
  2018. if(m_radio==6)
  2019. {
  2020. m_childdlg.DeleteCur();
  2021. return;
  2022. }
  2023. if(m_radio==0)
  2024. {
  2025. POSITION pos;
  2026. pos=m_List1.GetFirstSelectedItemPosition();
  2027. if(pos==NULL)
  2028. {
  2029. AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
  2030. return;
  2031. }
  2032. int iItem=m_List1.GetNextSelectedItem(pos);
  2033. CString id=m_List1.GetItemText (iItem, 0+m_nAdd);
  2034. TakeControlDlg1 dlg;
  2035. if(g_bAllBranch)
  2036. dlg.m_branch=m_List1.GetItemText (iItem, 0);
  2037. dlg.id=id;
  2038. dlg.m_bModify=1;
  2039. dlg.DoModal ();
  2040. if(g_bAllBranch)
  2041. {
  2042. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  2043. }
  2044. DateChange();GetCalendarData();
  2045. }
  2046. else if(m_radio==1)
  2047. {
  2048. POSITION pos;
  2049. pos=m_List2.GetFirstSelectedItemPosition();
  2050. if(pos==NULL)
  2051. {
  2052. AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
  2053. return;
  2054. }
  2055. int iItem=m_List2.GetNextSelectedItem(pos);
  2056. CString id=m_List2.GetItemText (iItem, 0+m_nAdd);
  2057. TakeControlDlg2 dlg;
  2058. if(g_bAllBranch)
  2059. dlg.m_branch=m_List2.GetItemText (iItem, 0);
  2060. dlg.id=id;
  2061. dlg.m_bModify=1;
  2062. dlg.DoModal ();
  2063. if(g_bAllBranch)
  2064. {
  2065. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  2066. }
  2067. DateChange();GetCalendarData();
  2068. }
  2069. else if(m_radio==2)
  2070. {
  2071. POSITION pos;
  2072. pos=m_List3.GetFirstSelectedItemPosition();
  2073. if(pos==NULL)
  2074. {
  2075. AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
  2076. return;
  2077. }
  2078. int iItem=m_List3.GetNextSelectedItem(pos);
  2079. CString id=m_List3.GetItemText (iItem, 0+m_nAdd);
  2080. TakeControlDlg3 dlg;
  2081. if(g_bAllBranch)
  2082. dlg.m_branch=m_List3.GetItemText (iItem, 0);
  2083. dlg.id=id;
  2084. dlg.m_bModify=1;
  2085. dlg.DoModal ();
  2086. if(g_bAllBranch)
  2087. {
  2088. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  2089. }
  2090. DateChange();GetCalendarData();
  2091. }
  2092. else if(m_radio==3)
  2093. {
  2094. POSITION pos;
  2095. pos=m_List4.GetFirstSelectedItemPosition();
  2096. if(pos==NULL)
  2097. {
  2098. AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
  2099. return;
  2100. }
  2101. int iItem=m_List4.GetNextSelectedItem(pos);
  2102. CString id=m_List4.GetItemText (iItem, 0+m_nAdd);
  2103. TakeControlDlg4 dlg;
  2104. if(g_bAllBranch)
  2105. dlg.m_branch=m_List4.GetItemText (iItem, 0);
  2106. dlg.id=id;
  2107. dlg.m_bModify=1;
  2108. dlg.DoModal ();
  2109. if(g_bAllBranch)
  2110. {
  2111. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  2112. }
  2113. DateChange();GetCalendarData();
  2114. }
  2115. else if(m_radio==4)
  2116. {
  2117. POSITION pos;
  2118. pos=m_List5.GetFirstSelectedItemPosition();
  2119. if(pos==NULL)
  2120. {
  2121. AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
  2122. return;
  2123. }
  2124. int iItem=m_List5.GetNextSelectedItem(pos);
  2125. CString id=m_List5.GetItemText (iItem, 0+m_nAdd);
  2126. while(id=="")
  2127. {
  2128. iItem--;
  2129. id=m_List5.GetItemText (iItem, 0+m_nAdd);
  2130. }
  2131. TakeControlDlg9 dlg;
  2132. if(g_bAllBranch)
  2133. dlg.m_branch=m_List5.GetItemText (iItem, 0);
  2134. dlg.id=id;
  2135. dlg.m_bModify=1;
  2136. dlg.DoModal ();
  2137. if(g_bAllBranch)
  2138. {
  2139. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  2140. }
  2141. DateChange();GetCalendarData();
  2142. }
  2143. }
  2144. void TodayForm::OnCustomdrawList4 ( NMHDR* pNMHDR, LRESULT* pResult )
  2145. {
  2146. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  2147. // Take the default processing unless we set this to something else below.
  2148. *pResult = 0;
  2149. // First thing - check the draw stage. If it's the control's prepaint
  2150. // stage, then tell Windows we want messages for every item.
  2151. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  2152. {
  2153. *pResult = CDRF_NOTIFYITEMDRAW;
  2154. }
  2155. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  2156. {
  2157. // This is the prepaint stage for an item. Here's where we set the
  2158. // item's text color. Our return value will tell Windows to draw the
  2159. // item itself, but it will use the new color we set here.
  2160. // We'll cycle the colors through red, green, and light blue.
  2161. #ifdef CHILD_VERSION
  2162. if(m_List4.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (8+m_nAdd)!="OK")
  2163. #else
  2164. if(m_List4.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (9+m_nAdd)!="OK")
  2165. #endif
  2166. pLVCD->clrText = RGB(220,0,0);
  2167. else
  2168. pLVCD->clrText = RGB(20,133,20);
  2169. if(pLVCD->nmcd.dwItemSpec%2)
  2170. pLVCD->clrTextBk = g_gridcol1;
  2171. else
  2172. pLVCD->clrTextBk = g_gridcol2;
  2173. // Store the color back in the NMLVCUSTOMDRAW struct.
  2174. // Tell Windows to paint the control itself.
  2175. *pResult = CDRF_DODEFAULT;
  2176. }
  2177. }
  2178. void TodayForm::OnCustomdrawList3 ( NMHDR* pNMHDR, LRESULT* pResult )
  2179. {
  2180. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  2181. // Take the default processing unless we set this to something else below.
  2182. *pResult = 0;
  2183. // First thing - check the draw stage. If it's the control's prepaint
  2184. // stage, then tell Windows we want messages for every item.
  2185. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  2186. {
  2187. *pResult = CDRF_NOTIFYITEMDRAW;
  2188. }
  2189. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  2190. {
  2191. // This is the prepaint stage for an item. Here's where we set the
  2192. // item's text color. Our return value will tell Windows to draw the
  2193. // item itself, but it will use the new color we set here.
  2194. // We'll cycle the colors through red, green, and light blue.
  2195. #ifdef CHILD_VERSION
  2196. 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")
  2197. #else
  2198. 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")
  2199. #endif
  2200. {
  2201. pLVCD->clrText = RGB(220,0,0);
  2202. }
  2203. else
  2204. {
  2205. pLVCD->clrText = RGB(20,133,20);
  2206. }
  2207. if(pLVCD->nmcd.dwItemSpec%2)
  2208. pLVCD->clrTextBk = g_gridcol1;
  2209. else
  2210. pLVCD->clrTextBk = g_gridcol2;
  2211. // Store the color back in the NMLVCUSTOMDRAW struct.
  2212. // Tell Windows to paint the control itself.
  2213. *pResult = CDRF_DODEFAULT;
  2214. }
  2215. }
  2216. void TodayForm::OnBUTmsg() //短信;
  2217. {
  2218. // TODO: Add your control notification handler code here
  2219. UpdateData();
  2220. POSITION pos;
  2221. CStringArray array; CString name;
  2222. if(m_radio==0)
  2223. {
  2224. pos=m_List1.GetFirstSelectedItemPosition();
  2225. if(pos==NULL)
  2226. {
  2227. AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
  2228. return;
  2229. }
  2230. int iItem;
  2231. while (pos)
  2232. {
  2233. iItem = m_List1.GetNextSelectedItem(pos);
  2234. #ifdef CHILD_VERSION
  2235. array.Add (m_List1.GetItemText (iItem, 5+m_nAdd));
  2236. array.Add (m_List1.GetItemText (iItem, 6+m_nAdd));
  2237. #else
  2238. array.Add (m_List1.GetItemText (iItem, 3+m_nAdd));
  2239. array.Add (m_List1.GetItemText (iItem, 4+m_nAdd));
  2240. #endif
  2241. }
  2242. }
  2243. else if(m_radio==1)
  2244. {
  2245. pos=m_List2.GetFirstSelectedItemPosition();
  2246. if(pos==NULL)
  2247. {
  2248. AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
  2249. return;
  2250. }
  2251. int iItem;
  2252. while (pos)
  2253. {
  2254. iItem = m_List2.GetNextSelectedItem(pos);
  2255. array.Add (m_List2.GetItemText (iItem, 3+m_nAdd));
  2256. array.Add (m_List2.GetItemText (iItem, 4+m_nAdd));
  2257. }
  2258. }
  2259. else if(m_radio==2)
  2260. {
  2261. pos=m_List3.GetFirstSelectedItemPosition();
  2262. if(pos==NULL)
  2263. {
  2264. AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
  2265. return;
  2266. }
  2267. int iItem;
  2268. while (pos)
  2269. {
  2270. iItem = m_List3.GetNextSelectedItem(pos);
  2271. array.Add (m_List3.GetItemText (iItem, 3+m_nAdd));
  2272. array.Add (m_List3.GetItemText (iItem, 4+m_nAdd));
  2273. }
  2274. }
  2275. else if(m_radio==3)
  2276. {
  2277. pos=m_List4.GetFirstSelectedItemPosition();
  2278. if(pos==NULL)
  2279. {
  2280. AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
  2281. return;
  2282. }
  2283. int iItem;
  2284. while (pos)
  2285. {
  2286. iItem = m_List4.GetNextSelectedItem(pos);
  2287. array.Add (m_List4.GetItemText (iItem, 3+m_nAdd));
  2288. array.Add (m_List4.GetItemText (iItem, 4+m_nAdd));
  2289. }
  2290. }
  2291. else if(m_radio==4)
  2292. {
  2293. pos=m_List5.GetFirstSelectedItemPosition();
  2294. if(pos==NULL)
  2295. {
  2296. AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
  2297. return;
  2298. }
  2299. int iItem;
  2300. while (pos)
  2301. {
  2302. iItem = m_List5.GetNextSelectedItem(pos);
  2303. array.Add (m_List5.GetItemText (iItem, 3+m_nAdd));
  2304. array.Add (m_List5.GetItemText (iItem, 4+m_nAdd));
  2305. }
  2306. }
  2307. else if(m_radio==5)
  2308. {
  2309. pos=m_List6.GetFirstSelectedItemPosition();
  2310. if(pos==NULL)
  2311. {
  2312. AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
  2313. return;
  2314. }
  2315. int iItem;
  2316. while (pos)
  2317. {
  2318. iItem = m_List6.GetNextSelectedItem(pos);
  2319. array.Add (m_List6.GetItemText (iItem, 5));
  2320. }
  2321. }
  2322. else if(m_radio==6)
  2323. {
  2324. array.Add(m_childdlg.GetCurPhone(name));
  2325. }
  2326. SendMsgDlg dlg;
  2327. if(m_radio==5)
  2328. dlg.m_mode=1;
  2329. dlg.m_pArray=&array;
  2330. if(name!="")
  2331. dlg.m_strSendSms=name+"您好,";
  2332. dlg.DoModal ();
  2333. }
  2334. void TodayForm::OnBUTtake3() //统计未拍;
  2335. {
  2336. // TODO: Add your control notification handler code here
  2337. if(IsHasRights2new(2)==0)return;
  2338. if(m_radio==0)
  2339. {
  2340. SearchTake dlg;
  2341. dlg.DoModal();
  2342. }
  2343. else if(m_radio==1)
  2344. {
  2345. SearchTake2 dlg;
  2346. dlg.DoModal();
  2347. }
  2348. else if(m_radio==2)
  2349. {
  2350. SearchTake3 dlg;
  2351. dlg.DoModal();
  2352. }
  2353. else if(m_radio==3)
  2354. {
  2355. SearchTake4 dlg;
  2356. dlg.DoModal();
  2357. }
  2358. else if(m_radio==4)
  2359. {
  2360. SearchTake5 dlg;
  2361. dlg.DoModal();
  2362. }
  2363. if(g_bAllBranch)
  2364. {
  2365. if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  2366. }
  2367. DateChange();
  2368. GetCalendarData();
  2369. }
  2370. void TodayForm::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  2371. {
  2372. // TODO: Add your control notification handler code here
  2373. POSITION pos;
  2374. pos=m_List1.GetFirstSelectedItemPosition();
  2375. if(pos==NULL)return;
  2376. int iItem=m_List1.GetNextSelectedItem(pos);
  2377. g_id = m_List1.GetItemText (iItem, 0+m_nAdd);
  2378. *pResult = 0;
  2379. }
  2380. void TodayForm::OnClickList3(NMHDR* pNMHDR, LRESULT* pResult)
  2381. {
  2382. // TODO: Add your control notification handler code here
  2383. POSITION pos;
  2384. pos=m_List2.GetFirstSelectedItemPosition();
  2385. if(pos==NULL)return;
  2386. int iItem=m_List2.GetNextSelectedItem(pos);
  2387. g_id = m_List2.GetItemText (iItem, 0+m_nAdd);
  2388. *pResult = 0;
  2389. }
  2390. void TodayForm::OnClickList4(NMHDR* pNMHDR, LRESULT* pResult)
  2391. {
  2392. // TODO: Add your control notification handler code here
  2393. POSITION pos;
  2394. pos=m_List3.GetFirstSelectedItemPosition();
  2395. if(pos==NULL)return;
  2396. int iItem=m_List3.GetNextSelectedItem(pos);
  2397. g_id = m_List3.GetItemText (iItem, 0+m_nAdd);
  2398. *pResult = 0;
  2399. }
  2400. void TodayForm::OnClickList7(NMHDR* pNMHDR, LRESULT* pResult)
  2401. {
  2402. // TODO: Add your control notification handler code here
  2403. POSITION pos;
  2404. pos=m_List4.GetFirstSelectedItemPosition();
  2405. if(pos==NULL)return;
  2406. int iItem=m_List4.GetNextSelectedItem(pos);
  2407. g_id = m_List4.GetItemText (iItem, 0+m_nAdd);
  2408. *pResult = 0;
  2409. }
  2410. void TodayForm::OnClickList8(NMHDR* pNMHDR, LRESULT* pResult)
  2411. {
  2412. // TODO: Add your control notification handler code here
  2413. POSITION pos;
  2414. pos=m_List5.GetFirstSelectedItemPosition();
  2415. if(pos==NULL)return;
  2416. int iItem=m_List5.GetNextSelectedItem(pos);
  2417. g_id = m_List5.GetItemText (iItem, 0+m_nAdd);
  2418. *pResult = 0;
  2419. }
  2420. void TodayForm::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
  2421. {
  2422. // TODO: Add your control notification handler code here
  2423. OnBUTchoose();
  2424. *pResult = 0;
  2425. }
  2426. void TodayForm::OnDblclkList3(NMHDR* pNMHDR, LRESULT* pResult)
  2427. {
  2428. // TODO: Add your control notification handler code here
  2429. OnBUTchoose();
  2430. *pResult = 0;
  2431. }
  2432. void TodayForm::OnDblclkList4(NMHDR* pNMHDR, LRESULT* pResult)
  2433. {
  2434. // TODO: Add your control notification handler code here
  2435. OnBUTchoose();
  2436. *pResult = 0;
  2437. }
  2438. void TodayForm::OnDblclkList7(NMHDR* pNMHDR, LRESULT* pResult)
  2439. {
  2440. // TODO: Add your control notification handler code here
  2441. // if(IsHasRights2new(3)==0)return;
  2442. OnBUTchoose();
  2443. // g_pMainWnd->OnOutbarNotify("发片/取件");
  2444. *pResult = 0;
  2445. }
  2446. void TodayForm::OnCustomdrawList1 ( NMHDR* pNMHDR, LRESULT* pResult )
  2447. {
  2448. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  2449. // Take the default processing unless we set this to something else below.
  2450. *pResult = 0;
  2451. // First thing - check the draw stage. If it's the control's prepaint
  2452. // stage, then tell Windows we want messages for every item.
  2453. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  2454. {
  2455. *pResult = CDRF_NOTIFYITEMDRAW;
  2456. }
  2457. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  2458. {
  2459. // This is the prepaint stage for an item. Here's where we set the
  2460. // item's text color. Our return value will tell Windows to draw the
  2461. // item itself, but it will use the new color we set here.
  2462. // We'll cycle the colors through red, green, and light blue.
  2463. pLVCD->clrText =RGB(0,0,0);
  2464. #ifdef ENTERPRISE_VERSION
  2465. COLORREF col[10]={\
  2466. RGB(190,76,195),\
  2467. RGB(76,176,76),\
  2468. RGB(136,113,200),\
  2469. RGB(76,186,198),\
  2470. RGB(209,127,213),\
  2471. RGB(127,209,127),\
  2472. RGB(170,154,215),\
  2473. RGB(127,206,215),\
  2474. RGB(0,127,0),\
  2475. RGB(0,0,127)};
  2476. int nAdd2=0;
  2477. #ifndef CHILD_VERSION
  2478. nAdd2=-1;
  2479. #endif
  2480. int pos=::FindArray (&m_datearray1, m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (9+m_nAdd+nAdd2) )%10;
  2481. if(pos<10)
  2482. pLVCD->clrTextBk = col[pos];
  2483. else if(pLVCD->nmcd.dwItemSpec%2)
  2484. pLVCD->clrTextBk = g_gridcol1;
  2485. else
  2486. pLVCD->clrTextBk = g_gridcol2;
  2487. #else
  2488. #ifdef CHILD_VERSION
  2489. int pos=::FindArray (&m_datearray1, m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (10+m_nAdd) )%10;
  2490. #else
  2491. int pos=::FindArray (&m_datearray1, m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (9+m_nAdd) )%10;
  2492. #endif
  2493. COLORREF col[10]={\
  2494. RGB(209,127,213),\
  2495. RGB(127,209,127),\
  2496. RGB(170,154,215),\
  2497. RGB(127,206,215),\
  2498. RGB(190,76,195),\
  2499. RGB(76,176,76),\
  2500. RGB(136,113,200),\
  2501. RGB(76,186,198),\
  2502. RGB(0,127,0),\
  2503. RGB(0,0,127)};
  2504. if(pos<10)
  2505. pLVCD->clrTextBk = col[pos];
  2506. else if(pLVCD->nmcd.dwItemSpec%2)
  2507. pLVCD->clrTextBk = g_gridcol1;
  2508. else
  2509. pLVCD->clrTextBk = g_gridcol2;
  2510. #endif
  2511. // Store the color back in the NMLVCUSTOMDRAW struct.
  2512. // Tell Windows to paint the control itself.
  2513. *pResult = CDRF_DODEFAULT;
  2514. }
  2515. }
  2516. void TodayForm::OnCustomdrawList2 ( NMHDR* pNMHDR, LRESULT* pResult )
  2517. {
  2518. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  2519. // Take the default processing unless we set this to something else below.
  2520. *pResult = 0;
  2521. // First thing - check the draw stage. If it's the control's prepaint
  2522. // stage, then tell Windows we want messages for every item.
  2523. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  2524. {
  2525. *pResult = CDRF_NOTIFYITEMDRAW;
  2526. }
  2527. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  2528. {
  2529. // This is the prepaint stage for an item. Here's where we set the
  2530. // item's text color. Our return value will tell Windows to draw the
  2531. // item itself, but it will use the new color we set here.
  2532. // We'll cycle the colors through red, green, and light blue.
  2533. if(::FindArray (&m_datearray2, m_List2.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (5+m_nAdd) )%2)
  2534. pLVCD->clrText = RGB(0,0,220);
  2535. else
  2536. pLVCD->clrText = RGB(0,0,50);
  2537. if(pLVCD->nmcd.dwItemSpec%2)
  2538. pLVCD->clrTextBk = g_gridcol1;
  2539. else
  2540. pLVCD->clrTextBk = g_gridcol2;
  2541. // Store the color back in the NMLVCUSTOMDRAW struct.
  2542. // Tell Windows to paint the control itself.
  2543. *pResult = CDRF_DODEFAULT;
  2544. }
  2545. }
  2546. void TodayForm::OnCustomdrawList5 ( NMHDR* pNMHDR, LRESULT* pResult )
  2547. {
  2548. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  2549. // Take the default processing unless we set this to something else below.
  2550. *pResult = 0;
  2551. // First thing - check the draw stage. If it's the control's prepaint
  2552. // stage, then tell Windows we want messages for every item.
  2553. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  2554. {
  2555. *pResult = CDRF_NOTIFYITEMDRAW;
  2556. }
  2557. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  2558. {
  2559. // This is the prepaint stage for an item. Here's where we set the
  2560. // item's text color. Our return value will tell Windows to draw the
  2561. // item itself, but it will use the new color we set here.
  2562. // We'll cycle the colors through red, green, and light blue.
  2563. CString date=m_List5.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (7+m_nAdd);
  2564. // MessageBox(date);
  2565. // MessageBox(m_date1);
  2566. // MessageBox(m_date2);
  2567. if(date.GetLength()==10 && date>=m_date1 && date<=m_date2)
  2568. pLVCD->clrText = RGB(0,0,220);
  2569. else
  2570. pLVCD->clrText = RGB(0,0,50);
  2571. if(pLVCD->nmcd.dwItemSpec%2)
  2572. pLVCD->clrTextBk = g_gridcol1;
  2573. else
  2574. pLVCD->clrTextBk = g_gridcol2;
  2575. // Store the color back in the NMLVCUSTOMDRAW struct.
  2576. // Tell Windows to paint the control itself.
  2577. *pResult = CDRF_DODEFAULT;
  2578. }
  2579. }
  2580. void TodayForm::OnCustomdrawList6 ( NMHDR* pNMHDR, LRESULT* pResult )
  2581. {
  2582. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  2583. // Take the default processing unless we set this to something else below.
  2584. *pResult = 0;
  2585. // First thing - check the draw stage. If it's the control's prepaint
  2586. // stage, then tell Windows we want messages for every item.
  2587. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  2588. {
  2589. *pResult = CDRF_NOTIFYITEMDRAW;
  2590. }
  2591. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  2592. {
  2593. // This is the prepaint stage for an item. Here's where we set the
  2594. // item's text color. Our return value will tell Windows to draw the
  2595. // item itself, but it will use the new color we set here.
  2596. // We'll cycle the colors through red, green, and light blue.
  2597. // if(::FindArray (&m_datearray6, m_List6.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (9+m_nAdd) )%2)
  2598. // pLVCD->clrText = RGB(0,0,220);
  2599. // else
  2600. // pLVCD->clrText = RGB(0,0,50);
  2601. if(pLVCD->nmcd.dwItemSpec%2)
  2602. pLVCD->clrTextBk = g_gridcol1;
  2603. else
  2604. pLVCD->clrTextBk = g_gridcol2;
  2605. // Store the color back in the NMLVCUSTOMDRAW struct.
  2606. // Tell Windows to paint the control itself.
  2607. *pResult = CDRF_DODEFAULT;
  2608. }
  2609. }
  2610. BOOL TodayForm::PreTranslateMessage(MSG* pMsg)
  2611. {
  2612. // TODO: Add your specialized code here and/or call the base class
  2613. if(pMsg->message==WM_KEYDOWN)
  2614. {
  2615. switch (pMsg->wParam)
  2616. {
  2617. case VK_F9:
  2618. GetClientPhone();
  2619. return 1;
  2620. case 0x43: // copy
  2621. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  2622. {
  2623. GetFocus()->SendMessage(WM_COPY);
  2624. return TRUE;
  2625. }
  2626. break;
  2627. case 0x56: //Ctrl + V:
  2628. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  2629. {
  2630. GetFocus()->SendMessage(WM_PASTE);
  2631. return TRUE;
  2632. }
  2633. break;
  2634. case 0x58: // cut
  2635. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  2636. {
  2637. GetFocus()->SendMessage(WM_CUT);
  2638. return TRUE;
  2639. }
  2640. break;
  2641. case 0x5A: //undo
  2642. case 0x59: //redo
  2643. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  2644. {
  2645. GetFocus()->SendMessage(WM_UNDO);
  2646. return TRUE;
  2647. }
  2648. break;
  2649. }
  2650. }
  2651. return MyFormView::PreTranslateMessage(pMsg);
  2652. }
  2653. void TodayForm::GetClientPhone()
  2654. {
  2655. UpdateData();
  2656. if(m_radio==1)
  2657. {
  2658. GetClientPhone2();
  2659. return;
  2660. }
  2661. else if(m_radio==2)
  2662. {
  2663. GetClientPhone3();
  2664. return;
  2665. }
  2666. else if(m_radio==3)
  2667. {
  2668. GetClientPhone4();
  2669. return;
  2670. }
  2671. else if(m_radio==4)
  2672. {
  2673. GetClientPhone5();
  2674. return;
  2675. }
  2676. CString path;
  2677. if(m_radio==0)
  2678. path="c:\\拍照客人.txt";
  2679. else if(m_radio==1)
  2680. path="c:\\选片客人.txt";
  2681. else if(m_radio==2)
  2682. path="c:\\看设计客人.txt";
  2683. else if(m_radio==3)
  2684. path="c:\\取件客人.txt";
  2685. else if(m_radio==4)
  2686. path="c:\\婚庆客人.txt";
  2687. CStdioFile fp;
  2688. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  2689. CString str;
  2690. CString name,m_name1,m_name2;
  2691. CString phone,m_phone1,m_phone2;
  2692. CString str1,str2,str3,str4,str5,str6,str7,str8,str9;
  2693. int leng1=20;
  2694. int leng2=30;
  2695. int leng3=15;
  2696. int leng4=15;
  2697. int leng5=15;
  2698. int leng6=15;
  2699. int leng7=15;
  2700. int leng8=15;
  2701. int leng9=15;
  2702. str1="姓名";
  2703. str2="电话";
  2704. str3="景点";
  2705. str4="日期";
  2706. str5="时间";
  2707. str6="摄影";
  2708. str7="化妆";
  2709. str8="套系";
  2710. str9="价格";
  2711. FillLength(str1, leng1);
  2712. FillLength(str2, leng2);
  2713. FillLength(str3, leng3);
  2714. FillLength(str4, leng4);
  2715. FillLength(str5, leng5);
  2716. FillLength(str6, leng6);
  2717. FillLength(str7, leng7);
  2718. FillLength(str8, leng8);
  2719. FillLength(str9, leng9);
  2720. str=str1+str2+str3+str4+str5+str6+str7+str8+str9+"\n";
  2721. fp.WriteString (str);
  2722. for(int i=0; i<m_List1.GetItemCount (); i++)
  2723. {
  2724. name.Empty ();
  2725. phone.Empty ();
  2726. m_name1=m_List1.GetItemText (i, 1+m_nAdd);
  2727. m_name2=m_List1.GetItemText (i, 2+m_nAdd);
  2728. m_phone1=m_List1.GetItemText (i, 3+m_nAdd);
  2729. m_phone2=m_List1.GetItemText (i, 4+m_nAdd);
  2730. str3=m_List1.GetItemText (i, 5+m_nAdd);
  2731. str4=m_List1.GetItemText (i, 6+m_nAdd);
  2732. str5=m_List1.GetItemText (i, 7+m_nAdd);
  2733. str6=m_List1.GetItemText (i, 8+m_nAdd);
  2734. str7=m_List1.GetItemText (i, 9+m_nAdd);
  2735. str8=m_List1.GetItemText (i, 12+m_nAdd);
  2736. str9=m_List1.GetItemText (i, 13+m_nAdd);
  2737. if(!m_name1.IsEmpty ())
  2738. name=m_name1+",";
  2739. name+=m_name2;
  2740. name.TrimRight (",");
  2741. if(!m_phone1.IsEmpty ())
  2742. phone=m_phone1+",";
  2743. phone+=m_phone2;phone.TrimRight (",");
  2744. str1=name;
  2745. str2=phone;
  2746. FillLength(str1, leng1);
  2747. FillLength(str2, leng2);
  2748. FillLength(str3, leng3);
  2749. FillLength(str4, leng4);
  2750. FillLength(str5, leng5);
  2751. FillLength(str6, leng6);
  2752. FillLength(str7, leng7);
  2753. FillLength(str8, leng8);
  2754. FillLength(str9, leng9);
  2755. str=str1+str2+str3+str4+str5+str6+str7+str8+str9+"\n";
  2756. fp.WriteString (str);
  2757. }
  2758. fp.Close ();
  2759. MessageBox("资料已保存到"+path);
  2760. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  2761. }
  2762. void TodayForm::GetClientPhone2()
  2763. {
  2764. CString path;
  2765. path="c:\\选片客人.txt";
  2766. CStdioFile fp;
  2767. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  2768. CString str;
  2769. CString name,m_name1,m_name2;
  2770. CString phone,m_phone1,m_phone2;
  2771. CString str1,str2,str3,str4,str5,str6,str7,str8,str9;
  2772. int leng1=25;
  2773. int leng2=30;
  2774. int leng3=20;
  2775. int leng4=20;
  2776. int leng5=20;
  2777. int leng6=20;
  2778. str1="姓名";
  2779. str2="电话";
  2780. str3="日期";
  2781. str4="时间";
  2782. str5="套系";
  2783. str6="价格";
  2784. FillLength(str1, leng1);
  2785. FillLength(str2, leng2);
  2786. FillLength(str3, leng3);
  2787. FillLength(str4, leng4);
  2788. FillLength(str5, leng5);
  2789. FillLength(str6, leng6);
  2790. str=str1+str2+str3+str4+str5+str6+"\n";
  2791. fp.WriteString (str);
  2792. for(int i=0; i<m_List2.GetItemCount (); i++)
  2793. {
  2794. name.Empty ();
  2795. phone.Empty ();
  2796. m_name1=m_List2.GetItemText (i, 1+m_nAdd);
  2797. m_name2=m_List2.GetItemText (i, 2+m_nAdd);
  2798. m_phone1=m_List2.GetItemText (i, 3+m_nAdd);
  2799. m_phone2=m_List2.GetItemText (i, 4+m_nAdd);
  2800. str3=m_List2.GetItemText (i, 5+m_nAdd);
  2801. str4=m_List2.GetItemText (i, 6+m_nAdd);
  2802. str5=m_List2.GetItemText (i, 9+m_nAdd);
  2803. str6=m_List2.GetItemText (i, 10+m_nAdd);
  2804. if(!m_name1.IsEmpty ())
  2805. name=m_name1+",";
  2806. name+=m_name2;
  2807. name.TrimRight (",");
  2808. if(!m_phone1.IsEmpty ())
  2809. phone=m_phone1+",";
  2810. phone+=m_phone2;phone.TrimRight (",");
  2811. str1=name;
  2812. str2=phone;
  2813. FillLength(str1, leng1);
  2814. FillLength(str2, leng2);
  2815. FillLength(str3, leng3);
  2816. FillLength(str4, leng4);
  2817. FillLength(str5, leng5);
  2818. FillLength(str6, leng6);
  2819. str=str1+str2+str3+str4+str5+str6+"\n";
  2820. fp.WriteString (str);
  2821. }
  2822. fp.Close ();
  2823. MessageBox("资料已保存到"+path);
  2824. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  2825. }
  2826. void TodayForm::GetClientPhone3()
  2827. {
  2828. CString path;
  2829. path="c:\\看设计客人.txt";
  2830. CStdioFile fp;
  2831. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  2832. CString str;
  2833. CString name,m_name1,m_name2;
  2834. CString phone,m_phone1,m_phone2;
  2835. CString str1,str2,str3,str4,str5,str6,str7,str8,str9;
  2836. int leng1=25;
  2837. int leng2=30;
  2838. int leng3=20;
  2839. int leng4=20;
  2840. int leng5=20;
  2841. int leng6=20;
  2842. str1="姓名";
  2843. str2="电话";
  2844. str3="日期";
  2845. str4="时间";
  2846. str5="套系";
  2847. str6="价格";
  2848. FillLength(str1, leng1);
  2849. FillLength(str2, leng2);
  2850. FillLength(str3, leng3);
  2851. FillLength(str4, leng4);
  2852. FillLength(str5, leng5);
  2853. FillLength(str6, leng6);
  2854. str=str1+str2+str3+str4+str5+str6+"\n";
  2855. fp.WriteString (str);
  2856. for(int i=0; i<m_List3.GetItemCount (); i++)
  2857. {
  2858. name.Empty ();
  2859. phone.Empty ();
  2860. m_name1=m_List3.GetItemText (i, 1+m_nAdd);
  2861. m_name2=m_List3.GetItemText (i, 2+m_nAdd);
  2862. m_phone1=m_List3.GetItemText (i, 3+m_nAdd);
  2863. m_phone2=m_List3.GetItemText (i, 4+m_nAdd);
  2864. str3=m_List3.GetItemText (i, 5+m_nAdd);
  2865. str4=m_List3.GetItemText (i, 6+m_nAdd);
  2866. str5=m_List3.GetItemText (i, 10+m_nAdd);
  2867. str6=m_List3.GetItemText (i, 11+m_nAdd);
  2868. if(!m_name1.IsEmpty ())
  2869. name=m_name1+",";
  2870. name+=m_name2;
  2871. name.TrimRight (",");
  2872. if(!m_phone1.IsEmpty ())
  2873. phone=m_phone1+",";
  2874. phone+=m_phone2;phone.TrimRight (",");
  2875. str1=name;
  2876. str2=phone;
  2877. FillLength(str1, leng1);
  2878. FillLength(str2, leng2);
  2879. FillLength(str3, leng3);
  2880. FillLength(str4, leng4);
  2881. FillLength(str5, leng5);
  2882. FillLength(str6, leng6);
  2883. str=str1+str2+str3+str4+str5+str6+"\n";
  2884. fp.WriteString (str);
  2885. }
  2886. fp.Close ();
  2887. MessageBox("资料已保存到"+path);
  2888. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  2889. }
  2890. void TodayForm::GetClientPhone4()
  2891. {
  2892. CString path;
  2893. path="c:\\取件客人.txt";
  2894. CStdioFile fp;
  2895. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  2896. CString str;
  2897. CString name,m_name1,m_name2;
  2898. CString phone,m_phone1,m_phone2;
  2899. CString str1,str2,str3,str4,str5,str6,str7,str8,str9;
  2900. int leng1=25;
  2901. int leng2=30;
  2902. int leng3=20;
  2903. int leng4=20;
  2904. int leng5=20;
  2905. int leng6=20;
  2906. str1="姓名";
  2907. str2="电话";
  2908. str3="日期";
  2909. str4="时间";
  2910. str5="套系";
  2911. str6="价格";
  2912. FillLength(str1, leng1);
  2913. FillLength(str2, leng2);
  2914. FillLength(str3, leng3);
  2915. FillLength(str4, leng4);
  2916. FillLength(str5, leng5);
  2917. FillLength(str6, leng6);
  2918. str=str1+str2+str3+str4+str5+str6+"\n";
  2919. fp.WriteString (str);
  2920. for(int i=0; i<m_List4.GetItemCount (); i++)
  2921. {
  2922. name.Empty ();
  2923. phone.Empty ();
  2924. m_name1=m_List4.GetItemText (i, 1+m_nAdd);
  2925. m_name2=m_List4.GetItemText (i, 2+m_nAdd);
  2926. m_phone1=m_List4.GetItemText (i, 3+m_nAdd);
  2927. m_phone2=m_List4.GetItemText (i, 4+m_nAdd);
  2928. str3=m_List4.GetItemText (i, 5+m_nAdd);
  2929. str4=m_List4.GetItemText (i, 6+m_nAdd);
  2930. str5=m_List4.GetItemText (i, 10+m_nAdd);
  2931. str6=m_List4.GetItemText (i, 11+m_nAdd);
  2932. if(!m_name1.IsEmpty ())
  2933. name=m_name1+",";
  2934. name+=m_name2;
  2935. name.TrimRight (",");
  2936. if(!m_phone1.IsEmpty ())
  2937. phone=m_phone1+",";
  2938. phone+=m_phone2;phone.TrimRight (",");
  2939. str1=name;
  2940. str2=phone;
  2941. FillLength(str1, leng1);
  2942. FillLength(str2, leng2);
  2943. FillLength(str3, leng3);
  2944. FillLength(str4, leng4);
  2945. FillLength(str5, leng5);
  2946. FillLength(str6, leng6);
  2947. str=str1+str2+str3+str4+str5+str6+"\n";
  2948. fp.WriteString (str);
  2949. }
  2950. fp.Close ();
  2951. MessageBox("资料已保存到"+path);
  2952. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  2953. }
  2954. void TodayForm::GetClientPhone5()
  2955. {
  2956. CString path;
  2957. path="c:\\婚庆客人.txt";
  2958. CStdioFile fp;
  2959. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  2960. CString str;
  2961. CString name,m_name1,m_name2;
  2962. CString phone,m_phone1,m_phone2;
  2963. CString str1,str2,str3,str4,str5,str6,str7,str8,str9;
  2964. int leng1=25;
  2965. int leng2=30;
  2966. int leng3=20;
  2967. int leng4=20;
  2968. int leng5=20;
  2969. int leng6=20;
  2970. int leng7=20;
  2971. str1="姓名";
  2972. str2="电话";
  2973. str3="婚庆内容";
  2974. str4="日期";
  2975. str5="时间";
  2976. str6="套系";
  2977. str7="价格";
  2978. FillLength(str1, leng1);
  2979. FillLength(str2, leng2);
  2980. FillLength(str3, leng3);
  2981. FillLength(str4, leng4);
  2982. FillLength(str5, leng5);
  2983. FillLength(str6, leng6);
  2984. FillLength(str7, leng7);
  2985. str=str1+str2+str3+str4+str5+str6+str7+"\n";
  2986. fp.WriteString (str);
  2987. for(int i=0; i<m_List5.GetItemCount (); i++)
  2988. {
  2989. name.Empty ();
  2990. phone.Empty ();
  2991. m_name1=m_List5.GetItemText (i, 1+m_nAdd);
  2992. m_name2=m_List5.GetItemText (i, 2+m_nAdd);
  2993. m_phone1=m_List5.GetItemText (i, 3+m_nAdd);
  2994. m_phone2=m_List5.GetItemText (i, 4+m_nAdd);
  2995. str3=m_List5.GetItemText (i, 5+m_nAdd);
  2996. str4=m_List5.GetItemText (i, 6+m_nAdd);
  2997. str5=m_List5.GetItemText (i, 7+m_nAdd);
  2998. str6=m_List5.GetItemText (i, 12+m_nAdd);
  2999. str7=m_List5.GetItemText (i, 13+m_nAdd);
  3000. if(!m_name1.IsEmpty ())
  3001. name=m_name1+",";
  3002. name+=m_name2;
  3003. name.TrimRight (",");
  3004. if(!m_phone1.IsEmpty ())
  3005. phone=m_phone1+",";
  3006. phone+=m_phone2;phone.TrimRight (",");
  3007. str1=name;
  3008. str2=phone;
  3009. FillLength(str1, leng1);
  3010. FillLength(str2, leng2);
  3011. FillLength(str3, leng3);
  3012. FillLength(str4, leng4);
  3013. FillLength(str5, leng5);
  3014. FillLength(str6, leng6);
  3015. FillLength(str7, leng7);
  3016. str=str1+str2+str3+str4+str5+str6+str7+"\n";
  3017. fp.WriteString (str);
  3018. }
  3019. fp.Close ();
  3020. MessageBox("资料已保存到"+path);
  3021. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  3022. }
  3023. void TodayForm::OnClickList10(NMHDR* pNMHDR, LRESULT* pResult)
  3024. {
  3025. // TODO: Add your control notification handler code here
  3026. POSITION pos;
  3027. pos=m_List6.GetFirstSelectedItemPosition();
  3028. if(pos==NULL)return;
  3029. int iItem=m_List6.GetNextSelectedItem(pos);
  3030. g_id = m_List6.GetItemText (iItem, 0+m_nAdd);
  3031. *pResult = 0;
  3032. }
  3033. void TodayForm::HidePrice()
  3034. {
  3035. #ifdef LKAY_VERSION
  3036. if(IsHasRights2new(31))return;
  3037. for(int i=0; i< m_List1array.GetSize (); i++)
  3038. {
  3039. m_List1array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3040. m_List1array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3041. m_List1array.ElementAt (i).SetAt (12+m_nAdd, "***");
  3042. m_List1array.ElementAt (i).SetAt (13+m_nAdd, "***");
  3043. }
  3044. for( i=0; i< m_List2array.GetSize (); i++)
  3045. {
  3046. m_List2array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3047. m_List2array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3048. m_List2array.ElementAt (i).SetAt (9+m_nAdd, "***");
  3049. m_List2array.ElementAt (i).SetAt (10+m_nAdd, "***");
  3050. }
  3051. for( i=0; i< m_List3array.GetSize (); i++)
  3052. {
  3053. m_List3array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3054. m_List3array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3055. m_List3array.ElementAt (i).SetAt (10+m_nAdd, "***");
  3056. m_List3array.ElementAt (i).SetAt (11+m_nAdd, "***");
  3057. }
  3058. for( i=0; i< m_List4array.GetSize (); i++)
  3059. {
  3060. m_List4array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3061. m_List4array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3062. m_List4array.ElementAt (i).SetAt (10+m_nAdd, "***");
  3063. m_List4array.ElementAt (i).SetAt (11+m_nAdd, "***");
  3064. }
  3065. #else
  3066. if(IsHasRights2new(31))return;
  3067. int i = 0;
  3068. for(/*int*/ i=0; i< m_List1array.GetSize (); i++)
  3069. {
  3070. m_List1array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3071. m_List1array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3072. }
  3073. for( i=0; i< m_List2array.GetSize (); i++)
  3074. {
  3075. m_List2array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3076. m_List2array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3077. }
  3078. for( i=0; i< m_List3array.GetSize (); i++)
  3079. {
  3080. m_List3array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3081. m_List3array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3082. }
  3083. for( i=0; i< m_List4array.GetSize (); i++)
  3084. {
  3085. m_List4array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3086. m_List4array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3087. }
  3088. for( i=0; i< m_List5array.GetSize (); i++)
  3089. {
  3090. m_List5array.ElementAt (i).SetAt (3+m_nAdd, "***");
  3091. m_List5array.ElementAt (i).SetAt (4+m_nAdd, "***");
  3092. }
  3093. /* for( i=0; i< m_List6array.GetSize (); i++)
  3094. {
  3095. m_List6array.ElementAt (i).SetAt (16+m_nAdd, "***");
  3096. m_List6array.ElementAt (i).SetAt (17+m_nAdd, "***");
  3097. }*/
  3098. #endif
  3099. }
  3100. extern BOOL CovertDate(CString &date, CString &date2);
  3101. void TodayForm::GetData1(CString strdate, CString strdate2)//拍照客人;
  3102. {
  3103. int i = 0;
  3104. CString sql;
  3105. sql.Format ("bookingdate>='"+strdate+"' and bookingdate<='"+strdate2+"'");
  3106. if(g_bAllBranch==0)
  3107. {
  3108. // printf("Jeff:sql=%s\n\n",sql);
  3109. g_sendhead.code[0]=120;
  3110. g_sendhead.tabcount=1;
  3111. g_sendhead.bsql=0;
  3112. g_pMainWnd->ProcessChatMessageRequest2(sql);
  3113. if(g_bSendOK==0)return;
  3114. DataToArray(&m_List1array);
  3115. // qsort( static_cast<void*>(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel3 );
  3116. #ifdef CHILD_VERSION
  3117. CString date1,date2,str;
  3118. CTime tm=CTime::GetCurrentTime ();
  3119. int days;
  3120. for(/*int*/ i=0; i<m_List1array.GetSize (); i++)
  3121. {
  3122. date1=m_List1array.ElementAt (i).ElementAt(24+m_nAdd2); // Jeff:出生日期;
  3123. if(m_List1array.ElementAt (i).ElementAt(25+m_nAdd2)=="1") // Jeff:是否农历生日;
  3124. {
  3125. date2.Empty ();
  3126. CovertDate(date1,date2);
  3127. if(date2!="")date1=date2;
  3128. }
  3129. if(date1.GetLength ()==10)
  3130. {
  3131. 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 ());
  3132. CTimeSpan dt=tm-tm2;
  3133. days=dt.GetDays()+1;
  3134. #if 0 // Jeff:儿童版开单后,摄控本里显示的岁数不对;
  3135. if(days%365==0)
  3136. days/=365;
  3137. else
  3138. {
  3139. days/=365;
  3140. days++;
  3141. }
  3142. str.Format ("%d岁", days);
  3143. #else
  3144. // Jeff:闰年和平年需要考虑;
  3145. // 1.today != 生日
  3146. // 2.today > birthday;
  3147. // 2.1.获取出生年 compare 今年; 相等,则不足1周岁;可细化月数:差多少天满月、满月、2月……
  3148. // 2.2.获取出生年 compare 今年; < 则 求模判断几周岁;
  3149. // 3.today < birthday;
  3150. // 3.1.获取出生年 compare 今年; 相等,2周岁;
  3151. // 3.2.获取出生年 compare 今年; < 则 求模判断几周岁;
  3152. // -------------------------------------------------
  3153. // 4.today == birthday; 模求周岁;
  3154. // -------------------------------------------------
  3155. //
  3156. // -------------------------------------------------
  3157. // 1.先获取birthday年份和今年年份值,对比;
  3158. // 2.获取birthday月份和今年月份;
  3159. // 3.获取birthday日号和今年日号;
  3160. // ------------------------------------------------
  3161. //printf("Jeff:姓名:%s,出生日期:%d-%d-%d\n\n",m_List1array.ElementAt(i).ElementAt(2),tm2.GetYear(),tm2.GetMonth(),tm2.GetDay());
  3162. //printf("Jeff:姓名:%s,今天日期:%d-%d-%d\n\n",m_List1array.ElementAt(i).ElementAt(2),tm.GetYear(),tm.GetMonth(),tm.GetDay());
  3163. // tm今天; tm2生日;
  3164. if ( tm2.GetYear() < tm.GetYear()) // 未到周岁、1周岁及以上:
  3165. {
  3166. if ( tm.GetYear() - tm2.GetYear() == 1) // 判断是否1周岁生日到了;
  3167. {
  3168. if ( tm.GetMonth() == tm2.GetMonth() && tm.GetDay() == tm2.GetDay())
  3169. {
  3170. // 1周岁生日;
  3171. str.Format ("1周岁");
  3172. }
  3173. else
  3174. {
  3175. if ( tm.GetMonth() < tm2.GetMonth())
  3176. {
  3177. // 未满一周岁;
  3178. // str.Format ("%d岁", days);
  3179. int nMonthCount = tm2.GetMonth() - tm.GetMonth();
  3180. if ( tm.GetDay() > tm2.GetDay())
  3181. {
  3182. str.Format ("%d月", 12-nMonthCount);
  3183. }
  3184. else
  3185. {
  3186. str.Format ("%d月", 12-nMonthCount-1);
  3187. }
  3188. }
  3189. else
  3190. {
  3191. str.Format ("1岁");
  3192. }
  3193. }
  3194. }
  3195. else if ( tm.GetYear() - tm2.GetYear() > 1)
  3196. {
  3197. int nYearCount = 0;
  3198. nYearCount = tm.GetYear()-tm2.GetYear();
  3199. if ( tm.GetMonth() >= tm2.GetMonth() && tm.GetDay() >= tm2.GetDay()) // 满nYearCount周岁;
  3200. {
  3201. str.Format ("%d周岁", nYearCount);
  3202. }
  3203. else // 不满nYearCount-1周岁;
  3204. {
  3205. str.Format ("%d周岁", nYearCount-1);
  3206. }
  3207. }
  3208. }
  3209. else if ( tm2.GetYear() == tm.GetYear()) // 1周岁以下;
  3210. {
  3211. if ( tm.GetMonth() == tm2.GetMonth() )
  3212. {
  3213. if (tm.GetDay() == tm2.GetDay() )
  3214. {
  3215. // 满月;
  3216. str.Format ("满月");
  3217. }
  3218. else
  3219. {
  3220. // 差多少天满月;
  3221. str.Format ("差%d天满月", tm.GetDay()-tm2.GetDay());
  3222. }
  3223. }
  3224. else if ( tm.GetMonth() > tm2.GetMonth() )
  3225. {
  3226. int nMonthCount = tm.GetMonth() - tm2.GetMonth();
  3227. if ( tm.GetDay() > tm2.GetDay() ) // 满nMonthCount月;
  3228. {
  3229. str.Format ("%d月", nMonthCount);
  3230. }
  3231. else // 满nMonthCount-1月;
  3232. {
  3233. str.Format ("%d月", nMonthCount-1);
  3234. }
  3235. }
  3236. }
  3237. #endif
  3238. m_List1array.ElementAt (i).InsertAt (3, str);
  3239. }
  3240. else
  3241. {
  3242. m_List1array.ElementAt (i).InsertAt (3, "未知");
  3243. }
  3244. m_List1array.ElementAt (i).InsertAt (3, m_List1array.ElementAt (i).ElementAt (28+m_nAdd2));
  3245. }
  3246. #endif
  3247. #ifdef ENTERPRISE_VERSION
  3248. qsort( static_cast<void*>(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel8 );
  3249. qsort( static_cast<void*>(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel7 );
  3250. qsort( static_cast<void*>(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel5 );
  3251. #endif
  3252. return;
  3253. }
  3254. //////////////数据汇总
  3255. m_List1array.RemoveAll ();
  3256. CStringArray failbrancharray;
  3257. CString branch;
  3258. for(/*int*/ i=-1; i<g_brancharray.GetSize ()-1; i++)
  3259. {
  3260. if(i!=-1)
  3261. {
  3262. branch=g_brancharray.ElementAt (i).ElementAt (0);
  3263. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  3264. g_pMainWnd->OnDisconnect();
  3265. g_branchname=branch;
  3266. g_bBranchModify=1;
  3267. }
  3268. else
  3269. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  3270. g_sendhead.bsql=0;
  3271. g_sendhead.code[0]=120;
  3272. g_sendhead.tabcount=1;
  3273. g_pMainWnd->ProcessChatMessageRequest2(sql);
  3274. if(g_bSendOK==0)
  3275. {
  3276. failbrancharray.Add (branch);
  3277. continue;
  3278. }
  3279. CArray<CStringArray, CStringArray>List1array;
  3280. DataToArray(&List1array);
  3281. int size=m_List1array.GetSize ();
  3282. for(int j=0; j<List1array.GetSize (); j++)
  3283. {
  3284. size++;
  3285. m_List1array.SetSize(size , 1 );
  3286. size--;
  3287. m_List1array.ElementAt (size).Copy (List1array.ElementAt (j));
  3288. m_List1array.ElementAt (size).InsertAt (0, branch);
  3289. size++;
  3290. }
  3291. }
  3292. #ifdef CHILD_VERSION
  3293. CString date1,date2,str;
  3294. CTime tm=CTime::GetCurrentTime ();
  3295. int days;
  3296. for( i=0; i<m_List1array.GetSize (); i++)
  3297. {
  3298. date1=m_List1array.ElementAt (i).ElementAt (25+m_nAdd2);
  3299. if(m_List1array.ElementAt (i).ElementAt (26+m_nAdd2)=="1")
  3300. {
  3301. date2.Empty ();
  3302. CovertDate(date1,date2);
  3303. if(date2!="")date1=date2;
  3304. }
  3305. if(date1.GetLength ()==10)
  3306. {
  3307. 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 ());
  3308. CTimeSpan dt=tm-tm2;
  3309. days=dt.GetDays ()+1;
  3310. if(days%365==0)
  3311. days/=365;
  3312. else
  3313. {
  3314. days/=365;
  3315. days++;
  3316. }
  3317. str.Format ("%d岁", days);
  3318. m_List1array.ElementAt (i).InsertAt (4, str);
  3319. }
  3320. else
  3321. {
  3322. m_List1array.ElementAt (i).InsertAt (4, "未知");
  3323. }
  3324. m_List1array.ElementAt (i).InsertAt (4, m_List1array.ElementAt (i).ElementAt (29+m_nAdd2));
  3325. }
  3326. #endif
  3327. qsort( static_cast<void*>(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel8 );
  3328. qsort( static_cast<void*>(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel7 );
  3329. qsort( static_cast<void*>(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel5 );
  3330. for(i=0; i<failbrancharray.GetSize (); i++)
  3331. {
  3332. // AfxMessageBox("连接"+failbrancharray.ElementAt(i)+"服务器失败!", MB_ICONINFORMATION);
  3333. }
  3334. g_pMainWnd->OnDisconnect();
  3335. g_bBranchModify=0;g_branchip=g_branchname="";
  3336. }
  3337. void TodayForm::GetData2(CString strdate, CString strdate2)//选片客人;
  3338. {
  3339. CString sql;
  3340. sql.Format ("time4>='"+strdate+"' and time4<='"+strdate2+"'");
  3341. if(g_bAllBranch==0)
  3342. {
  3343. g_sendhead.code[0]=121;
  3344. g_sendhead.tabcount=1;
  3345. g_sendhead.bsql=0;
  3346. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  3347. DataToArray(&m_List2array);
  3348. return;
  3349. }
  3350. //////////////数据汇总
  3351. m_List2array.RemoveAll ();
  3352. CStringArray failbrancharray;
  3353. CString branch;
  3354. for(int i=-1; i<g_brancharray.GetSize()-1; i++)
  3355. {
  3356. if(i!=-1)
  3357. {
  3358. branch=g_brancharray.ElementAt (i).ElementAt (0);
  3359. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  3360. g_pMainWnd->OnDisconnect();
  3361. g_branchname=branch;
  3362. g_bBranchModify=1;
  3363. }
  3364. else
  3365. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  3366. g_sendhead.bsql=0;
  3367. g_sendhead.code[0]=121;
  3368. g_sendhead.tabcount=1;
  3369. g_pMainWnd->ProcessChatMessageRequest2(sql);
  3370. if(g_bSendOK==0)
  3371. {
  3372. failbrancharray.Add(branch);
  3373. continue;
  3374. }
  3375. CArray<CStringArray, CStringArray>List1array;
  3376. DataToArray(&List1array);
  3377. int size=m_List2array.GetSize ();
  3378. for(int j=0; j<List1array.GetSize (); j++)
  3379. {
  3380. size++;
  3381. m_List2array.SetSize(size , 1 );
  3382. size--;
  3383. m_List2array.ElementAt (size).Copy (List1array.ElementAt (j));
  3384. m_List2array.ElementAt (size).InsertAt (0, branch);
  3385. size++;
  3386. }
  3387. }
  3388. g_pMainWnd->OnDisconnect();
  3389. g_bBranchModify=0;g_branchip=g_branchname="";
  3390. }
  3391. void TodayForm::GetData3(CString strdate, CString strdate2)//看设计客人;
  3392. {
  3393. CString sql;
  3394. sql.Format ("time6>='"+strdate+"' and time6<='"+strdate2+"'");
  3395. if(g_bAllBranch==0)
  3396. {
  3397. g_sendhead.code[0]=122;
  3398. g_sendhead.tabcount=1;
  3399. g_sendhead.bsql=0;
  3400. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  3401. DataToArray(&m_List3array);
  3402. return;
  3403. }
  3404. //////////////数据汇总
  3405. m_List3array.RemoveAll ();
  3406. CStringArray failbrancharray;
  3407. CString branch;
  3408. for(int i=-1; i<g_brancharray.GetSize ()-1; i++)
  3409. {
  3410. if(i!=-1)
  3411. {
  3412. branch=g_brancharray.ElementAt (i).ElementAt (0);
  3413. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  3414. g_pMainWnd->OnDisconnect();
  3415. g_branchname=branch;
  3416. g_bBranchModify=1;
  3417. }
  3418. else
  3419. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  3420. g_sendhead.bsql=0;
  3421. g_sendhead.code[0]=122;
  3422. g_sendhead.tabcount=1;
  3423. g_pMainWnd->ProcessChatMessageRequest2(sql);
  3424. if(g_bSendOK==0)
  3425. {
  3426. failbrancharray.Add (branch);
  3427. continue;
  3428. }
  3429. CArray<CStringArray, CStringArray>List1array;
  3430. DataToArray(&List1array);
  3431. int size=m_List3array.GetSize ();
  3432. for(int j=0; j<List1array.GetSize (); j++)
  3433. {
  3434. size++;
  3435. m_List3array.SetSize(size , 1 );
  3436. size--;
  3437. m_List3array.ElementAt (size).Copy (List1array.ElementAt (j));
  3438. m_List3array.ElementAt (size).InsertAt (0, branch);
  3439. size++;
  3440. }
  3441. }
  3442. g_pMainWnd->OnDisconnect();
  3443. g_bBranchModify=0;g_branchip=g_branchname="";
  3444. }
  3445. void TodayForm::GetData4(CString strdate, CString strdate2)//取件客人
  3446. {
  3447. CString sql;
  3448. sql.Format ("time5>='"+strdate+"' and time5<='"+strdate2+"' and [status3]='未取'");
  3449. if(g_bAllBranch==0)
  3450. {
  3451. g_sendhead.code[0]=123;
  3452. g_sendhead.tabcount=1;
  3453. g_sendhead.bsql=0;
  3454. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  3455. DataToArray(&m_List4array);
  3456. return;
  3457. }
  3458. //////////////数据汇总
  3459. m_List4array.RemoveAll ();
  3460. CStringArray failbrancharray;
  3461. CString branch;
  3462. for(int i=-1; i<g_brancharray.GetSize ()-1; i++)
  3463. {
  3464. if(i!=-1)
  3465. {
  3466. branch=g_brancharray.ElementAt (i).ElementAt (0);
  3467. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  3468. g_pMainWnd->OnDisconnect();
  3469. g_branchname=branch;
  3470. g_bBranchModify=1;
  3471. }
  3472. else
  3473. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  3474. g_sendhead.bsql=0;
  3475. g_sendhead.code[0]=123;
  3476. g_sendhead.tabcount=1;
  3477. g_pMainWnd->ProcessChatMessageRequest2(sql);
  3478. if(g_bSendOK==0)
  3479. {
  3480. failbrancharray.Add (branch);
  3481. continue;
  3482. }
  3483. CArray<CStringArray, CStringArray>List1array;
  3484. DataToArray(&List1array);
  3485. int size=m_List4array.GetSize ();
  3486. for(int j=0; j<List1array.GetSize (); j++)
  3487. {
  3488. size++;
  3489. m_List4array.SetSize(size , 1 );
  3490. size--;
  3491. m_List4array.ElementAt (size).Copy (List1array.ElementAt (j));
  3492. m_List4array.ElementAt (size).InsertAt (0, branch);
  3493. size++;
  3494. }
  3495. }
  3496. g_pMainWnd->OnDisconnect();
  3497. g_bBranchModify=0;g_branchip=g_branchname="";
  3498. }
  3499. void TodayForm::GetData5(CString strdate, CString strdate2)// 近期生日;
  3500. {//MessageBox("fd");
  3501. CString sql;
  3502. sql.Format ("hqdate>='"+strdate+"' and hqdate<='"+strdate2+"' and kind='2'");
  3503. // sql.Format ("%s,%s", strdate,strdate2);
  3504. if(g_bAllBranch==0)
  3505. {
  3506. g_sendhead.code[0]=227;
  3507. g_sendhead.tabcount=1;
  3508. g_sendhead.bsql=0;
  3509. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  3510. DataToArray(&m_List5array);
  3511. return;
  3512. }
  3513. //////////////数据汇总
  3514. m_List5array.RemoveAll ();
  3515. CStringArray failbrancharray;
  3516. CString branch;
  3517. for(int i=-1; i<g_brancharray.GetSize ()-1; i++)
  3518. {
  3519. if(i!=-1)
  3520. {
  3521. branch=g_brancharray.ElementAt (i).ElementAt (0);
  3522. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  3523. g_pMainWnd->OnDisconnect();
  3524. g_branchname=branch;
  3525. g_bBranchModify=1;
  3526. }
  3527. else
  3528. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  3529. g_sendhead.bsql=0;
  3530. g_sendhead.code[0]=227;
  3531. g_sendhead.tabcount=1;
  3532. g_pMainWnd->ProcessChatMessageRequest2(sql);
  3533. if(g_bSendOK==0)
  3534. {
  3535. failbrancharray.Add (branch);
  3536. continue;
  3537. }
  3538. CArray<CStringArray, CStringArray>List1array;
  3539. DataToArray(&List1array);
  3540. int size=m_List5array.GetSize ();
  3541. for(int j=0; j<List1array.GetSize (); j++)
  3542. {
  3543. size++;
  3544. m_List5array.SetSize(size , 1 );
  3545. size--;
  3546. m_List5array.ElementAt (size).Copy (List1array.ElementAt (j));
  3547. m_List5array.ElementAt (size).InsertAt (0, branch);
  3548. size++;
  3549. }
  3550. }
  3551. g_pMainWnd->OnDisconnect();
  3552. g_bBranchModify=0;g_branchip=g_branchname="";
  3553. }
  3554. void TodayForm::OnBUTtakeaway() // 打印;
  3555. {
  3556. // TODO: Add your control notification handler code here
  3557. if(IsHasRights2new(2)==0)return;
  3558. if(m_radio==0)
  3559. {
  3560. SelMemberCardFund seldlg;
  3561. seldlg.m_mode=1;
  3562. if(seldlg.DoModal ()!=IDOK)return;
  3563. if(seldlg.m_radio1==0)
  3564. {
  3565. OnBUTtakeaway1();return;
  3566. }
  3567. }
  3568. else if(m_radio==1)
  3569. {
  3570. OnBUTtakeaway2();return;
  3571. }
  3572. else if(m_radio==2)
  3573. {
  3574. OnBUTtakeaway3();return;
  3575. }
  3576. else if(m_radio==3)
  3577. {
  3578. OnBUTtakeaway4();return;
  3579. }
  3580. else if(m_radio==4)
  3581. {
  3582. OnBUTtakeaway5();return;
  3583. }
  3584. POSITION pos;
  3585. pos=m_List1.GetFirstSelectedItemPosition();
  3586. if(pos==NULL)
  3587. {
  3588. AfxMessageBox("请先选中您要打印的项目!", MB_ICONINFORMATION);
  3589. return;
  3590. }
  3591. int iItem;
  3592. CArray<CStringArray, CStringArray>Listarray;
  3593. int count=m_List1.GetItemCount ();
  3594. Listarray.SetSize(count, 1);
  3595. count=0;
  3596. int curpos=0;
  3597. CString str;
  3598. int nChild=1;
  3599. CString name,m_name1,m_name2;
  3600. CString phone,m_phone1,m_phone2;
  3601. #ifdef CHILD_VERSION
  3602. nChild=2;
  3603. #endif
  3604. while (pos)
  3605. {
  3606. name="";
  3607. phone="";
  3608. iItem = m_List1.GetNextSelectedItem(pos);
  3609. Listarray.ElementAt (curpos).Add ("日期");
  3610. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 8+nChild+m_nAdd+m_nAdd2));
  3611. Listarray.ElementAt (curpos).Add ("时间");
  3612. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 9+nChild+m_nAdd+m_nAdd2));
  3613. m_name1=m_List1.GetItemText (iItem, 1+m_nAdd);
  3614. m_name2=m_List1.GetItemText (iItem, 2+m_nAdd);
  3615. m_phone1=m_List1.GetItemText (iItem, 3+m_nAdd);
  3616. m_phone2=m_List1.GetItemText (iItem, 4+m_nAdd);
  3617. #ifdef CHILD_VERSION
  3618. m_phone1=m_List1.GetItemText (iItem, 5+m_nAdd);
  3619. m_phone2=m_List1.GetItemText (iItem, 6+m_nAdd);
  3620. #endif
  3621. if(!m_name1.IsEmpty ())
  3622. name=m_name1+",";
  3623. name+=m_name2;
  3624. name.TrimRight (",");
  3625. if(!m_phone1.IsEmpty ())
  3626. phone=m_phone1+",";
  3627. phone+=m_phone2;phone.TrimRight (",");
  3628. Listarray.ElementAt (curpos).Add ("客人姓名");
  3629. Listarray.ElementAt (curpos).Add (name);
  3630. Listarray.ElementAt (curpos).Add ("联系电话");
  3631. Listarray.ElementAt (curpos).Add (phone);
  3632. Listarray.ElementAt (curpos).Add ("景点");
  3633. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 6+nChild+m_nAdd));
  3634. Listarray.ElementAt (curpos).Add ("摄影师");
  3635. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 12+nChild+m_nAdd+m_nAdd2));
  3636. Listarray.ElementAt (curpos).Add ("助理");
  3637. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 13+nChild+m_nAdd+m_nAdd2));
  3638. #ifdef CHILD_VERSION
  3639. Listarray.ElementAt (curpos).Add ("引导师");
  3640. #else
  3641. Listarray.ElementAt (curpos).Add ("化妆师");
  3642. #endif
  3643. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 14+nChild+m_nAdd+m_nAdd2));
  3644. Listarray.ElementAt (curpos).Add ("助理");
  3645. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 15+nChild+m_nAdd+m_nAdd2));
  3646. Listarray.ElementAt (curpos).Add ("服装");
  3647. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 16+nChild+m_nAdd+m_nAdd2));
  3648. Listarray.ElementAt (curpos).Add ("门市");
  3649. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 18+nChild+m_nAdd+m_nAdd2));
  3650. Listarray.ElementAt (curpos).Add ("备注");
  3651. Listarray.ElementAt (curpos).Add (m_List1.GetItemText (iItem, 17+nChild+m_nAdd+m_nAdd2));
  3652. curpos++;
  3653. }
  3654. Listarray.SetSize(curpos, 1);
  3655. g_pMainWnd->PrintTakeForm(&Listarray);
  3656. }
  3657. void TodayForm::GetCalendarData()
  3658. {
  3659. if(m_bInit==0)return;
  3660. if(m_bShowCalendar==0)return;
  3661. m_spinyear.EnableWindow(0);
  3662. m_spinmonth.EnableWindow(0);
  3663. m_spinday.EnableWindow(0);
  3664. UpdateData();
  3665. CString strdate,strdate2;
  3666. strdate.Format ("%04d-%02d-%02d", m_year, m_month, 1);
  3667. strdate2.Format ("%04d-%02d-%02d", m_year, m_month, 31);
  3668. CString sql;
  3669. 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'";
  3670. g_sendhead.code[0]=120;
  3671. g_sendhead.code[1]=121;
  3672. g_sendhead.code[2]=122;
  3673. g_sendhead.code[3]=123;
  3674. g_sendhead.code[4]=139;
  3675. g_sendhead.tabcount=5;
  3676. g_sendhead.bsql=0;
  3677. g_pMainWnd->ProcessChatMessageRequest2(sql);
  3678. m_spinyear.EnableWindow(1);
  3679. m_spinmonth.EnableWindow(1);
  3680. m_spinday.EnableWindow(1);
  3681. if(g_bSendOK==0)return;
  3682. CArray<CStringArray, CStringArray>m_List1array;
  3683. CArray<CStringArray, CStringArray>m_List2array;
  3684. CArray<CStringArray, CStringArray>m_List3array;
  3685. CArray<CStringArray, CStringArray>m_List4array;
  3686. CArray<CStringArray, CStringArray>m_List5array;
  3687. DataToArray(&m_List1array, &m_List2array, &m_List3array, &m_List4array, &m_List5array);
  3688. CArray<int,int>array1;
  3689. CArray<int,int>array2;
  3690. CArray<int,int>array3;
  3691. CArray<int,int>array4;
  3692. CArray<int,int>array5;
  3693. int pos;
  3694. int i = 0;
  3695. for(/*int*/ i=0; i<32; i++)
  3696. {
  3697. array1.Add (0);
  3698. array2.Add (0);
  3699. array3.Add (0);
  3700. array4.Add (0);
  3701. array5.Add (0);
  3702. }
  3703. for(i=0; i<m_List1array.GetSize (); i++)
  3704. {
  3705. // - old code: Jeff remark:没有对集团版进行处理;
  3706. // #ifdef CHILD_VERSION
  3707. // pos=atoi(m_List1array.ElementAt (i).ElementAt (8).Right (2));
  3708. // #else
  3709. // pos=atoi(m_List1array.ElementAt (i).ElementAt (9).Right (2));
  3710. // #endif
  3711. // the follow is modify by Jeff;
  3712. #ifdef CHILD_VERSION // 儿童版
  3713. #ifdef ENTERPRISE_VERSION
  3714. pos=atoi(m_List1array.ElementAt (i).ElementAt (9).Right (2));
  3715. #else
  3716. pos=atoi(m_List1array.ElementAt (i).ElementAt (8).Right (2));
  3717. #endif
  3718. #else // 婚纱版
  3719. #ifdef ENTERPRISE_VERSION
  3720. pos=atoi(m_List1array.ElementAt (i).ElementAt (10).Right (2));
  3721. #else
  3722. pos=atoi(m_List1array.ElementAt (i).ElementAt (9).Right (2));
  3723. #endif
  3724. #endif
  3725. array1.SetAt (pos, array1.ElementAt (pos)+1);
  3726. }
  3727. for(i=0; i<m_List2array.GetSize (); i++)
  3728. {
  3729. pos=atoi(m_List2array.ElementAt (i).ElementAt (5).Right (2));
  3730. array2.SetAt (pos, array2.ElementAt (pos)+1);
  3731. }
  3732. for(i=0; i<m_List3array.GetSize (); i++)
  3733. {
  3734. pos=atoi(m_List3array.ElementAt (i).ElementAt (5).Right (2));
  3735. array3.SetAt (pos, array3.ElementAt (pos)+1);
  3736. }
  3737. for(i=0; i<m_List4array.GetSize (); i++)
  3738. {
  3739. pos=atoi(m_List4array.ElementAt (i).ElementAt (5).Right (2));
  3740. array4.SetAt (pos, array4.ElementAt (pos)+1);
  3741. }
  3742. for(i=0; i<m_List5array.GetSize (); i++)
  3743. {
  3744. pos=atoi(m_List5array.ElementAt (i).ElementAt (6).Right (2));
  3745. array5.SetAt (pos, array5.ElementAt (pos)+1);
  3746. }
  3747. m_CalendarFrm.m_oCalendar.m_Array.RemoveAll ();
  3748. CString str;
  3749. for(i=0; i<32; i++)
  3750. {
  3751. #ifndef CHILD_VERSION //wangwenbin mark
  3752. str.Format ("拍照客人: %d\n选片客人: %d\n看样客人: %d\n取件客人: %d\n婚庆客人: %d\n",
  3753. array1.ElementAt (i), array2.ElementAt (i), array3.ElementAt (i), array4.ElementAt (i), array5.ElementAt (i));
  3754. #else
  3755. str.Format ("拍照客人: %d\n选片客人: %d\n看样客人: %d\n取件客人: %d\n",
  3756. array1.ElementAt (i), array2.ElementAt (i), array3.ElementAt (i), array4.ElementAt (i));
  3757. #endif
  3758. m_CalendarFrm.m_oCalendar.m_Array.Add (str); // Jeff:添加到日历控件中;
  3759. }
  3760. //SetDate(iYear, iMonth, iDay);
  3761. m_CalendarFrm.DateChange(m_year, m_month);
  3762. m_CalendarFrm.m_oCalendar.Invalidate ();
  3763. }
  3764. // Jeff:按钮:详情图表;
  3765. void TodayForm::OnBUTall() // 详情;
  3766. {
  3767. // TODO: Add your control notification handler code here
  3768. m_bShowCalendar=!m_bShowCalendar;
  3769. if(m_bShowCalendar)
  3770. {
  3771. GetDlgItem(IDC_BUTall)->SetWindowText("详情");
  3772. m_List1.ShowWindow (SW_HIDE);
  3773. m_List2.ShowWindow (SW_HIDE);
  3774. m_List3.ShowWindow (SW_HIDE);
  3775. m_List4.ShowWindow (SW_HIDE);
  3776. m_List5.ShowWindow (SW_HIDE);
  3777. m_List6.ShowWindow (SW_HIDE);
  3778. m_CalendarFrm.ShowWindow (SW_SHOW);
  3779. }
  3780. else
  3781. {
  3782. GetDlgItem(IDC_BUTall)->SetWindowText("图表");
  3783. m_CalendarFrm.ShowWindow (SW_HIDE);
  3784. DateChange();
  3785. }
  3786. }
  3787. void TodayForm::SetDate(int m_iYear, int m_iMonth, int m_iDay)
  3788. {
  3789. UpdateData();
  3790. m_year = m_iYear;
  3791. m_month = m_iMonth;
  3792. m_day = m_iDay;
  3793. UpdateData(false);
  3794. }
  3795. void TodayForm::OnBUTall2()
  3796. {
  3797. OnBUTall();
  3798. }
  3799. void TodayForm::OnRadio9()
  3800. {
  3801. // TODO: Add your control notification handler code here
  3802. OnRadio8();
  3803. }
  3804. void TodayForm::OnRadio14()
  3805. {
  3806. // TODO: Add your control notification handler code here
  3807. OnRadio8();
  3808. }
  3809. void TodayForm::OnRadio15()
  3810. {
  3811. // TODO: Add your control notification handler code here
  3812. OnRadio8();
  3813. }
  3814. //hideprice
  3815. void TodayForm::OnRadio10()
  3816. {
  3817. // TODO: Add your control notification handler code here
  3818. OnRadio8();
  3819. }
  3820. void TodayForm::ReLoad1()
  3821. {
  3822. DateChange();
  3823. }
  3824. CString TodayForm::GetDate()
  3825. {
  3826. UpdateData();
  3827. CString strdate;
  3828. strdate.Format ("%04d-%02d-%02d", m_year, m_month, m_day);
  3829. return strdate;
  3830. }
  3831. //天后生日
  3832. void TodayForm::OnBUTtakeaway1()
  3833. {
  3834. CArray<CStringArray, CStringArray>Listarray;
  3835. CString name,m_name1,m_name2;
  3836. CString phone,m_phone1,m_phone2;
  3837. int nChild=1;
  3838. #ifdef CHILD_VERSION
  3839. nChild=2;
  3840. #endif
  3841. int count=m_List1.GetItemCount ()/45;
  3842. if(m_List1.GetItemCount ()%45)count++;
  3843. Listarray.SetSize(m_List1.GetItemCount ()+count, 1);
  3844. int pos=0;
  3845. for(int i=0; i<m_List1.GetItemCount (); i++)
  3846. {
  3847. if(i%45==0)
  3848. {
  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. Listarray.ElementAt (pos).Add ("门市");
  3856. pos++;
  3857. }
  3858. name=""; phone="";
  3859. m_name1=m_List1.GetItemText (i, 1+m_nAdd);
  3860. m_name2=m_List1.GetItemText (i, 2+m_nAdd);
  3861. if(!m_name1.IsEmpty ())
  3862. name=m_name1+",";
  3863. name+=m_name2;
  3864. name.TrimRight (",");
  3865. m_phone1=m_List1.GetItemText (i, 3+m_nAdd);
  3866. m_phone2=m_List1.GetItemText (i, 4+m_nAdd);
  3867. #ifdef CHILD_VERSION
  3868. m_phone1=m_List1.GetItemText (i, 5+m_nAdd);
  3869. m_phone2=m_List1.GetItemText (i, 6+m_nAdd);
  3870. #endif
  3871. if(!m_phone1.IsEmpty ())
  3872. phone=m_phone1+",";
  3873. phone+=m_phone2;phone.TrimRight (",");
  3874. Listarray.ElementAt (pos).Add (name+"/"+phone);
  3875. Listarray.ElementAt (pos).Add (m_List1.GetItemText (i, 6+nChild+m_nAdd));
  3876. Listarray.ElementAt (pos).Add (m_List1.GetItemText (i, 8+nChild+m_nAdd+m_nAdd2)+"/"+m_List1.GetItemText (i, 9+nChild+m_nAdd+m_nAdd2));
  3877. Listarray.ElementAt (pos).Add (m_List1.GetItemText (i, 12+nChild+m_nAdd+m_nAdd2)+"/"+m_List1.GetItemText (i, 13+nChild+m_nAdd+m_nAdd2));
  3878. Listarray.ElementAt (pos).Add (m_List1.GetItemText (i, 14+nChild+m_nAdd+m_nAdd2)+"/"+m_List1.GetItemText (i, 15+nChild+m_nAdd+m_nAdd2));
  3879. Listarray.ElementAt (pos).Add (m_List1.GetItemText (i, 16+nChild+m_nAdd+m_nAdd2));
  3880. Listarray.ElementAt (pos).Add (m_List1.GetItemText (i, 18+nChild+m_nAdd+m_nAdd2));
  3881. pos++;
  3882. }
  3883. Listarray.SetSize(pos, 1);
  3884. g_pMainWnd->PrintTakeForm1(&Listarray);
  3885. }
  3886. void TodayForm::OnBUTtakeaway2()
  3887. {
  3888. CArray<CStringArray, CStringArray>Listarray;
  3889. CString name,m_name1,m_name2;
  3890. CString phone,m_phone1,m_phone2;
  3891. int nChild=0;
  3892. #ifdef CHILD_VERSION
  3893. nChild=-1;
  3894. #endif
  3895. int count=m_List2.GetItemCount ()/45;
  3896. if(m_List2.GetItemCount ()%45)count++;
  3897. Listarray.SetSize(m_List2.GetItemCount ()+count, 1);
  3898. int pos=0;
  3899. for(int i=0; i<m_List2.GetItemCount (); i++)
  3900. {
  3901. if(i%45==0)
  3902. {
  3903. Listarray.ElementAt (pos).Add ("客人/电话");
  3904. Listarray.ElementAt (pos).Add ("日期/时间");
  3905. Listarray.ElementAt (pos).Add ("选片人");
  3906. Listarray.ElementAt (pos).Add ("套系");
  3907. Listarray.ElementAt (pos).Add ("门市");
  3908. pos++;
  3909. }
  3910. name=""; phone="";
  3911. m_name1=m_List2.GetItemText (i, 1+m_nAdd);
  3912. m_name2=m_List2.GetItemText (i, 2+m_nAdd);
  3913. if(!m_name1.IsEmpty ())
  3914. name=m_name1+",";
  3915. name+=m_name2;
  3916. name.TrimRight (",");
  3917. m_phone1=m_List2.GetItemText (i, 3+m_nAdd);
  3918. m_phone2=m_List2.GetItemText (i, 4+m_nAdd);
  3919. #ifdef CHILD_VERSION
  3920. m_phone1=m_List2.GetItemText (i, 3+m_nAdd);
  3921. m_phone2=m_List2.GetItemText (i, 4+m_nAdd);
  3922. #endif
  3923. if(!m_phone1.IsEmpty ())
  3924. phone=m_phone1+",";
  3925. phone+=m_phone2;phone.TrimRight (",");
  3926. Listarray.ElementAt (pos).Add (name+"/"+phone);
  3927. Listarray.ElementAt (pos).Add (m_List2.GetItemText (i, 5+m_nAdd)+"/"+m_List2.GetItemText (i, 6+m_nAdd));
  3928. Listarray.ElementAt (pos).Add (m_List2.GetItemText (i, 9+nChild+m_nAdd));
  3929. Listarray.ElementAt (pos).Add (m_List2.GetItemText (i, 11+nChild+m_nAdd));
  3930. Listarray.ElementAt (pos).Add (m_List2.GetItemText (i, 10+nChild+m_nAdd));
  3931. pos++;
  3932. }
  3933. Listarray.SetSize(pos, 1);
  3934. g_pMainWnd->PrintTakeForm2(&Listarray);
  3935. }
  3936. void TodayForm::OnBUTtakeaway3()
  3937. {
  3938. CArray<CStringArray, CStringArray>Listarray;
  3939. CString name,m_name1,m_name2;
  3940. CString phone,m_phone1,m_phone2;
  3941. int nChild=0;
  3942. #ifdef CHILD_VERSION
  3943. nChild=-1;
  3944. #endif
  3945. int count=m_List3.GetItemCount ()/45;
  3946. if(m_List3.GetItemCount ()%45)count++;
  3947. Listarray.SetSize(m_List3.GetItemCount ()+count, 1);
  3948. int pos=0;
  3949. for(int i=0; i<m_List3.GetItemCount (); i++)
  3950. {
  3951. if(i%45==0)
  3952. {
  3953. Listarray.ElementAt (pos).Add ("客人/电话");
  3954. Listarray.ElementAt (pos).Add ("日期/时间");
  3955. Listarray.ElementAt (pos).Add ("看设计人");
  3956. Listarray.ElementAt (pos).Add ("套系");
  3957. Listarray.ElementAt (pos).Add ("门市");
  3958. pos++;
  3959. }
  3960. name=""; phone="";
  3961. m_name1=m_List3.GetItemText (i, 1+m_nAdd);
  3962. m_name2=m_List3.GetItemText (i, 2+m_nAdd);
  3963. if(!m_name1.IsEmpty ())
  3964. name=m_name1+",";
  3965. name+=m_name2;
  3966. name.TrimRight (",");
  3967. m_phone1=m_List3.GetItemText (i, 3+m_nAdd);
  3968. m_phone2=m_List3.GetItemText (i, 4+m_nAdd);
  3969. #ifdef CHILD_VERSION
  3970. m_phone1=m_List3.GetItemText (i, 3+m_nAdd);
  3971. m_phone2=m_List3.GetItemText (i, 4+m_nAdd);
  3972. #endif
  3973. if(!m_phone1.IsEmpty ())
  3974. phone=m_phone1+",";
  3975. phone+=m_phone2;phone.TrimRight (",");
  3976. Listarray.ElementAt (pos).Add (name+"/"+phone);
  3977. Listarray.ElementAt (pos).Add (m_List3.GetItemText (i, 5+m_nAdd)+"/"+m_List3.GetItemText (i, 6+m_nAdd));
  3978. Listarray.ElementAt (pos).Add (m_List3.GetItemText (i, 10+nChild+m_nAdd));
  3979. Listarray.ElementAt (pos).Add (m_List3.GetItemText (i, 12+nChild+m_nAdd));
  3980. Listarray.ElementAt (pos).Add (m_List3.GetItemText (i, 11+nChild+m_nAdd));
  3981. pos++;
  3982. }
  3983. Listarray.SetSize(pos, 1);
  3984. g_pMainWnd->PrintTakeForm3(&Listarray);
  3985. }
  3986. void TodayForm::OnBUTtakeaway4()
  3987. {
  3988. CArray<CStringArray, CStringArray>Listarray;
  3989. CString name,m_name1,m_name2;
  3990. CString phone,m_phone1,m_phone2;
  3991. int nChild=0;
  3992. #ifdef CHILD_VERSION
  3993. nChild=-1;
  3994. #endif
  3995. int count=m_List4.GetItemCount ()/45;
  3996. if(m_List4.GetItemCount ()%45)count++;
  3997. Listarray.SetSize(m_List4.GetItemCount ()+count, 1);
  3998. int pos=0;
  3999. for(int i=0; i<m_List4.GetItemCount (); i++)
  4000. {
  4001. if(i%45==0)
  4002. {
  4003. Listarray.ElementAt (pos).Add ("客人/电话");
  4004. Listarray.ElementAt (pos).Add ("日期/时间");
  4005. Listarray.ElementAt (pos).Add ("取件人");
  4006. Listarray.ElementAt (pos).Add ("是否完件");
  4007. Listarray.ElementAt (pos).Add ("门市");
  4008. pos++;
  4009. }
  4010. name=""; phone="";
  4011. m_name1=m_List4.GetItemText (i, 1+m_nAdd);
  4012. m_name2=m_List4.GetItemText (i, 2+m_nAdd);
  4013. if(!m_name1.IsEmpty ())
  4014. name=m_name1+",";
  4015. name+=m_name2;
  4016. name.TrimRight (",");
  4017. m_phone1=m_List4.GetItemText (i, 3+m_nAdd);
  4018. m_phone2=m_List4.GetItemText (i, 4+m_nAdd);
  4019. #ifdef CHILD_VERSION
  4020. m_phone1=m_List4.GetItemText (i, 3+m_nAdd);
  4021. m_phone2=m_List4.GetItemText (i, 4+m_nAdd);
  4022. #endif
  4023. if(!m_phone1.IsEmpty ())
  4024. phone=m_phone1+",";
  4025. phone+=m_phone2;phone.TrimRight (",");
  4026. Listarray.ElementAt (pos).Add (name+"/"+phone);
  4027. Listarray.ElementAt (pos).Add (m_List4.GetItemText (i, 5+m_nAdd)+"/"+m_List4.GetItemText (i, 6+m_nAdd));
  4028. Listarray.ElementAt (pos).Add (m_List4.GetItemText (i, 10+nChild+m_nAdd));
  4029. Listarray.ElementAt (pos).Add (m_List4.GetItemText (i, 9+nChild+m_nAdd));
  4030. Listarray.ElementAt (pos).Add (m_List4.GetItemText (i, 11+nChild+m_nAdd));
  4031. pos++;
  4032. }
  4033. Listarray.SetSize(pos, 1);
  4034. g_pMainWnd->PrintTakeForm4(&Listarray);
  4035. }
  4036. void TodayForm::OnBUTtakeaway5()
  4037. {
  4038. CArray<CStringArray, CStringArray>Listarray;
  4039. CString name,m_name1,m_name2;
  4040. CString phone,m_phone1,m_phone2;
  4041. int count=m_List5.GetItemCount ()/45;
  4042. if(m_List5.GetItemCount ()%45)count++;
  4043. Listarray.SetSize(m_List5.GetItemCount ()+count, 1);
  4044. int pos=0;
  4045. int aa=0;
  4046. for(int i=0; i<m_List5.GetItemCount (); i++)
  4047. {
  4048. CString date=m_List5.GetItemText (i, 7+m_nAdd);
  4049. if(!(date.GetLength()==10 && date>=m_date1 && date<=m_date2))continue;
  4050. if(aa%45==0)
  4051. {
  4052. Listarray.ElementAt (pos).Add ("客人/电话");
  4053. Listarray.ElementAt (pos).Add ("婚庆内容");
  4054. Listarray.ElementAt (pos).Add ("日期/时间");
  4055. Listarray.ElementAt (pos).Add ("服务人员");
  4056. Listarray.ElementAt (pos).Add ("服务人员2");
  4057. Listarray.ElementAt (pos).Add ("套系");
  4058. Listarray.ElementAt (pos).Add ("门市");
  4059. pos++;
  4060. }
  4061. aa++;
  4062. name=""; phone="";
  4063. int idpos=i;
  4064. while(m_List5.GetItemText (idpos, 0+m_nAdd)=="")
  4065. idpos--;
  4066. m_name1=m_List5.GetItemText (idpos, 1+m_nAdd);
  4067. m_name2=m_List5.GetItemText (idpos, 2+m_nAdd);
  4068. if(!m_name1.IsEmpty ())
  4069. name=m_name1+",";
  4070. name+=m_name2;
  4071. name.TrimRight (",");
  4072. m_phone1=m_List5.GetItemText (idpos, 3+m_nAdd);
  4073. m_phone2=m_List5.GetItemText (idpos, 4+m_nAdd);
  4074. if(!m_phone1.IsEmpty ())
  4075. phone=m_phone1+",";
  4076. phone+=m_phone2;phone.TrimRight (",");
  4077. Listarray.ElementAt (pos).Add (name+"/"+phone);
  4078. Listarray.ElementAt (pos).Add (m_List5.GetItemText (i, 6+m_nAdd));
  4079. Listarray.ElementAt (pos).Add (m_List5.GetItemText (i, 7+m_nAdd)+"/"+m_List5.GetItemText (i, 8+m_nAdd));
  4080. Listarray.ElementAt (pos).Add (m_List5.GetItemText (i, 9+m_nAdd));
  4081. Listarray.ElementAt (pos).Add (m_List5.GetItemText (i, 10+m_nAdd));
  4082. Listarray.ElementAt (pos).Add (m_List5.GetItemText (idpos, 14+m_nAdd));
  4083. Listarray.ElementAt (pos).Add (m_List5.GetItemText (idpos, 13+m_nAdd));
  4084. pos++;
  4085. }
  4086. Listarray.SetSize(pos, 1);
  4087. g_pMainWnd->PrintTakeForm5(&Listarray);
  4088. }
  4089. void TodayForm::OnDblclkList8(NMHDR* pNMHDR, LRESULT* pResult)
  4090. {
  4091. // TODO: Add your control notification handler code here
  4092. OnBUTchoose();
  4093. *pResult = 0;
  4094. }