TodayForm.cpp 118 KB

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