TodayForm.cpp 124 KB

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