12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202 |
- // TodayForm.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "TodayForm.h"
- #include "MyMdi.H"
- #include "TakeControlDlg1.h"
- #include "TakeControlDlg2.h"
- #include "TakeControlDlg3.h"
- #include "TakeControlDlg4.h"
- #include "TakeControlDlg9.h"
- #include "SelMemberCardFund.h"
- #include "SendMsgDlg.h"
- #include "SearchTake.h"
- #include "SearchTake2.h"
- #include "SearchTake3.h"
- #include "SearchTake4.h"
- #include "SearchTake5.h"
- #include "CalendarConvert.h"
- #include "CalendarEx.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- CTime g_todaytm = CTime::GetCurrentTime();
- int g_todayradio = 0;
- int g_todaycheck = 0;
- void CovertDate2(CString &date)//公历转农历
- {
- try
- {
- GongToLong(date); return;
- if (date == "2013-04-09")
- {
- date = "2013-02-29";
- return;
- }
- CCalendarConvert m_CalendarConvert;
- SYSTEMTIME src = { 0 };
- SYSTEMTIME dst = { 0 };
- COleDateTime m_timeLunar(atoi(date.Mid(0, 4)), atoi(date.Mid(5, 2)), atoi(date.Mid(8, 2)), 0, 0, 0);
- COleDateTime m_timeGregorian;
- m_timeLunar.GetAsSystemTime(src);
- BOOL bEmbolism = 0;
- if (m_CalendarConvert.Gregorian2Lunar(&src, &dst, &bEmbolism))
- {
- m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime(&dst);
- date.Format("%04d-%02d-%02d", m_timeGregorian.GetYear(), m_timeGregorian.GetMonth(), m_timeGregorian.GetDay());
- if (m_timeGregorian.GetYear() == -1)date = "2000-13-32";
- }
- else
- {
- date = "1980-01-01";
- }
- }
- catch (...)
- {
- date = "1980-01-01";
- }
- }
- // 农历转公历;
- void CovertDate3(CString &date)//农历转公历
- {
- LongToGong(date);
- return;
- try
- {
- CCalendarConvert m_CalendarConvert;
- SYSTEMTIME src = { 0 };
- SYSTEMTIME dst = { 0 };
- COleDateTime m_timeLunar(atoi(date.Mid(0, 4)), atoi(date.Mid(5, 2)), atoi(date.Mid(8, 2)), 0, 0, 0);
- COleDateTime m_timeGregorian;
- m_timeLunar.GetAsSystemTime(src);
- BOOL bEmbolism = 0;
- if (m_CalendarConvert.Lunar2Gregorian(&src, bEmbolism, &dst))
- {
- m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime(&dst);
- date.Format("%04d-%02d-%02d", m_timeGregorian.GetYear(), m_timeGregorian.GetMonth(), m_timeGregorian.GetDay());
- if (m_timeGregorian.GetYear() == -1)date = "2000-13-32";
- }
- else
- date = "1980-01-01";
- }
- catch (...)
- {
- date = "1980-01-01";
- }
- /* bEmbolism = 1;
- if ( m_CalendarConvert.Lunar2Gregorian ( &src, bEmbolism, &dst ) )
- {
- m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime ( &dst );
- date.Format ("%04d-%02d-%02d", m_timeGregorian.GetYear (), m_timeGregorian.GetMonth (), m_timeGregorian.GetDay ());
- }*/
- }
- /////////////////////////////////////////////////////////////////////////////
- // TodayForm IDC_RADIO8
- IMPLEMENT_DYNCREATE(TodayForm, MyFormView)
- TodayForm::TodayForm()
- : MyFormView(TodayForm::IDD)
- {
- //{{AFX_DATA_INIT(TodayForm)
- m_check = FALSE;
- m_check2 = FALSE;
- m_radio2 = 0;
- m_nscrollpos = 0;
- //}}AFX_DATA_INIT
- m_mode = 0;
- m_year = g_todaytm.GetYear();
- m_month = g_todaytm.GetMonth();
- m_day = g_todaytm.GetDay();
- m_bInit = 0;
- m_radio = 0;
- m_nAdd = 0;
- if (g_bAllBranch == 0)
- {
- m_radio = g_todayradio;
- if (g_todaycheck == 1)
- m_check = 1;
- else if (g_todaycheck == 2)
- m_check2 = 1;
- }
- else
- {
- m_radio = g_bookingtype;
- m_nAdd = 1;
- }
- m_bShowCalendar = 1;
- m_nAdd2 = 0;
- m_bHospital = FALSE;
- }
- TodayForm::~TodayForm()
- {
- }
- void TodayForm::DoDataExchange(CDataExchange* pDX)
- {
- MyFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(TodayForm)
- DDX_Control(pDX, IDC_COMBO6, m_combo1);
- DDX_Control(pDX, IDC_SCROLLBAR1, m_vScroll);
- DDX_Control(pDX, IDC_LIST10, m_List6);
- DDX_Control(pDX, IDC_LIST8, m_List5);
- DDX_Control(pDX, IDC_LIST7, m_List4);
- DDX_Control(pDX, IDC_LIST4, m_List3);
- DDX_Control(pDX, IDC_LIST3, m_List2);
- DDX_Control(pDX, IDC_LIST2, m_List1);
- DDX_Control(pDX, IDC_SPIN3, m_spinday);
- DDX_Control(pDX, IDC_SPIN2, m_spinmonth);
- DDX_Control(pDX, IDC_SPIN1, m_spinyear);
- DDX_Control(pDX, IDC_STATIC1, m_static1);
- DDX_Text(pDX, IDC_EDITyear, m_year);
- DDV_MinMaxUInt(pDX, m_year, 1900, 3000);
- DDX_Text(pDX, IDC_EDITmonth, m_month);
- DDV_MinMaxUInt(pDX, m_month, 1, 12);
- DDX_Text(pDX, IDC_EDITday, m_day);
- DDV_MinMaxUInt(pDX, m_day, 1, 31);
- DDX_Radio(pDX, IDC_RADIO3, m_radio);
- DDX_Check(pDX, IDC_CHECK1, m_check);
- DDX_Check(pDX, IDC_CHECK2, m_check2);
- DDX_Radio(pDX, IDC_RADIO9, m_radio2);
- DDX_Scroll(pDX, IDC_SCROLLBAR1, m_nscrollpos);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(TodayForm, MyFormView)
- //{{AFX_MSG_MAP(TodayForm)
- ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
- ON_BN_CLICKED(IDC_BUTtake, OnBUTtake)
- ON_BN_CLICKED(IDC_BUTchoose, OnBUTchoose)
- ON_BN_CLICKED(IDC_BUTtakeaway, OnBUTtakeaway)
- ON_BN_CLICKED(IDC_BUTall, OnBUTall)
- ON_BN_CLICKED(IDC_BUTchoose3, OnBUTchoose3)
- ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
- ON_EN_CHANGE(IDC_EDITyear, OnChangeEDITyear)
- ON_EN_CHANGE(IDC_EDITmonth, OnChangeEDITmonth)
- ON_EN_CHANGE(IDC_EDITday, OnChangeEDITday)
- ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
- ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
- ON_BN_CLICKED(IDC_RADIO5, OnRadio5)
- ON_BN_CLICKED(IDC_RADIO6, OnRadio6)
- ON_BN_CLICKED(IDC_CHECK2, OnCheck2)
- ON_BN_CLICKED(IDC_BUTmsg, OnBUTmsg)
- ON_BN_CLICKED(IDC_RADIO7, OnRadio7)
- ON_BN_CLICKED(IDC_BUTtake3, OnBUTtake3)
- ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
- ON_NOTIFY(NM_CLICK, IDC_LIST3, OnClickList3)
- ON_NOTIFY(NM_CLICK, IDC_LIST4, OnClickList4)
- ON_NOTIFY(NM_CLICK, IDC_LIST7, OnClickList7)
- ON_NOTIFY(NM_CLICK, IDC_LIST8, OnClickList8)
- ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2)
- ON_NOTIFY(NM_DBLCLK, IDC_LIST3, OnDblclkList3)
- ON_NOTIFY(NM_DBLCLK, IDC_LIST4, OnDblclkList4)
- ON_NOTIFY(NM_DBLCLK, IDC_LIST7, OnDblclkList7)
- ON_BN_CLICKED(IDC_RADIO8, OnRadio8)
- ON_NOTIFY(NM_CLICK, IDC_LIST10, OnClickList10)
- ON_BN_CLICKED(IDC_RADIO9, OnRadio9)
- ON_BN_CLICKED(IDC_RADIO14, OnRadio14)
- ON_BN_CLICKED(IDC_RADIO15, OnRadio15)
- ON_BN_CLICKED(IDC_RADIO16, OnRadio16)
- ON_BN_CLICKED(IDC_RADIO10, OnRadio10)
- ON_NOTIFY(NM_DBLCLK, IDC_LIST8, OnDblclkList8)
- //}}AFX_MSG_MAP
- ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST7, OnCustomdrawList4)
- ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST4, OnCustomdrawList3)
- ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST2, OnCustomdrawList1)
- ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST3, OnCustomdrawList2)
- ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST8, OnCustomdrawList5)
- ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST10, OnCustomdrawList6)
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // TodayForm diagnostics
- #ifdef _DEBUG
- void TodayForm::AssertValid() const
- {
- MyFormView::AssertValid();
- }
- void TodayForm::Dump(CDumpContext& dc) const
- {
- MyFormView::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // TodayForm message handlers
- void TodayForm::OnInitialUpdate()
- {
- MyFormView::OnInitialUpdate();
- // m_List1.m_bSortSupport =0;
- // m_List5.m_bSortSupport =0;
- m_bHospital = atoi(g_cominfoarray.ElementAt(0).ElementAt(125));
- m_List2.ShowWindow(SW_HIDE);
- m_List3.ShowWindow(SW_HIDE);
- m_List4.ShowWindow(SW_HIDE);
- m_List5.ShowWindow(SW_HIDE);
- m_List6.ShowWindow(SW_HIDE);
- GetDlgItem(IDC_RADIO9)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_RADIO14)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_RADIO15)->ShowWindow(SW_HIDE);
- //#ifdef CHILD_VERSION
- GetDlgItem(IDC_RADIO16)->ShowWindow(SW_HIDE); // 医院跟踪:孕妇预产期;
- //#endif
- if (g_bAllBranch)
- {
- GetDlgItem(IDC_RADIO3)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_RADIO4)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_RADIO5)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_RADIO6)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_RADIO7)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_RADIO8)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_RADIO10)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_BUTall)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_STATIC3)->ShowWindow(SW_HIDE);
- m_bShowCalendar = 0;
- }
- // TODO: Add your specialized code here and/or call the base class
- GetDlgItem(IDC_BUTtake)->EnableWindow(IsHasRights2new(2));
- GetDlgItem(IDC_BUTtake3)->EnableWindow(IsHasRights2new(2));
- GetDlgItem(IDC_BUTchoose)->EnableWindow(IsHasRights2new(2));
- CMyMdi Mdi;
- Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
- // Here we create the outbar control using the splitter as its parent
- // and setting its id to the first pane.
- CRect rc2;
- GetWindowRect(rc2);
- ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);
- EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
- if (g_bAllBranch)
- {
- CRect rc;
- GetDlgItem(IDC_RADIO3)->GetWindowRect(rc2);
- ScreenToClient(rc2);
- GetDlgItem(IDC_STATIC2)->GetWindowRect(rc);
- ScreenToClient(rc);
- rc.top = rc2.top;
- rc.bottom = rc2.bottom;
- GetDlgItem(IDC_STATIC2)->MoveWindow(rc);
- GetDlgItem(IDC_RADIO5)->GetWindowRect(rc2);
- ScreenToClient(rc2);
- rc2.bottom += rc2.Height();
- rc2.top += rc2.Height() / 2;
- GetDlgItem(IDC_CHECK1)->MoveWindow(rc2);
- rc2.left = rc2.right;
- rc2.right = rc2.left + 100;
- GetDlgItem(IDC_CHECK2)->MoveWindow(rc2);
- GetDlgItem(IDC_BUTtake3)->GetWindowRect(rc2);
- ScreenToClient(rc2);
- GetDlgItem(IDC_STATIC3)->GetWindowRect(rc); ScreenToClient(rc);
- rc.right = rc2.left - rc2.Width() / 3;
- GetDlgItem(IDC_STATIC3)->MoveWindow(rc);
- }
- int idarray[] = { IDC_BUTall, IDC_BUTtakeaway, IDC_BUTtake3, IDC_BUTtake, IDC_BUTchoose, IDC_BUTmsg, IDC_BUTclose };
- int idcount = 7;
- int btnwid;
- CRect prerc;
- for (int a = idcount - 2; a >= 0; a--)
- {
- GetDlgItem(idarray[a + 1])->GetWindowRect(prerc);
- ScreenToClient(prerc);
- GetDlgItem(idarray[a])->GetWindowRect(rc2);
- ScreenToClient(rc2);
- btnwid = rc2.Width();
- rc2.right = prerc.left;
- rc2.left = rc2.right - btnwid;
- GetDlgItem(idarray[a])->MoveWindow(rc2);
- }
- m_spinyear.SetRange(1900, 3000);
- m_spinmonth.SetRange(1, 12);
- m_spinday.SetRange(1, 31);
- m_static1.SetFont(&g_titlefont);
- #ifdef CHILD_VERSION
- GetDlgItem(IDC_RADIO14)->SetWindowText("宝宝满月");
- GetDlgItem(IDC_RADIO15)->SetWindowText("宝宝100天");
- #endif
- #ifdef ENTERPRISE_VERSION
- m_nAdd2 = 1;
- if (g_bAllBranch == 0)
- {
- #ifdef CHILD_VERSION
- GetDlgItem(IDC_RADIO7)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_RADIO7)->GetWindowRect(rc2);
- ScreenToClient(rc2);
- GetDlgItem(IDC_RADIO8)->MoveWindow(rc2);
- 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");
- //m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
- //m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120");//;录入时间,120
- m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;录入,100;录入时间,120;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100");
- m_List3.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;看设计日期,100;时间,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100");
- m_List4.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;取件日期,100;时间,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100");
- #else
- 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" );
- //m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
- //m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120
- m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;录入,100;录入时间,120;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100");
- m_List3.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;看设计日期,100;时间,100;婚期,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100" );
- m_List4.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;取件日期,100;时间,100;婚期,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100" );
- m_List5.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚期,100;婚庆内容,100;婚庆日期,100;时间,100;服务人员,100;服务人员2,100;状态,100;备注,100;接单人,100;套系名称,100;套系价格,100" );
- m_List5.LoadColumnInfo (172);m_List5.m_bSortSupport=0;
- #endif
- m_List6.SetHeadings("客人姓名,100;性别,100;日期,100;是否农历,100;客户类别,100;电话,100;天数,200");
- m_List1.LoadColumnInfo(110);
- m_List2.LoadColumnInfo(161);
- m_List3.LoadColumnInfo(162);
- m_List4.LoadColumnInfo(163);
- m_List6.LoadColumnInfo(169);
- }
- else
- {
- #ifdef CHILD_VERSION
- GetDlgItem(IDC_RADIO7)->ShowWindow(SW_HIDE);
- 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");
- //m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
- //m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120
- m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;录入,100;录入时间,120;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100");
- m_List3.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;看设计日期,100;时间,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100");
- m_List4.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;取件日期,100;时间,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100");
- #else
- 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" );
- //m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
- //m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120
- m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;录入,100;录入时间,120;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
- m_List3.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;看设计日期,100;时间,100;婚期,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100" );
- m_List4.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;取件日期,100;时间,100;婚期,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100" );
- m_List5.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚期,100;婚庆内容,100;婚庆日期,100;时间,100;服务人员,100;服务人员2,100;状态,100;备注,100;接单人,100;套系名称,100;套系价格,100" );
- m_List5.LoadColumnInfo (193);m_List5.m_bSortSupport=0;
- #endif
- #ifdef CHILD_VERSION
- m_List6.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100");
- #else
- m_List6.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100" );
- #endif
- m_List1.LoadColumnInfo(188);
- m_List2.LoadColumnInfo(189);
- m_List3.LoadColumnInfo(190);
- m_List4.LoadColumnInfo(191);
- m_List6.LoadColumnInfo(192);
- GetDlgItem(IDC_RADIO8)->ShowWindow(SW_HIDE);
- }
- #else
- if (g_bAllBranch == 0)
- {
- #ifdef CHILD_VERSION
- GetDlgItem(IDC_RADIO7)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_RADIO7)->GetWindowRect(rc2);
- ScreenToClient(rc2);
- GetDlgItem(IDC_RADIO8)->MoveWindow(rc2);
- 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");
- //m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
- //m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120
- m_List2.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;录入,100;录入时间,120;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100");
- m_List3.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;看设计日期,100;时间,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100");
- m_List4.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;取件日期,100;时间,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100");
- #else
- 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");
- //m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
- //m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100" );//;录入时间,120
- m_List2.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;录入,100;录入时间,120;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100");
- m_List3.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;看设计日期,100;时间,100;婚期,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100");
- m_List4.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;取件日期,100;时间,100;婚期,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100");
- m_List5.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚期,100;婚庆内容,100;婚庆日期,100;时间,100;服务人员,100;服务人员2,100;状态,100;备注,100;接单人,100;套系名称,100;套系价格,100");
- m_List5.LoadColumnInfo(172); m_List5.m_bSortSupport = 0;
- #endif
- m_List6.SetHeadings("客人姓名,100;性别,100;日期,100;是否农历,100;客户类别,100;电话,100;天数,200");
- m_List1.LoadColumnInfo(110);
- m_List2.LoadColumnInfo(161);
- m_List3.LoadColumnInfo(162);
- m_List4.LoadColumnInfo(163);
- m_List6.LoadColumnInfo(169);
- }
- else
- {
- #ifdef CHILD_VERSION
- GetDlgItem(IDC_RADIO7)->ShowWindow(SW_HIDE);
- 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");
- // m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
- //m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120
- m_List2.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;选片日期,100;时间,100;录入,100;录入时间,120;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100");
- m_List3.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;看设计日期,100;时间,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100");
- m_List4.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;取件日期,100;时间,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100");
- #else
- 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");
- //m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100" );
- //m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100;录入,100;录入时间,120" );//;录入时间,120
- m_List2.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;选片日期,100;时间,100;录入,100;录入时间,120;婚期,100;状态,100;选片人,100;接单人,100;套系名称,100;套系价格,100");
- m_List3.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;看设计日期,100;时间,100;婚期,100;状态,100;设计,100;看设计人,100;接单人,100;套系名称,100;套系价格,100");
- m_List4.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;取件日期,100;时间,100;婚期,100;状态,100;是否OK,100;取件人,100;接单人,100;套系名称,100;套系价格,100");
- m_List5.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;婚期,100;婚庆内容,100;婚庆日期,100;时间,100;服务人员,100;服务人员2,100;状态,100;备注,100;接单人,100;套系名称,100;套系价格,100");
- m_List5.LoadColumnInfo(193); m_List5.m_bSortSupport = 0;
- #endif
- #ifdef CHILD_VERSION
- m_List6.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100");
- #else
- m_List6.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
- #endif
- m_List1.LoadColumnInfo(188);
- m_List2.LoadColumnInfo(189);
- m_List3.LoadColumnInfo(190);
- m_List4.LoadColumnInfo(191);
- m_List6.LoadColumnInfo(192);
- GetDlgItem(IDC_RADIO8)->ShowWindow(SW_HIDE);
- }
- #endif
- m_bInit = 1;
- if (g_bAllBranch == 0)
- {
- m_List1.ShowWindow(SW_HIDE);
- m_List1.GetWindowRect(rc2);
- ScreenToClient(rc2);
- m_CalendarFrm.m_rect = rc2;
- m_CalendarFrm.Create(rc2, this, 106);
- if (m_radio == 5)
- OnRadio8();
- else
- GetCalendarData();
- }
- else
- DateChange();
- m_List1.GetWindowRect(rc2);
- ScreenToClient(rc2);
- // 其他预约列表;
- m_childdlg.Create(IDD_DLGTodayFormChild, this);
- //rc2.right += 10;
- CRect rc = rc2;
- rc2.top += 30;
- rc2.bottom += 256 * 19 - 30;
- m_childdlg.List1array = &m_List7array;
- m_childdlg.MoveWindow(rc2);
- m_childdlg.ShowWindow(SW_SHOW);
- m_bInit = 1;
- // DateChange();
- rc2.top -= 30;
- rc2.right += 20;
- rc2.left = rc2.right - 20;
- rc2.bottom -= 256 * 19 - 30;
- m_vScroll.MoveWindow(rc2);
- rc.bottom = rc.top + 30;
- rc.right -= 20;
- m_table.Create(rc, this, WS_HSCROLL);
- m_table.m_bFocusFrame = 0;
- m_table.Test2();
- m_page = rc2.Height() - 40;
- m_vScroll.SetScrollRange(0, 256 * 20);
- m_vScroll.SetScrollPos(0);
- m_combo1.m_mode = 1;
- m_combo1.m_pMsgParent = &(m_childdlg.m_table);
- m_childdlg.m_table.m_pComboBox = &m_combo1;
- // m_scrollbar.ShowWindow(SW_SHOW);
- m_table.ShowWindow(SW_HIDE);
- m_childdlg.ShowWindow(SW_HIDE);
- m_vScroll.ShowWindow(SW_HIDE);
- }
- void TodayForm::FillGrid()
- {
- UpdateData();
- int ii = 0;
- if (m_radio == 0) // 0:拍照客人
- {
- m_List1.ShowWindow(SW_SHOW);
- m_List2.ShowWindow(SW_HIDE);
- m_List3.ShowWindow(SW_HIDE);
- m_List4.ShowWindow(SW_HIDE);
- m_List5.ShowWindow(SW_HIDE);
- m_List6.ShowWindow(SW_HIDE);
- m_List1.DeleteAllItems2();
- m_datearray1.RemoveAll();
- m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
- int count = 0;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- #ifdef ENTERPRISE_VERSION
- int nAdd2 = 0;
- #ifndef CHILD_VERSION
- nAdd2=-1;
- #endif
- if (::FindArray(&m_datearray1, m_List1array.ElementAt(ii).ElementAt(9 + m_nAdd + nAdd2)) == -1)
- m_datearray1.Add(m_List1array.ElementAt(ii).ElementAt(9 + m_nAdd + nAdd2));
- #else
- #ifdef CHILD_VERSION
- if (::FindArray(&m_datearray1, m_List1array.ElementAt(ii).ElementAt(10 + m_nAdd + m_nAdd2)) == -1)
- m_datearray1.Add(m_List1array.ElementAt(ii).ElementAt(10 + m_nAdd + m_nAdd2));
- #else
- if (::FindArray(&m_datearray1, m_List1array.ElementAt(ii).ElementAt(9 + m_nAdd + m_nAdd2)) == -1)
- m_datearray1.Add(m_List1array.ElementAt(ii).ElementAt(9 + m_nAdd + m_nAdd2));
- #endif
- #endif
- }
- m_List1.m_arLabels.SetSize(count, 1);
- ii = count;
- m_List1.m_LabelCount = ii;
- m_List1.SetItemCountEx(ii);
- #if JEFF_TEST_ON//2015-05-15
- CStringArray AryOrder;
- AryOrder.SetSize(count);
- AryOrder.RemoveAll();
- for (int m = 0; m < count; m++)
- {
- AryOrder.Add(m_List1.m_arLabels.ElementAt(m).ElementAt(0));
- }
- // 显示的订单数不对,显示成行数,要过滤;
- for (int k = 0; k < AryOrder.GetSize(); k++)
- {
- int nArySize = AryOrder.GetSize();
- for (int n = nArySize - 1; n > 0; n--)
- {
- if (AryOrder.ElementAt(k) == AryOrder.ElementAt(n))
- {
- if (k != n)
- AryOrder.RemoveAt(n);
- }
- }
- }
- ii = AryOrder.GetSize();
- #endif
- }
- else if (m_radio == 1)// 1:选片客人;
- {
- m_List2.ShowWindow(SW_SHOW);
- m_List1.ShowWindow(SW_HIDE);
- m_List3.ShowWindow(SW_HIDE);
- m_List4.ShowWindow(SW_HIDE);
- m_List5.ShowWindow(SW_HIDE);
- m_List6.ShowWindow(SW_HIDE);
- m_List2.DeleteAllItems2();
- m_datearray2.RemoveAll();
- m_List2.m_arLabels.SetSize(m_List2array.GetSize(), 1);
- int count = 0;
- for (ii = 0; ii < m_List2.m_arLabels.GetSize(); ii++)
- {
- m_List2.m_arLabels.ElementAt(count++).Copy(m_List2array.ElementAt(ii));
- if (::FindArray(&m_datearray2, m_List2array.ElementAt(ii).ElementAt(5 + m_nAdd)) == -1)
- m_datearray2.Add(m_List2array.ElementAt(ii).ElementAt(5 + m_nAdd));
- }
- m_List2.m_arLabels.SetSize(count, 1);
- ii = count;
- m_List2.m_LabelCount = ii;
- m_List2.SetItemCountEx(ii);
- }
- else if (m_radio == 2)// 2:看设计客人;
- {
- m_List3.ShowWindow(SW_SHOW);
- m_List2.ShowWindow(SW_HIDE);
- m_List1.ShowWindow(SW_HIDE);
- m_List4.ShowWindow(SW_HIDE);
- m_List5.ShowWindow(SW_HIDE);
- m_List6.ShowWindow(SW_HIDE);
- m_List3.DeleteAllItems2(); m_datearray3.RemoveAll();
- m_List3.m_arLabels.SetSize(m_List3array.GetSize(), 1);
- int count = 0;
- for (ii = 0; ii < m_List3.m_arLabels.GetSize(); ii++)
- {
- m_List3.m_arLabels.ElementAt(count++).Copy(m_List3array.ElementAt(ii));
- if (::FindArray(&m_datearray3, m_List3array.ElementAt(ii).ElementAt(5 + m_nAdd)) == -1)
- m_datearray3.Add(m_List3array.ElementAt(ii).ElementAt(5 + m_nAdd));
- }
- m_List3.m_arLabels.SetSize(count, 1);
- ii = count;
- m_List3.m_LabelCount = ii;
- m_List3.SetItemCountEx(ii);
- }
- else if (m_radio == 3)// 3:取件客人;
- {
- m_List4.ShowWindow(SW_SHOW);
- m_List2.ShowWindow(SW_HIDE);
- m_List3.ShowWindow(SW_HIDE);
- m_List1.ShowWindow(SW_HIDE);
- m_List5.ShowWindow(SW_HIDE);
- m_List6.ShowWindow(SW_HIDE);
- m_List4.DeleteAllItems2(); m_datearray4.RemoveAll();
- m_List4.m_arLabels.SetSize(m_List4array.GetSize(), 1);
- int count = 0;
- for (ii = 0; ii < m_List4.m_arLabels.GetSize(); ii++)
- {
- m_List4.m_arLabels.ElementAt(count++).Copy(m_List4array.ElementAt(ii));
- if (::FindArray(&m_datearray4, m_List4array.ElementAt(ii).ElementAt(5 + m_nAdd)) == -1)
- m_datearray4.Add(m_List4array.ElementAt(ii).ElementAt(5 + m_nAdd));
- }
- m_List4.m_arLabels.SetSize(count, 1);
- ii = count;
- m_List4.m_LabelCount = ii;
- m_List4.SetItemCountEx(ii);
- }
- else if (m_radio == 4)
- {
- m_List5.ShowWindow(SW_SHOW);
- m_List2.ShowWindow(SW_HIDE);
- m_List3.ShowWindow(SW_HIDE);
- m_List4.ShowWindow(SW_HIDE);
- m_List1.ShowWindow(SW_HIDE);
- m_List6.ShowWindow(SW_HIDE);
- m_List5.DeleteAllItems2();
- m_datearray5.RemoveAll();
- m_List5.m_arLabels.SetSize(m_List5array.GetSize(), 1);
- int count = 0;
- int dan = 0;
- for (ii = 0; ii < m_List5.m_arLabels.GetSize(); ii++)
- {
- m_List5.m_arLabels.ElementAt(count++).Copy(m_List5array.ElementAt(ii));
- if (::FindArray(&m_datearray5, m_List5array.ElementAt(ii).ElementAt(7 + m_nAdd)) == -1)
- m_datearray5.Add(m_List5array.ElementAt(ii).ElementAt(7 + m_nAdd));
- CString date = m_List5array.ElementAt(ii).ElementAt(7 + m_nAdd);
- if (date.GetLength() == 10 && date >= m_date1 && date <= m_date2)dan++;
- }
- m_List5.m_arLabels.SetSize(count, 1);
- ii = count;
- m_List5.m_LabelCount = ii;
- m_List5.SetItemCountEx(ii);
- CString str;
- str.Format("单数:%d", dan);
- SetDlgItemText(IDC_STATIC2, str);
- return;
- }
- else if (m_radio == 5)// 5:近期生日;
- {
- m_List6.ShowWindow(SW_SHOW);
- m_List2.ShowWindow(SW_HIDE);
- m_List3.ShowWindow(SW_HIDE);
- m_List4.ShowWindow(SW_HIDE);
- m_List1.ShowWindow(SW_HIDE);
- m_List5.ShowWindow(SW_HIDE);
- m_List6.DeleteAllItems2(); m_datearray6.RemoveAll();
- m_List6.m_arLabels.SetSize(m_List6array.GetSize(), 1);
- int count = 0;
- for (ii = 0; ii < m_List6.m_arLabels.GetSize(); ii++)
- {
- m_List6.m_arLabels.ElementAt(count++).Copy(m_List6array.ElementAt(ii));
- // if(::FindArray (&m_datearray6, m_List6array.ElementAt (ii).ElementAt (9+m_nAdd) )==-1)
- // m_datearray6.Add (m_List6array.ElementAt (ii).ElementAt (9+m_nAdd));
- }
- m_List6.m_arLabels.SetSize(count, 1);
- ii = count;
- m_List6.m_LabelCount = ii;
- m_List6.SetItemCountEx(ii);
- }
- CString str;
- str.Format("单数:%d", ii);
- SetDlgItemText(IDC_STATIC2, str);
- }
- void TodayForm::OnBUTclose() //wenbin mark
- {
- GetParent()->SendMessage(WM_CLOSE);
- }
- void TodayForm::OnBUTchoose3() //看设计
- {
- m_mode = 3;
- FillGrid();
- }
- int __cdecl CompareByLabel3(const void *elem1, const void *elem2)
- {
- CStringArray *p1 = (CStringArray*)elem1;
- CStringArray *p2 = (CStringArray*)elem2;
- #ifdef CHILD_VERSION
- return lstrcmp(p1->ElementAt(10), p2->ElementAt(10));
- #else
- return lstrcmp(p1->ElementAt(9), p2->ElementAt(9));
- #endif
- }
- int __cdecl CompareByLabel5(const void *elem1, const void *elem2)
- {
- CStringArray *p1 = (CStringArray*)elem1;
- CStringArray *p2 = (CStringArray*)elem2;
- int nAdd = 0;
- if (g_bAllBranch)nAdd = 1;
- int nAdd2 = 0;
- #ifndef CHILD_VERSION
- nAdd2 = -1;
- #endif
- if (p1->ElementAt(9 + nAdd + nAdd2) == p2->ElementAt(9 + nAdd + nAdd2) && p1->ElementAt(11 + nAdd + nAdd2) == p2->ElementAt(11 + nAdd + nAdd2))
- {
- return lstrcmp(p1->ElementAt(12 + nAdd + nAdd2), p2->ElementAt(12 + nAdd + nAdd2));
- }
- if (p1->ElementAt(9 + nAdd + nAdd2) == p2->ElementAt(9 + nAdd + nAdd2))
- {
- return lstrcmp(p1->ElementAt(11 + nAdd + nAdd2), p2->ElementAt(11 + nAdd + nAdd2));
- }
- return lstrcmp(p1->ElementAt(9 + nAdd + nAdd2), p2->ElementAt(9 + nAdd + nAdd2));
- return 1;
- }
- int __cdecl CompareByLabel7(const void *elem1, const void *elem2)
- {
- CStringArray *p1 = (CStringArray*)elem1;
- CStringArray *p2 = (CStringArray*)elem2;
- int nAdd = 0;
- if (g_bAllBranch)nAdd = 1;
- int nAdd2 = 0;
- #ifndef CHILD_VERSION
- nAdd2 = -1;
- #endif
- if (p1->ElementAt(9 + nAdd + nAdd2) == p2->ElementAt(9 + nAdd + nAdd2))
- {
- return lstrcmp(p1->ElementAt(11 + nAdd + nAdd2), p2->ElementAt(11 + nAdd + nAdd2));
- }
- return lstrcmp(p1->ElementAt(9 + nAdd + nAdd2), p2->ElementAt(9 + nAdd + nAdd2));
- return 1;
- }
- int __cdecl CompareByLabel8(const void *elem1, const void *elem2)
- {
- CStringArray *p1 = (CStringArray*)elem1;
- CStringArray *p2 = (CStringArray*)elem2;
- int nAdd2 = 0;
- #ifndef CHILD_VERSION
- nAdd2 = -1;
- #endif
- int nAdd = 0;
- if (g_bAllBranch)nAdd = 1;
- return lstrcmp(p1->ElementAt(9 + nAdd + nAdd2), p2->ElementAt(9 + nAdd + nAdd2));
- }
- void TodayForm::DateChange()//connect with server;
- {
- if (m_bInit == 0)return;
- if (m_bShowCalendar&&m_radio != 6)
- {
- return;
- }
- m_spinyear.EnableWindow(0);
- m_spinmonth.EnableWindow(0);
- m_spinday.EnableWindow(0);
- UpdateData();
- if (m_radio == 5)
- {// 看设计客人;
- GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0);
- GetDlgItem(IDC_BUTall)->ShowWindow(0);
- GetDlgItem(IDC_BUTtake3)->ShowWindow(0);
- GetDlgItem(IDC_BUTtake)->ShowWindow(0);
- GetDlgItem(IDC_BUTchoose)->ShowWindow(0);
- GetDlgItem(IDC_RADIO9)->ShowWindow(1);
- GetDlgItem(IDC_RADIO14)->ShowWindow(1);
- GetDlgItem(IDC_RADIO15)->ShowWindow(1);
- #ifdef CHILD_VERSION
- if ( m_bHospital )
- GetDlgItem(IDC_RADIO16)->ShowWindow(1);
- #endif
- }
- else if (m_radio == 6)
- {// 取件客人;
- m_childdlg.m_table.ModeChange(10);
- m_table.ModeChange(10);
- m_table.Test2();
- m_table.ShowWindow(SW_SHOW);
- m_childdlg.ShowWindow(SW_SHOW);
- m_vScroll.ShowWindow(SW_SHOW);
- GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0);
- GetDlgItem(IDC_BUTall)->ShowWindow(0);
- GetDlgItem(IDC_BUTtake3)->ShowWindow(0);
- GetDlgItem(IDC_BUTtake)->ShowWindow(1);
- GetDlgItem(IDC_BUTchoose)->ShowWindow(1);
- GetDlgItem(IDC_BUTtake)->SetWindowText("另约日期");
- GetDlgItem(IDC_BUTchoose)->SetWindowText("取消预约");
- GetDlgItem(IDC_RADIO9)->ShowWindow(0);
- GetDlgItem(IDC_RADIO14)->ShowWindow(0);
- GetDlgItem(IDC_RADIO15)->ShowWindow(0);
- #ifdef CHILD_VERSION
- GetDlgItem(IDC_RADIO16)->ShowWindow(0);
- #endif
- }
- else
- {
- GetDlgItem(IDC_BUTtakeaway)->ShowWindow(1);
- if (!g_bAllBranch)GetDlgItem(IDC_BUTall)->ShowWindow(1);
- GetDlgItem(IDC_BUTtake3)->ShowWindow(1);
- GetDlgItem(IDC_BUTtake)->ShowWindow(1);
- GetDlgItem(IDC_BUTchoose)->ShowWindow(1);
- GetDlgItem(IDC_BUTtake)->SetWindowText("客人预约");
- GetDlgItem(IDC_BUTchoose)->SetWindowText("重新安排");
- GetDlgItem(IDC_RADIO9)->ShowWindow(0);
- GetDlgItem(IDC_RADIO14)->ShowWindow(0);
- GetDlgItem(IDC_RADIO15)->ShowWindow(0);
- #ifdef CHILD_VERSION
- GetDlgItem(IDC_RADIO16)->ShowWindow(0);
- #endif
- }
- if (0)//m_radio==5)
- {
- GetDlgItem(IDC_CHECK1)->SetWindowText("近半个月");
- GetDlgItem(IDC_CHECK2)->SetWindowText("近一个月");
- }
- else
- {
- GetDlgItem(IDC_CHECK1)->SetWindowText("近一个星期");
- GetDlgItem(IDC_CHECK2)->SetWindowText("近半个月");
- }
- if (m_radio == 0 || m_radio == 1 || m_radio == 2 || m_radio == 3 || m_radio == 4)
- GetDlgItem(IDC_BUTtakeaway)->ShowWindow(1);
- else
- GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0);
- if (m_radio == 0)
- GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未拍");
- if (m_radio == 1)
- GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未选");
- if (m_radio == 2)
- GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未看");
- if (m_radio == 3)
- GetDlgItem(IDC_BUTtake3)->SetWindowText("统计未取");
- if (m_radio == 4)
- GetDlgItem(IDC_BUTtake3)->SetWindowText("统计婚庆");
- g_todayradio = m_radio;
- g_todaycheck = 0;
- CTime tm = CTime(m_year, m_month, m_day, 0, 0, 0);
- g_todaytm = tm;
- CString strdate, strdate2;
- strdate.Format("%04d-%02d-%02d", m_year, m_month, m_day);
- if (m_check)
- {
- CTime tm = CTime(m_year, m_month, m_day, 0, 0, 0);
- if (m_radio == 5)
- tm += CTimeSpan(15, 0, 0, 0);
- else
- tm += CTimeSpan(7, 0, 0, 0);
- strdate2 = tm.Format("%Y-%m-%d");
- g_todaycheck = 1;
- }
- else if (m_check2)
- {
- CTime tm = CTime(m_year, m_month, m_day, 0, 0, 0);
- if (m_radio == 5)
- tm += CTimeSpan(31, 0, 0, 0);
- else
- tm += CTimeSpan(15, 0, 0, 0);
- strdate2 = tm.Format("%Y-%m-%d");
- g_todaycheck = 2;
- }
- else
- strdate2 = strdate;
- COleDateTime dtDay(m_year, m_month, m_day, 0, 0, 0);
- int nDayWeek = dtDay.GetDayOfWeek() - 1; //得到星期几,1=Sunday, 2=Monday,
- CString DayOfWeek[7] = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
- CString sdate;
- if (nDayWeek >= 0 && nDayWeek <= 6)
- sdate = DayOfWeek[nDayWeek];
- else
- sdate = "无效日期";
- m_static1.SetWindowText(strdate + "(" + sdate + ")小秘书");
- m_date1 = strdate;
- m_date2 = strdate2;
- if (m_radio == 0) // 拍照客人;
- {
- GetData1(strdate, strdate2);
- }
- else if (m_radio == 1) // 选片客人;
- {
- GetData2(strdate, strdate2);
- }
- else if (m_radio == 2) // 看设计客人;
- {
- GetData3(strdate, strdate2);
- }
- else if (m_radio == 3) // 取件客人;
- {
- GetData4(strdate, strdate2);
- }
- else if (m_radio == 4) // 婚期;
- {
- GetData5(strdate, strdate2);
- }
- else if (m_radio == 6) // 其他预约;
- {
- m_List7array.RemoveAll();
- g_sendhead.code[0] = 221;
- g_sendhead.tabcount = 1;
- g_sendhead.bsql = 0;
- CString sql;
- sql.Format("date>='" + strdate + "' and date<='" + strdate2 + "' and mode='10'");
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)
- {
- m_childdlg.ShowTable();
- return;
- }
- DataToArray(&m_List7array);
- m_childdlg.ShowTable();
- #if 0
- int temp = m_nscrollpos;
- int nscrollpos = m_vScroll.GetScrollPos();
- m_nscrollpos = 0;
- m_vScroll.SetScrollPos(m_nscrollpos);
- m_childdlg.ScrollWindow(0, temp - m_nscrollpos);
- #else
- m_vScroll.ShowWindow(SW_HIDE);
- #endif
-
- }
- else if (m_radio == 5) // 近期生日;
- {
- m_List6array.RemoveAll();
- CString today = _T("");
- CString todaynl = _T("");
- today.Format(_T("%04d-%02d-%02d"),CTime::GetCurrentTime().GetYear(),m_month,m_day);
- todaynl.Format(_T("%04d-%02d-%02d"),CTime::GetCurrentTime().GetYear(),m_month,m_day);
- CovertDate2(todaynl);
- CTime todaytm = GetTmFromStr(today);
-
- CString name, sex, phone, birthday, clienttype, days, birthdaybak;
- BOOL checknl;
- int ndays = 0;
- int checkdays = 30;
- if (m_check)
- checkdays = 7;
- if (m_check2)
- checkdays = 15;
- #ifdef CHILD_VERSION
- g_sendhead.code[0] = 94;
- #else
- g_sendhead.code[0] = 64;
- #endif
- g_sendhead.code[1] = 138;
- g_sendhead.code[2] = 90;
- #if JEFF_TEST_ON
- g_sendhead.code[3] = 130; // 蓝钻会员;
- g_sendhead.code[4] = 68; // 现金子卡会员;
- #endif
- g_sendhead.tabcount = 5;
- #ifdef CHILD_VERSION
- // 儿童版医院跟踪系统;
- if ( m_bHospital )
- {
- g_sendhead.code[5] = 206;
- g_sendhead.tabcount = 6;
- }
- #endif
-
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- if (g_bSendOK == 0)
- return;
- CArray<CStringArray, CStringArray>List1array;
- CArray<CStringArray, CStringArray>List2array;
- CArray<CStringArray, CStringArray>List3array;
- CArray<CStringArray, CStringArray>List4array;
- CArray<CStringArray, CStringArray>List5array;
- CArray<CStringArray, CStringArray>List6array; // 儿童版医院跟踪系统;
- #ifdef CHILD_VERSION
- if ( m_bHospital )
- DataToArray(&List1array, &List2array, &List3array, &List4array, &List5array, &List6array);
- else
- DataToArray(&List1array, &List2array, &List3array, &List4array, &List5array);
- #else
- DataToArray(&List1array, &List2array, &List3array, &List4array, &List5array);
- #endif
-
- clienttype = _T("订单客户");
- int size = 0;
- int nMemorialYear = 0; // 周年;
- #ifdef CHILD_VERSION
- DealChildBrithday(checkdays, size, _T("订单客户"), todaytm, List1array);
- DealChildBrithday(checkdays, size, _T("老客户"), todaytm, List2array);
- DealChildBrithday(checkdays, size, _T("意向客户"), todaytm, List3array);
- DealChildBrithday(checkdays, size, _T("蓝钻客户"), todaytm, List4array);
- DealChildBrithday(checkdays, size, _T("会员客户"), todaytm, List5array);
- if ( m_bHospital )
- DealChildBrithday(checkdays, size, _T("医院客户"), todaytm, List6array);
- #else//以下为婚纱版
- DealWeddingBrithday(checkdays, size, _T("订单客户"), todaytm, List1array);
- DealWeddingBrithday(checkdays, size, _T("老客户"), todaytm, List2array);
- DealWeddingBrithday(checkdays, size, _T("意向客户"), todaytm, List3array);
- DealWeddingBrithday(checkdays, size, _T("蓝钻客户"), todaytm, List4array);
- DealWeddingBrithday(checkdays, size, _T("会员客户"), todaytm, List5array);
- #endif
- }
- HidePrice();
- FillGrid();
- m_spinyear.EnableWindow(1);
- m_spinmonth.EnableWindow(1);
- m_spinday.EnableWindow(1);
- }
- void TodayForm::OnCheck1()
- {
- UpdateData();
- m_check2 = 0;
- UpdateData(false);
- DateChange();
- }
- void TodayForm::OnCheck2()
- {
- UpdateData();
- m_check = 0;
- UpdateData(false);
- DateChange();
- }
- void TodayForm::OnChangeEDITyear()
- {
- DateChange();
- GetCalendarData();
- }
- void TodayForm::OnChangeEDITmonth()
- {
- DateChange();
- GetCalendarData();
- }
- void TodayForm::OnChangeEDITday()
- {
- DateChange();
- if (m_bInit == 0)return;
- if (m_bShowCalendar == 0)return;
- UpdateData();
- m_CalendarFrm.DateChange2(m_year, m_month, m_day);
- m_CalendarFrm.m_oCalendar.Invalidate();
- // TODO: Add your control notification handler code her
- }
- void TodayForm::OnRadio3() //拍照客人;
- {
- // TODO: Add your control notification handler code here
- OnRadio8();
- }
- void TodayForm::OnRadio4()
- {
- // TODO: Add your control notification handler code here
- OnRadio8();
- }
- void TodayForm::OnRadio5()
- {
- // TODO: Add your control notification handler code here
- OnRadio8();
- }
- void TodayForm::OnRadio6()
- {
- // TODO: Add your control notification handler code here
- OnRadio8();
- }
- void TodayForm::OnRadio7()
- {
- // TODO: Add your control notification handler code here
- OnRadio8();
- }
- void TodayForm::OnRadio8()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- if (m_radio == 6)
- {
- m_List1.ShowWindow(SW_HIDE);
- m_List2.ShowWindow(SW_HIDE);
- m_List3.ShowWindow(SW_HIDE);
- m_List4.ShowWindow(SW_HIDE);
- m_List5.ShowWindow(SW_HIDE);
- m_List6.ShowWindow(SW_HIDE);
- m_CalendarFrm.ShowWindow(SW_HIDE);
- m_table.ShowWindow(SW_SHOW);
- m_childdlg.ShowWindow(SW_SHOW);
- m_vScroll.ShowWindow(SW_SHOW);
- DateChange();
- return;
- }
- m_table.ShowWindow(SW_HIDE);
- m_childdlg.ShowWindow(SW_HIDE);
- m_vScroll.ShowWindow(SW_HIDE);
- if (m_bShowCalendar)
- {
- m_List1.ShowWindow(SW_HIDE);
- m_List2.ShowWindow(SW_HIDE);
- m_List3.ShowWindow(SW_HIDE);
- m_List4.ShowWindow(SW_HIDE);
- m_List5.ShowWindow(SW_HIDE);
- m_List6.ShowWindow(SW_HIDE);
- m_CalendarFrm.ShowWindow(SW_SHOW);
- if (m_radio == 5)
- {
- GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0);
- GetDlgItem(IDC_BUTall)->ShowWindow(0);
- GetDlgItem(IDC_BUTtake3)->ShowWindow(0);
- GetDlgItem(IDC_BUTtake)->ShowWindow(0);
- GetDlgItem(IDC_BUTchoose)->ShowWindow(0);
- GetDlgItem(IDC_RADIO9)->ShowWindow(1);
- GetDlgItem(IDC_RADIO14)->ShowWindow(1);
- GetDlgItem(IDC_RADIO15)->ShowWindow(1);
- #ifdef CHILD_VERSION
- if ( m_bHospital )
- GetDlgItem(IDC_RADIO16)->ShowWindow(1);
- #endif
- }
- else if (m_radio == 6)
- {
- m_childdlg.m_table.ModeChange(10);
- m_table.ModeChange(10);
- m_table.Test2();
- m_table.ShowWindow(SW_SHOW);
- m_childdlg.ShowWindow(SW_SHOW);
- m_vScroll.ShowWindow(SW_SHOW);
- GetDlgItem(IDC_BUTtakeaway)->ShowWindow(0);
- GetDlgItem(IDC_BUTall)->ShowWindow(0);
- GetDlgItem(IDC_BUTtake3)->ShowWindow(0);
- GetDlgItem(IDC_BUTtake)->ShowWindow(1);
- GetDlgItem(IDC_BUTchoose)->ShowWindow(1);
- GetDlgItem(IDC_BUTtake)->SetWindowText("另约日期");
- GetDlgItem(IDC_BUTchoose)->SetWindowText("取消预约");
- GetDlgItem(IDC_RADIO9)->ShowWindow(0);
- GetDlgItem(IDC_RADIO14)->ShowWindow(0);
- GetDlgItem(IDC_RADIO15)->ShowWindow(0);
- #ifdef CHILD_VERSION
- GetDlgItem(IDC_RADIO16)->ShowWindow(0);
- #endif
- }
- else
- {
- GetDlgItem(IDC_BUTtakeaway)->ShowWindow(1);
- if (!g_bAllBranch)GetDlgItem(IDC_BUTall)->ShowWindow(1);
- GetDlgItem(IDC_BUTtake3)->ShowWindow(1);
- GetDlgItem(IDC_BUTtake)->ShowWindow(1);
- GetDlgItem(IDC_BUTchoose)->ShowWindow(1);
- GetDlgItem(IDC_BUTtake)->SetWindowText("客人预约");
- GetDlgItem(IDC_BUTchoose)->SetWindowText("重新安排");
- GetDlgItem(IDC_RADIO9)->ShowWindow(0);
- GetDlgItem(IDC_RADIO14)->ShowWindow(0);
- GetDlgItem(IDC_RADIO15)->ShowWindow(0);
- #ifdef CHILD_VERSION
- GetDlgItem(IDC_RADIO16)->ShowWindow(0);
- #endif
- }
- }
- else
- {
- m_CalendarFrm.ShowWindow(SW_HIDE);
- }
- DateChange();
- }
- void TodayForm::OnBUTtake() // 客人预约按钮;
- {
- // TODO: Add your control notification handler code here
- if (IsHasRights2new(2) == 0)return;
- UpdateData();
- if (m_radio == 6)
- {
- m_childdlg.OtherDate();
- return;
- }
- if (m_radio == 0) // 拍照客人预约;
- {
- TakeControlDlg1 dlg;
- dlg.DoModal();
- if (g_bAllBranch)
- {
- if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
- }
- DateChange();
- GetCalendarData();
- }
- else if (m_radio == 1) // 选片客人预约;
- {
- TakeControlDlg2 dlg;
- dlg.DoModal();
- if (g_bAllBranch)
- {
- if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
- }
- DateChange();
- GetCalendarData();
- }
- else if (m_radio == 2) // 看设计客人预约;
- {
- TakeControlDlg3 dlg;
- dlg.DoModal();
- if (g_bAllBranch)
- {
- if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
- }
- DateChange(); GetCalendarData();
- }
- else if (m_radio == 3) // 取件客人预约;
- {
- TakeControlDlg4 dlg;
- dlg.DoModal();
- if (g_bAllBranch)
- {
- if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
- }
- DateChange(); GetCalendarData();
- }
- else if (m_radio == 4)
- {
- TakeControlDlg9 dlg;
- dlg.DoModal();
- if (g_bAllBranch)
- {
- if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
- }
- DateChange(); GetCalendarData();
- }
- }
- void TodayForm::OnBUTchoose() //重新安排;
- {
- // TODO: Add your control notification handler code here
- if (IsHasRights2new(2) == 0)return;
- UpdateData();
- if (m_radio == 6)
- {
- m_childdlg.DeleteCur();
- return;
- }
- if (m_radio == 0)
- {
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_List1.GetNextSelectedItem(pos);
- CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- TakeControlDlg1 dlg;
- if (g_bAllBranch)
- dlg.m_branch = m_List1.GetItemText(iItem, 0);
- dlg.id = id;
- dlg.m_bModify = 1;
- dlg.DoModal();
- if (g_bAllBranch)
- {
- if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
- }
- DateChange(); GetCalendarData();
- }
- else if (m_radio == 1)
- {
- POSITION pos;
- pos = m_List2.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_List2.GetNextSelectedItem(pos);
- CString id = m_List2.GetItemText(iItem, 0 + m_nAdd);
- TakeControlDlg2 dlg;
- if (g_bAllBranch)
- dlg.m_branch = m_List2.GetItemText(iItem, 0);
- dlg.id = id;
- dlg.m_bModify = 1;
- dlg.DoModal();
- if (g_bAllBranch)
- {
- if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
- }
- DateChange(); GetCalendarData();
- }
- else if (m_radio == 2)
- {
- POSITION pos;
- pos = m_List3.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_List3.GetNextSelectedItem(pos);
- CString id = m_List3.GetItemText(iItem, 0 + m_nAdd);
- TakeControlDlg3 dlg;
- if (g_bAllBranch)
- dlg.m_branch = m_List3.GetItemText(iItem, 0);
- dlg.id = id;
- dlg.m_bModify = 1;
- dlg.DoModal();
- if (g_bAllBranch)
- {
- if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
- }
- DateChange(); GetCalendarData();
- }
- else if (m_radio == 3)
- {
- POSITION pos;
- pos = m_List4.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_List4.GetNextSelectedItem(pos);
- CString id = m_List4.GetItemText(iItem, 0 + m_nAdd);
- TakeControlDlg4 dlg;
- if (g_bAllBranch)
- dlg.m_branch = m_List4.GetItemText(iItem, 0);
- dlg.id = id;
- dlg.m_bModify = 1;
- dlg.DoModal();
- if (g_bAllBranch)
- {
- if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
- }
- DateChange(); GetCalendarData();
- }
- else if (m_radio == 4)
- {
- POSITION pos;
- pos = m_List5.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_List5.GetNextSelectedItem(pos);
- CString id = m_List5.GetItemText(iItem, 0 + m_nAdd);
- while (id == "")
- {
- iItem--;
- id = m_List5.GetItemText(iItem, 0 + m_nAdd);
- }
- TakeControlDlg9 dlg;
- if (g_bAllBranch)
- dlg.m_branch = m_List5.GetItemText(iItem, 0);
- dlg.id = id;
- dlg.m_bModify = 1;
- dlg.DoModal();
- if (g_bAllBranch)
- {
- if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
- }
- DateChange(); GetCalendarData();
- }
- }
- void TodayForm::OnCustomdrawList4(NMHDR* pNMHDR, LRESULT* pResult)
- {
- NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
- // Take the default processing unless we set this to something else below.
- *pResult = 0;
- // First thing - check the draw stage. If it's the control's prepaint
- // stage, then tell Windows we want messages for every item.
- if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
- {
- *pResult = CDRF_NOTIFYITEMDRAW;
- }
- else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
- {
- // This is the prepaint stage for an item. Here's where we set the
- // item's text color. Our return value will tell Windows to draw the
- // item itself, but it will use the new color we set here.
- // We'll cycle the colors through red, green, and light blue.
- #ifdef CHILD_VERSION
- if (m_List4.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8 + m_nAdd) != "OK")
- #else
- if (m_List4.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9 + m_nAdd) != "OK")
- #endif
- pLVCD->clrText = RGB(220, 0, 0);
- else
- pLVCD->clrText = RGB(20, 133, 20);
- if (pLVCD->nmcd.dwItemSpec % 2)
- pLVCD->clrTextBk = g_gridcol1;
- else
- pLVCD->clrTextBk = g_gridcol2;
- // Store the color back in the NMLVCUSTOMDRAW struct.
- // Tell Windows to paint the control itself.
- *pResult = CDRF_DODEFAULT;
- }
- }
- void TodayForm::OnCustomdrawList3(NMHDR* pNMHDR, LRESULT* pResult)
- {
- NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
- // Take the default processing unless we set this to something else below.
- *pResult = 0;
- // First thing - check the draw stage. If it's the control's prepaint
- // stage, then tell Windows we want messages for every item.
- if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
- {
- *pResult = CDRF_NOTIFYITEMDRAW;
- }
- else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
- {
- // This is the prepaint stage for an item. Here's where we set the
- // item's text color. Our return value will tell Windows to draw the
- // item itself, but it will use the new color we set here.
- // We'll cycle the colors through red, green, and light blue.
- #ifdef CHILD_VERSION
- 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")
- #else
- 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")
- #endif
- {
- pLVCD->clrText = RGB(220, 0, 0);
- }
- else
- {
- pLVCD->clrText = RGB(20, 133, 20);
- }
- if (pLVCD->nmcd.dwItemSpec % 2)
- pLVCD->clrTextBk = g_gridcol1;
- else
- pLVCD->clrTextBk = g_gridcol2;
- // Store the color back in the NMLVCUSTOMDRAW struct.
- // Tell Windows to paint the control itself.
- *pResult = CDRF_DODEFAULT;
- }
- }
- void TodayForm::OnBUTmsg() //短信;
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- POSITION pos;
- CStringArray array; CString name;
- if (m_radio == 0)
- {
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
- return;
- }
- int iItem;
- while (pos)
- {
- iItem = m_List1.GetNextSelectedItem(pos);
- #ifdef CHILD_VERSION
- array.Add(m_List1.GetItemText(iItem, 5 + m_nAdd));
- array.Add(m_List1.GetItemText(iItem, 6 + m_nAdd));
- #else
- array.Add(m_List1.GetItemText(iItem, 3 + m_nAdd));
- array.Add(m_List1.GetItemText(iItem, 4 + m_nAdd));
- #endif
- }
- }
- else if (m_radio == 1)
- {
- pos = m_List2.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
- return;
- }
- int iItem;
- while (pos)
- {
- iItem = m_List2.GetNextSelectedItem(pos);
- array.Add(m_List2.GetItemText(iItem, 3 + m_nAdd));
- array.Add(m_List2.GetItemText(iItem, 4 + m_nAdd));
- }
- }
- else if (m_radio == 2)
- {
- pos = m_List3.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
- return;
- }
- int iItem;
- while (pos)
- {
- iItem = m_List3.GetNextSelectedItem(pos);
- array.Add(m_List3.GetItemText(iItem, 3 + m_nAdd));
- array.Add(m_List3.GetItemText(iItem, 4 + m_nAdd));
- }
- }
- else if (m_radio == 3)
- {
- pos = m_List4.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
- return;
- }
- int iItem;
- while (pos)
- {
- iItem = m_List4.GetNextSelectedItem(pos);
- array.Add(m_List4.GetItemText(iItem, 3 + m_nAdd));
- array.Add(m_List4.GetItemText(iItem, 4 + m_nAdd));
- }
- }
- else if (m_radio == 4)
- {
- pos = m_List5.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
- return;
- }
- int iItem;
- while (pos)
- {
- iItem = m_List5.GetNextSelectedItem(pos);
- array.Add(m_List5.GetItemText(iItem, 3 + m_nAdd));
- array.Add(m_List5.GetItemText(iItem, 4 + m_nAdd));
- }
- }
- else if (m_radio == 5)
- {
- pos = m_List6.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要发送短信的客人!", MB_ICONINFORMATION);
- return;
- }
- int iItem;
- while (pos)
- {
- iItem = m_List6.GetNextSelectedItem(pos);
- array.Add(m_List6.GetItemText(iItem, 5));
- }
- }
- else if (m_radio == 6)
- {
- array.Add(m_childdlg.GetCurPhone(name));
- }
- SendMsgDlg dlg;
- if (m_radio == 5)
- dlg.m_mode = 1;
- dlg.m_pArray = &array;
- if (name != "")
- dlg.m_strSendSms = name + "您好,";
- dlg.DoModal();
- }
- void TodayForm::OnBUTtake3() //统计未拍;
- {
- // TODO: Add your control notification handler code here
- if (IsHasRights2new(2) == 0)return;
- if (m_radio == 0)
- {
- SearchTake dlg;
- dlg.DoModal();
- }
- else if (m_radio == 1)
- {
- SearchTake2 dlg;
- dlg.DoModal();
- }
- else if (m_radio == 2)
- {
- SearchTake3 dlg;
- dlg.DoModal();
- }
- else if (m_radio == 3)
- {
- SearchTake4 dlg;
- dlg.DoModal();
- }
- else if (m_radio == 4)
- {
- SearchTake5 dlg;
- dlg.DoModal();
- }
- if (g_bAllBranch)
- {
- if (AfxMessageBox("是否实时更新数据?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
- }
- DateChange();
- GetCalendarData();
- }
- void TodayForm::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)return;
- int iItem = m_List1.GetNextSelectedItem(pos);
- g_id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- *pResult = 0;
- }
- void TodayForm::OnClickList3(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos = m_List2.GetFirstSelectedItemPosition();
- if (pos == NULL)return;
- int iItem = m_List2.GetNextSelectedItem(pos);
- g_id = m_List2.GetItemText(iItem, 0 + m_nAdd);
- *pResult = 0;
- }
- void TodayForm::OnClickList4(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos = m_List3.GetFirstSelectedItemPosition();
- if (pos == NULL)return;
- int iItem = m_List3.GetNextSelectedItem(pos);
- g_id = m_List3.GetItemText(iItem, 0 + m_nAdd);
- *pResult = 0;
- }
- void TodayForm::OnClickList7(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos = m_List4.GetFirstSelectedItemPosition();
- if (pos == NULL)return;
- int iItem = m_List4.GetNextSelectedItem(pos);
- g_id = m_List4.GetItemText(iItem, 0 + m_nAdd);
- *pResult = 0;
- }
- void TodayForm::OnClickList8(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos = m_List5.GetFirstSelectedItemPosition();
- if (pos == NULL)return;
- int iItem = m_List5.GetNextSelectedItem(pos);
- g_id = m_List5.GetItemText(iItem, 0 + m_nAdd);
- *pResult = 0;
- }
- void TodayForm::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- OnBUTchoose();
- *pResult = 0;
- }
- void TodayForm::OnDblclkList3(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- OnBUTchoose();
- *pResult = 0;
- }
- void TodayForm::OnDblclkList4(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- OnBUTchoose();
- *pResult = 0;
- }
- void TodayForm::OnDblclkList7(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- // if(IsHasRights2new(3)==0)return;
- OnBUTchoose();
- // g_pMainWnd->OnOutbarNotify("发片/取件");
- *pResult = 0;
- }
- void TodayForm::OnCustomdrawList1(NMHDR* pNMHDR, LRESULT* pResult)
- {
- NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
- // Take the default processing unless we set this to something else below.
- *pResult = 0;
- // First thing - check the draw stage. If it's the control's prepaint
- // stage, then tell Windows we want messages for every item.
- if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
- {
- *pResult = CDRF_NOTIFYITEMDRAW;
- }
- else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
- {
- // This is the prepaint stage for an item. Here's where we set the
- // item's text color. Our return value will tell Windows to draw the
- // item itself, but it will use the new color we set here.
- // We'll cycle the colors through red, green, and light blue.
- pLVCD->clrText = RGB(0, 0, 0);
- #ifdef ENTERPRISE_VERSION
- COLORREF col[10] = { \
- RGB(190, 76, 195), \
- RGB(76, 176, 76), \
- RGB(136, 113, 200), \
- RGB(76, 186, 198), \
- RGB(209, 127, 213), \
- RGB(127, 209, 127), \
- RGB(170, 154, 215), \
- RGB(127, 206, 215), \
- RGB(0, 127, 0), \
- RGB(0, 0, 127) };
- int nAdd2 = 0;
- #ifndef CHILD_VERSION
- nAdd2=-1;
- #endif
- int pos = ::FindArray(&m_datearray1, m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9 + m_nAdd + nAdd2)) % 10;
- if (pos < 10)
- pLVCD->clrTextBk = col[pos];
- else if (pLVCD->nmcd.dwItemSpec % 2)
- pLVCD->clrTextBk = g_gridcol1;
- else
- pLVCD->clrTextBk = g_gridcol2;
- #else
- #ifdef CHILD_VERSION
- int pos = ::FindArray(&m_datearray1, m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(10 + m_nAdd)) % 10;
- #else
- int pos = ::FindArray(&m_datearray1, m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9 + m_nAdd)) % 10;
- #endif
- COLORREF col[10] = { \
- RGB(209, 127, 213), \
- RGB(127, 209, 127), \
- RGB(170, 154, 215), \
- RGB(127, 206, 215), \
- RGB(190, 76, 195), \
- RGB(76, 176, 76), \
- RGB(136, 113, 200), \
- RGB(76, 186, 198), \
- RGB(0, 127, 0), \
- RGB(0, 0, 127) };
- if (pos < 10)
- pLVCD->clrTextBk = col[pos];
- else if (pLVCD->nmcd.dwItemSpec % 2)
- pLVCD->clrTextBk = g_gridcol1;
- else
- pLVCD->clrTextBk = g_gridcol2;
- #endif
- // Store the color back in the NMLVCUSTOMDRAW struct.
- // Tell Windows to paint the control itself.
- *pResult = CDRF_DODEFAULT;
- }
- }
- void TodayForm::OnCustomdrawList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
- // Take the default processing unless we set this to something else below.
- *pResult = 0;
- // First thing - check the draw stage. If it's the control's prepaint
- // stage, then tell Windows we want messages for every item.
- if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
- {
- *pResult = CDRF_NOTIFYITEMDRAW;
- }
- else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
- {
- // This is the prepaint stage for an item. Here's where we set the
- // item's text color. Our return value will tell Windows to draw the
- // item itself, but it will use the new color we set here.
- // We'll cycle the colors through red, green, and light blue.
- if (::FindArray(&m_datearray2, m_List2.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(5 + m_nAdd)) % 2)
- pLVCD->clrText = RGB(0, 0, 220);
- else
- pLVCD->clrText = RGB(0, 0, 50);
- if (pLVCD->nmcd.dwItemSpec % 2)
- pLVCD->clrTextBk = g_gridcol1;
- else
- pLVCD->clrTextBk = g_gridcol2;
- // Store the color back in the NMLVCUSTOMDRAW struct.
- // Tell Windows to paint the control itself.
- *pResult = CDRF_DODEFAULT;
- }
- }
- void TodayForm::OnCustomdrawList5(NMHDR* pNMHDR, LRESULT* pResult)
- {
- NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
- // Take the default processing unless we set this to something else below.
- *pResult = 0;
- // First thing - check the draw stage. If it's the control's prepaint
- // stage, then tell Windows we want messages for every item.
- if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
- {
- *pResult = CDRF_NOTIFYITEMDRAW;
- }
- else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
- {
- // This is the prepaint stage for an item. Here's where we set the
- // item's text color. Our return value will tell Windows to draw the
- // item itself, but it will use the new color we set here.
- // We'll cycle the colors through red, green, and light blue.
- CString date = m_List5.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(7 + m_nAdd);
- // MessageBox(date);
- // MessageBox(m_date1);
- // MessageBox(m_date2);
- if (date.GetLength() == 10 && date >= m_date1 && date <= m_date2)
- pLVCD->clrText = RGB(0, 0, 220);
- else
- pLVCD->clrText = RGB(0, 0, 50);
- if (pLVCD->nmcd.dwItemSpec % 2)
- pLVCD->clrTextBk = g_gridcol1;
- else
- pLVCD->clrTextBk = g_gridcol2;
- // Store the color back in the NMLVCUSTOMDRAW struct.
- // Tell Windows to paint the control itself.
- *pResult = CDRF_DODEFAULT;
- }
- }
- void TodayForm::OnCustomdrawList6(NMHDR* pNMHDR, LRESULT* pResult)
- {
- NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
- // Take the default processing unless we set this to something else below.
- *pResult = 0;
- // First thing - check the draw stage. If it's the control's prepaint
- // stage, then tell Windows we want messages for every item.
- if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
- {
- *pResult = CDRF_NOTIFYITEMDRAW;
- }
- else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
- {
- // This is the prepaint stage for an item. Here's where we set the
- // item's text color. Our return value will tell Windows to draw the
- // item itself, but it will use the new color we set here.
- // We'll cycle the colors through red, green, and light blue.
- // if(::FindArray (&m_datearray6, m_List6.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (9+m_nAdd) )%2)
- // pLVCD->clrText = RGB(0,0,220);
- // else
- // pLVCD->clrText = RGB(0,0,50);
- if (pLVCD->nmcd.dwItemSpec % 2)
- pLVCD->clrTextBk = g_gridcol1;
- else
- pLVCD->clrTextBk = g_gridcol2;
- // Store the color back in the NMLVCUSTOMDRAW struct.
- // Tell Windows to paint the control itself.
- *pResult = CDRF_DODEFAULT;
- }
- }
- BOOL TodayForm::PreTranslateMessage(MSG* pMsg)
- {
- // TODO: Add your specialized code here and/or call the base class
- if (pMsg->message == WM_KEYDOWN)
- {
- switch (pMsg->wParam)
- {
- case VK_F9:
- GetClientPhone();
- return 1;
- case 0x43: // copy
- if ((GetKeyState(VK_CONTROL) & 0x80))
- {
- GetFocus()->SendMessage(WM_COPY);
- return TRUE;
- }
- break;
- case 0x56: //Ctrl + V:
- if ((GetKeyState(VK_CONTROL) & 0x80))
- {
- GetFocus()->SendMessage(WM_PASTE);
- return TRUE;
- }
- break;
- case 0x58: // cut
- if ((GetKeyState(VK_CONTROL) & 0x80))
- {
- GetFocus()->SendMessage(WM_CUT);
- return TRUE;
- }
- break;
- case 0x5A: //undo
- case 0x59: //redo
- if ((GetKeyState(VK_CONTROL) & 0x80))
- {
- GetFocus()->SendMessage(WM_UNDO);
- return TRUE;
- }
- break;
- }
- }
- return MyFormView::PreTranslateMessage(pMsg);
- }
- void TodayForm::GetClientPhone()
- {
- UpdateData();
- if (m_radio == 1)
- {
- GetClientPhone2();
- return;
- }
- else if (m_radio == 2)
- {
- GetClientPhone3();
- return;
- }
- else if (m_radio == 3)
- {
- GetClientPhone4();
- return;
- }
- else if (m_radio == 4)
- {
- GetClientPhone5();
- return;
- }
- CString path;
- if (m_radio == 0)
- path = "c:\\拍照客人.txt";
- else if (m_radio == 1)
- path = "c:\\选片客人.txt";
- else if (m_radio == 2)
- path = "c:\\看设计客人.txt";
- else if (m_radio == 3)
- path = "c:\\取件客人.txt";
- else if (m_radio == 4)
- path = "c:\\婚庆客人.txt";
- CStdioFile fp;
- fp.Open(path, CFile::modeCreate | CFile::modeWrite);
- CString str;
- CString name, m_name1, m_name2;
- CString phone, m_phone1, m_phone2;
- CString str1, str2, str3, str4, str5, str6, str7, str8, str9;
- int leng1 = 20;
- int leng2 = 30;
- int leng3 = 15;
- int leng4 = 15;
- int leng5 = 15;
- int leng6 = 15;
- int leng7 = 15;
- int leng8 = 15;
- int leng9 = 15;
- str1 = "姓名";
- str2 = "电话";
- str3 = "景点";
- str4 = "日期";
- str5 = "时间";
- str6 = "摄影";
- str7 = "化妆";
- str8 = "套系";
- str9 = "价格";
- FillLength(str1, leng1);
- FillLength(str2, leng2);
- FillLength(str3, leng3);
- FillLength(str4, leng4);
- FillLength(str5, leng5);
- FillLength(str6, leng6);
- FillLength(str7, leng7);
- FillLength(str8, leng8);
- FillLength(str9, leng9);
- str = str1 + str2 + str3 + str4 + str5 + str6 + str7 + str8 + str9 + "\n";
- fp.WriteString(str);
- for (int i = 0; i < m_List1.GetItemCount(); i++)
- {
- name.Empty();
- phone.Empty();
- m_name1 = m_List1.GetItemText(i, 1 + m_nAdd);
- m_name2 = m_List1.GetItemText(i, 2 + m_nAdd);
- m_phone1 = m_List1.GetItemText(i, 3 + m_nAdd);
- m_phone2 = m_List1.GetItemText(i, 4 + m_nAdd);
- str3 = m_List1.GetItemText(i, 5 + m_nAdd);
- str4 = m_List1.GetItemText(i, 6 + m_nAdd);
- str5 = m_List1.GetItemText(i, 7 + m_nAdd);
- str6 = m_List1.GetItemText(i, 8 + m_nAdd);
- str7 = m_List1.GetItemText(i, 9 + m_nAdd);
- str8 = m_List1.GetItemText(i, 12 + m_nAdd);
- str9 = m_List1.GetItemText(i, 13 + m_nAdd);
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2; phone.TrimRight(",");
- str1 = name;
- str2 = phone;
- FillLength(str1, leng1);
- FillLength(str2, leng2);
- FillLength(str3, leng3);
- FillLength(str4, leng4);
- FillLength(str5, leng5);
- FillLength(str6, leng6);
- FillLength(str7, leng7);
- FillLength(str8, leng8);
- FillLength(str9, leng9);
- str = str1 + str2 + str3 + str4 + str5 + str6 + str7 + str8 + str9 + "\n";
- fp.WriteString(str);
- }
- fp.Close();
- MessageBox("资料已保存到" + path);
- ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
- }
- void TodayForm::GetClientPhone2()
- {
- CString path;
- path = "c:\\选片客人.txt";
- CStdioFile fp;
- fp.Open(path, CFile::modeCreate | CFile::modeWrite);
- CString str;
- CString name, m_name1, m_name2;
- CString phone, m_phone1, m_phone2;
- CString str1, str2, str3, str4, str5, str6, str7, str8, str9;
- int leng1 = 25;
- int leng2 = 30;
- int leng3 = 20;
- int leng4 = 20;
- int leng5 = 20;
- int leng6 = 20;
- str1 = "姓名";
- str2 = "电话";
- str3 = "日期";
- str4 = "时间";
- str5 = "套系";
- str6 = "价格";
- FillLength(str1, leng1);
- FillLength(str2, leng2);
- FillLength(str3, leng3);
- FillLength(str4, leng4);
- FillLength(str5, leng5);
- FillLength(str6, leng6);
- str = str1 + str2 + str3 + str4 + str5 + str6 + "\n";
- fp.WriteString(str);
- for (int i = 0; i < m_List2.GetItemCount(); i++)
- {
- name.Empty();
- phone.Empty();
- m_name1 = m_List2.GetItemText(i, 1 + m_nAdd);
- m_name2 = m_List2.GetItemText(i, 2 + m_nAdd);
- m_phone1 = m_List2.GetItemText(i, 3 + m_nAdd);
- m_phone2 = m_List2.GetItemText(i, 4 + m_nAdd);
- str3 = m_List2.GetItemText(i, 5 + m_nAdd);
- str4 = m_List2.GetItemText(i, 6 + m_nAdd);
- str5 = m_List2.GetItemText(i, 9 + m_nAdd);
- str6 = m_List2.GetItemText(i, 10 + m_nAdd);
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2; phone.TrimRight(",");
- str1 = name;
- str2 = phone;
- FillLength(str1, leng1);
- FillLength(str2, leng2);
- FillLength(str3, leng3);
- FillLength(str4, leng4);
- FillLength(str5, leng5);
- FillLength(str6, leng6);
- str = str1 + str2 + str3 + str4 + str5 + str6 + "\n";
- fp.WriteString(str);
- }
- fp.Close();
- MessageBox("资料已保存到" + path);
- ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
- }
- void TodayForm::GetClientPhone3()
- {
- CString path;
- path = "c:\\看设计客人.txt";
- CStdioFile fp;
- fp.Open(path, CFile::modeCreate | CFile::modeWrite);
- CString str;
- CString name, m_name1, m_name2;
- CString phone, m_phone1, m_phone2;
- CString str1, str2, str3, str4, str5, str6, str7, str8, str9;
- int leng1 = 25;
- int leng2 = 30;
- int leng3 = 20;
- int leng4 = 20;
- int leng5 = 20;
- int leng6 = 20;
- str1 = "姓名";
- str2 = "电话";
- str3 = "日期";
- str4 = "时间";
- str5 = "套系";
- str6 = "价格";
- FillLength(str1, leng1);
- FillLength(str2, leng2);
- FillLength(str3, leng3);
- FillLength(str4, leng4);
- FillLength(str5, leng5);
- FillLength(str6, leng6);
- str = str1 + str2 + str3 + str4 + str5 + str6 + "\n";
- fp.WriteString(str);
- for (int i = 0; i < m_List3.GetItemCount(); i++)
- {
- name.Empty();
- phone.Empty();
- m_name1 = m_List3.GetItemText(i, 1 + m_nAdd);
- m_name2 = m_List3.GetItemText(i, 2 + m_nAdd);
- m_phone1 = m_List3.GetItemText(i, 3 + m_nAdd);
- m_phone2 = m_List3.GetItemText(i, 4 + m_nAdd);
- str3 = m_List3.GetItemText(i, 5 + m_nAdd);
- str4 = m_List3.GetItemText(i, 6 + m_nAdd);
- str5 = m_List3.GetItemText(i, 10 + m_nAdd);
- str6 = m_List3.GetItemText(i, 11 + m_nAdd);
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2; phone.TrimRight(",");
- str1 = name;
- str2 = phone;
- FillLength(str1, leng1);
- FillLength(str2, leng2);
- FillLength(str3, leng3);
- FillLength(str4, leng4);
- FillLength(str5, leng5);
- FillLength(str6, leng6);
- str = str1 + str2 + str3 + str4 + str5 + str6 + "\n";
- fp.WriteString(str);
- }
- fp.Close();
- MessageBox("资料已保存到" + path);
- ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
- }
- void TodayForm::GetClientPhone4()
- {
- CString path;
- path = "c:\\取件客人.txt";
- CStdioFile fp;
- fp.Open(path, CFile::modeCreate | CFile::modeWrite);
- CString str;
- CString name, m_name1, m_name2;
- CString phone, m_phone1, m_phone2;
- CString str1, str2, str3, str4, str5, str6, str7, str8, str9;
- int leng1 = 25;
- int leng2 = 30;
- int leng3 = 20;
- int leng4 = 20;
- int leng5 = 20;
- int leng6 = 20;
- str1 = "姓名";
- str2 = "电话";
- str3 = "日期";
- str4 = "时间";
- str5 = "套系";
- str6 = "价格";
- FillLength(str1, leng1);
- FillLength(str2, leng2);
- FillLength(str3, leng3);
- FillLength(str4, leng4);
- FillLength(str5, leng5);
- FillLength(str6, leng6);
- str = str1 + str2 + str3 + str4 + str5 + str6 + "\n";
- fp.WriteString(str);
- for (int i = 0; i < m_List4.GetItemCount(); i++)
- {
- name.Empty();
- phone.Empty();
- m_name1 = m_List4.GetItemText(i, 1 + m_nAdd);
- m_name2 = m_List4.GetItemText(i, 2 + m_nAdd);
- m_phone1 = m_List4.GetItemText(i, 3 + m_nAdd);
- m_phone2 = m_List4.GetItemText(i, 4 + m_nAdd);
- str3 = m_List4.GetItemText(i, 5 + m_nAdd);
- str4 = m_List4.GetItemText(i, 6 + m_nAdd);
- str5 = m_List4.GetItemText(i, 10 + m_nAdd);
- str6 = m_List4.GetItemText(i, 11 + m_nAdd);
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2; phone.TrimRight(",");
- str1 = name;
- str2 = phone;
- FillLength(str1, leng1);
- FillLength(str2, leng2);
- FillLength(str3, leng3);
- FillLength(str4, leng4);
- FillLength(str5, leng5);
- FillLength(str6, leng6);
- str = str1 + str2 + str3 + str4 + str5 + str6 + "\n";
- fp.WriteString(str);
- }
- fp.Close();
- MessageBox("资料已保存到" + path);
- ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
- }
- void TodayForm::GetClientPhone5()
- {
- CString path;
- path = "c:\\婚庆客人.txt";
- CStdioFile fp;
- fp.Open(path, CFile::modeCreate | CFile::modeWrite);
- CString str;
- CString name, m_name1, m_name2;
- CString phone, m_phone1, m_phone2;
- CString str1, str2, str3, str4, str5, str6, str7, str8, str9;
- int leng1 = 25;
- int leng2 = 30;
- int leng3 = 20;
- int leng4 = 20;
- int leng5 = 20;
- int leng6 = 20;
- int leng7 = 20;
- str1 = "姓名";
- str2 = "电话";
- str3 = "婚庆内容";
- str4 = "日期";
- str5 = "时间";
- str6 = "套系";
- str7 = "价格";
- FillLength(str1, leng1);
- FillLength(str2, leng2);
- FillLength(str3, leng3);
- FillLength(str4, leng4);
- FillLength(str5, leng5);
- FillLength(str6, leng6);
- FillLength(str7, leng7);
- str = str1 + str2 + str3 + str4 + str5 + str6 + str7 + "\n";
- fp.WriteString(str);
- for (int i = 0; i < m_List5.GetItemCount(); i++)
- {
- name.Empty();
- phone.Empty();
- m_name1 = m_List5.GetItemText(i, 1 + m_nAdd);
- m_name2 = m_List5.GetItemText(i, 2 + m_nAdd);
- m_phone1 = m_List5.GetItemText(i, 3 + m_nAdd);
- m_phone2 = m_List5.GetItemText(i, 4 + m_nAdd);
- str3 = m_List5.GetItemText(i, 5 + m_nAdd);
- str4 = m_List5.GetItemText(i, 6 + m_nAdd);
- str5 = m_List5.GetItemText(i, 7 + m_nAdd);
- str6 = m_List5.GetItemText(i, 12 + m_nAdd);
- str7 = m_List5.GetItemText(i, 13 + m_nAdd);
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2; phone.TrimRight(",");
- str1 = name;
- str2 = phone;
- FillLength(str1, leng1);
- FillLength(str2, leng2);
- FillLength(str3, leng3);
- FillLength(str4, leng4);
- FillLength(str5, leng5);
- FillLength(str6, leng6);
- FillLength(str7, leng7);
- str = str1 + str2 + str3 + str4 + str5 + str6 + str7 + "\n";
- fp.WriteString(str);
- }
- fp.Close();
- MessageBox("资料已保存到" + path);
- ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
- }
- void TodayForm::OnClickList10(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos = m_List6.GetFirstSelectedItemPosition();
- if (pos == NULL)return;
- int iItem = m_List6.GetNextSelectedItem(pos);
- g_id = m_List6.GetItemText(iItem, 0 + m_nAdd);
- *pResult = 0;
- }
- void TodayForm::HidePrice()
- {
- #ifdef LKAY_VERSION
- if(IsHasRights2new(31))return;
- for(int i=0; i< m_List1array.GetSize (); i++)
- {
- m_List1array.ElementAt (i).SetAt (3+m_nAdd, "***");
- m_List1array.ElementAt (i).SetAt (4+m_nAdd, "***");
- m_List1array.ElementAt (i).SetAt (12+m_nAdd, "***");
- m_List1array.ElementAt (i).SetAt (13+m_nAdd, "***");
- }
- for( i=0; i< m_List2array.GetSize (); i++)
- {
- m_List2array.ElementAt (i).SetAt (3+m_nAdd, "***");
- m_List2array.ElementAt (i).SetAt (4+m_nAdd, "***");
- m_List2array.ElementAt (i).SetAt (9+m_nAdd, "***");
- m_List2array.ElementAt (i).SetAt (10+m_nAdd, "***");
- }
- for( i=0; i< m_List3array.GetSize (); i++)
- {
- m_List3array.ElementAt (i).SetAt (3+m_nAdd, "***");
- m_List3array.ElementAt (i).SetAt (4+m_nAdd, "***");
- m_List3array.ElementAt (i).SetAt (10+m_nAdd, "***");
- m_List3array.ElementAt (i).SetAt (11+m_nAdd, "***");
- }
- for( i=0; i< m_List4array.GetSize (); i++)
- {
- m_List4array.ElementAt (i).SetAt (3+m_nAdd, "***");
- m_List4array.ElementAt (i).SetAt (4+m_nAdd, "***");
- m_List4array.ElementAt (i).SetAt (10+m_nAdd, "***");
- m_List4array.ElementAt (i).SetAt (11+m_nAdd, "***");
- }
- #else
- if (IsHasRights2new(31))return;
- int i = 0;
- for ( i = 0; i < m_List1array.GetSize(); i++)
- {
- #ifdef ENTERPRISE_VERSION
- #ifdef CHILD_VERSION
- if ( g_bAllBranch == 0)
- {
- m_List1array.ElementAt(i).SetAt(5 + m_nAdd, "***");
- m_List1array.ElementAt(i).SetAt(6 + m_nAdd, "***");
- }
- else
- {
- m_List1array.ElementAt(i).SetAt(6 + m_nAdd, "***");
- m_List1array.ElementAt(i).SetAt(7 + m_nAdd, "***");
- }
- #else
- if ( g_bAllBranch == 0)
- {
- m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "***");
- m_List1array.ElementAt(i).SetAt(4 + m_nAdd, "***");
- }
- else
- {
- m_List1array.ElementAt(i).SetAt(4 + m_nAdd, "***");
- m_List1array.ElementAt(i).SetAt(5 + m_nAdd, "***");
- }
- #endif
- #else
- #ifdef CHILD_VERSION
- m_List1array.ElementAt(i).SetAt(5 + m_nAdd, "***");
- m_List1array.ElementAt(i).SetAt(6 + m_nAdd, "***");
- #else
- m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "***");
- m_List1array.ElementAt(i).SetAt(4 + m_nAdd, "***");
- #endif
- #endif
-
- }
- for (i = 0; i < m_List2array.GetSize(); i++)
- {
- m_List2array.ElementAt(i).SetAt(3 + m_nAdd, "***");
- m_List2array.ElementAt(i).SetAt(4 + m_nAdd, "***");
- }
- for (i = 0; i < m_List3array.GetSize(); i++)
- {
- m_List3array.ElementAt(i).SetAt(3 + m_nAdd, "***");
- m_List3array.ElementAt(i).SetAt(4 + m_nAdd, "***");
- }
- for (i = 0; i < m_List4array.GetSize(); i++)
- {
- m_List4array.ElementAt(i).SetAt(3 + m_nAdd, "***");
- m_List4array.ElementAt(i).SetAt(4 + m_nAdd, "***");
- }
- for (i = 0; i < m_List5array.GetSize(); i++)
- {
- m_List5array.ElementAt(i).SetAt(3 + m_nAdd, "***");
- m_List5array.ElementAt(i).SetAt(4 + m_nAdd, "***");
- }
- /* for( i=0; i< m_List6array.GetSize (); i++)
- {
- m_List6array.ElementAt (i).SetAt (16+m_nAdd, "***");
- m_List6array.ElementAt (i).SetAt (17+m_nAdd, "***");
- }*/
- #endif
- }
- extern BOOL CovertDate(CString &date, CString &date2);
- //--------------------------------------------------------------------------
- // Remak by Jeff 2014.11.03
- // 函数:GetData1
- // 描述:获取指定时期段内的拍照预约客人详情。
- // 参数:
- // strBeginTime:时间段起始时刻;
- // strEndofTime:时间段结束时刻
- // 返回:
- //--------------------------------------------------------------------------
- void TodayForm::GetData1(CString strBeginTime, CString strEndofTime)//拍照客人;
- {
- CString sql;
- sql.Format("bookingdate>='" + strBeginTime + "' and bookingdate<='" + strEndofTime + "'");
- int i = 0;
- if (g_bAllBranch == 0)
- {
- g_sendhead.code[0] = 120; // takeview视图;
- g_sendhead.tabcount = 1;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)return;
- DataToArray(&m_List1array);
- // qsort( static_cast<void*>(&m_List1array[0]), m_List1array.GetSize (), sizeof(m_List1array[0]), CompareByLabel3 );
- #ifdef CHILD_VERSION
- CString strBirthday; // 阳历生日;
- CString strLunarBirthday, str;
- COleDateTime tCurrentTime = COleDateTime::GetCurrentTime();
- int days;
- for ( i = 0; i < m_List1array.GetSize(); i++)
- {
- strBirthday = m_List1array.ElementAt(i).ElementAt(24 + m_nAdd2); // Jeff:出生日期;
- if (m_List1array.ElementAt(i).ElementAt(25 + m_nAdd2) == "1") // Jeff:是否农历生日;
- {
- strLunarBirthday.Empty();
- CovertDate(strBirthday, strLunarBirthday);
- if (strLunarBirthday != "")
- strBirthday = strLunarBirthday;
- }
- if (strBirthday.GetLength() == 10)
- {
- 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());
- #if JEFF_TEST_ON
- // Jeff:闰年和平年需要考虑;
- // 1.today != 生日
- // 2.today > birthday;
- // 2.1.获取出生年 compare 今年; 相等,则不足1周岁;可细化月数:差多少天满月、满月、2月……
- // 2.2.获取出生年 compare 今年; < 则 求模判断几周岁;
- // 3.today < birthday;
- // 3.1.获取出生年 compare 今年; 相等,2周岁;
- // 3.2.获取出生年 compare 今年; < 则 求模判断几周岁;
- // -------------------------------------------------
- // 4.today == birthday; 模求周岁;
- // -------------------------------------------------
- //
- // -------------------------------------------------
- // 1.先获取birthday年份和今年年份值,对比;
- // 2.获取birthday月份和今年月份;
- // 3.获取birthday日号和今年日号;
- // ------------------------------------------------
- //printf("Jeff:姓名:%s,出生日期:%d-%d-%d\n\n",m_List1array.ElementAt(i).ElementAt(2),tBirthdayTime.GetYear(),tBirthdayTime.GetMonth(),tBirthdayTime.GetDay());
- //printf("Jeff:姓名:%s,今天日期:%d-%d-%d\n\n",m_List1array.ElementAt(i).ElementAt(2),tCurrentTime.GetYear(),tCurrentTime.GetMonth(),tCurrentTime.GetDay());
- // tCurrentTime今天; tBirthdayTime生日;
- if (tBirthdayTime.GetYear() < tCurrentTime.GetYear()) // 未到1周岁、1周岁及以上:
- {
- if (tCurrentTime.GetYear() - tBirthdayTime.GetYear() == 1) // 判断是否1周岁生日到了;
- {
- if (tCurrentTime.GetMonth() == tBirthdayTime.GetMonth() && tCurrentTime.GetDay() == tBirthdayTime.GetDay())
- {
- // 1周岁生日;
- str.Format("1周岁");
- }
- else
- {
- if (tCurrentTime.GetMonth() < tBirthdayTime.GetMonth())
- {
- // 未满一周岁;
- // str.Format ("%d岁", days);
- int nMonthCount = tBirthdayTime.GetMonth() - tCurrentTime.GetMonth();
- if (tCurrentTime.GetDay() > tBirthdayTime.GetDay())
- {
- str.Format("%d月", 12 - nMonthCount);
- }
- else
- {
- str.Format("%d月", 12 - nMonthCount - 1);
- }
- }
- else
- {
- str.Format("1岁");
- }
- }
- }
- else if (tCurrentTime.GetYear() - tBirthdayTime.GetYear() > 1)
- {
- int nYearCount = 0;
- nYearCount = tCurrentTime.GetYear() - tBirthdayTime.GetYear();
- if (tCurrentTime.GetMonth() >= tBirthdayTime.GetMonth() && tCurrentTime.GetDay() >= tBirthdayTime.GetDay()) // 满nYearCount周岁;
- {
- str.Format("%d周岁", nYearCount);
- }
- else // 不满nYearCount-1周岁;
- {
- str.Format("%d周岁", nYearCount - 1);
- }
- }
- }
- else if (tBirthdayTime.GetYear() == tCurrentTime.GetYear()) // 1周岁以下;
- {
- if (tCurrentTime.GetMonth() == tBirthdayTime.GetMonth())
- {
- if (tCurrentTime.GetDay() == tBirthdayTime.GetDay())
- {
- // 满月;
- str.Format("满月");
- }
- else
- {
- // 差多少天满月;
- str.Format("差%d天满月", tCurrentTime.GetDay() - tBirthdayTime.GetDay());
- }
- }
- else if (tCurrentTime.GetMonth() > tBirthdayTime.GetMonth())
- {
- int nMonthCount = tCurrentTime.GetMonth() - tBirthdayTime.GetMonth();
- if (tCurrentTime.GetDay() > tBirthdayTime.GetDay()) // 满nMonthCount月;
- {
- str.Format("%d月", nMonthCount);
- }
- else // 满nMonthCount-1月;
- {
- str.Format("%d月", nMonthCount - 1);
- }
- }
- }
- #else // Jeff:儿童版开单后,摄控本里显示的岁数不对;
- CTimeSpan dt = tCurrentTime - tBirthdayTime;
- days = dt.GetDays() + 1;
- if (days % 365 == 0)
- days /= 365;
- else
- {
- days /= 365;
- days++;
- }
- str.Format("%d岁", days);
- #endif
- m_List1array.ElementAt(i).InsertAt(3, str);
- }
- else
- {
- // 设置年龄;
- m_List1array.ElementAt(i).InsertAt(3, "未知");
- }
- // 设置性别;
- str = m_List1array.ElementAt(i).ElementAt(27 + m_nAdd2);
- m_List1array.ElementAt(i).InsertAt(3, str);
- }
- #endif
- #ifdef ENTERPRISE_VERSION
- if ( m_List1array.GetSize() == 0 )
- {
- return;
- }
- qsort(static_cast<void*>(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel8);
- qsort(static_cast<void*>(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel7);
- qsort(static_cast<void*>(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel5);
- #endif
- return;
- }
- //////////////数据汇总
- m_List1array.RemoveAll();
- CStringArray failbrancharray;
- CString branch;
- for ( i = -1; i < g_brancharray.GetSize() - 1; i++)
- {
- if (i != -1)
- {
- branch = g_brancharray.ElementAt(i).ElementAt(0);
- g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
- g_pMainWnd->OnDisconnect();
- g_branchname = branch;
- g_bBranchModify = 1;
- }
- else
- branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0);
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 120;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)
- {
- failbrancharray.Add(branch);
- continue;
- }
- CArray<CStringArray, CStringArray>List1array;
- DataToArray(&List1array);
- int size = m_List1array.GetSize();
- for (int j = 0; j < List1array.GetSize(); j++)
- {
- size++;
- m_List1array.SetSize(size, 1);
- size--;
- m_List1array.ElementAt(size).Copy(List1array.ElementAt(j));
- m_List1array.ElementAt(size).InsertAt(0, branch);
- size++;
- }
- }
- #ifdef CHILD_VERSION
- CString strBirthday; // 阳历生日;
- CString strLunarBirthday, str;
- COleDateTime tCurrentTime = COleDateTime::GetCurrentTime();
- int days;
- for (i = 0; i < m_List1array.GetSize(); i++)
- {
- strBirthday = m_List1array.ElementAt(i).ElementAt(25 + m_nAdd2);
- if (m_List1array.ElementAt(i).ElementAt(26 + m_nAdd2) == "1")
- {
- strLunarBirthday.Empty();
- CovertDate(strBirthday, strLunarBirthday);
- if (strLunarBirthday != "")strBirthday = strLunarBirthday;
- }
- if (strBirthday.GetLength() == 10)
- {
- 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());
- #if JEFF_TEST_ON
- if (tBirthdayTime.GetYear() < tCurrentTime.GetYear()) // 未到1周岁、1周岁及以上:
- {
- if (tCurrentTime.GetYear() - tBirthdayTime.GetYear() == 1) // 判断是否1周岁生日到了;
- {
- if (tCurrentTime.GetMonth() == tBirthdayTime.GetMonth() && tCurrentTime.GetDay() == tBirthdayTime.GetDay())
- {
- // 1周岁生日;
- str.Format("1周岁");
- }
- else
- {
- if (tCurrentTime.GetMonth() < tBirthdayTime.GetMonth())
- {
- // 未满一周岁;
- // str.Format ("%d岁", days);
- int nMonthCount = tBirthdayTime.GetMonth() - tCurrentTime.GetMonth();
- if (tCurrentTime.GetDay() > tBirthdayTime.GetDay())
- {
- str.Format("%d月", 12 - nMonthCount);
- }
- else
- {
- str.Format("%d月", 12 - nMonthCount - 1);
- }
- }
- else
- {
- str.Format("1岁");
- }
- }
- }
- else if (tCurrentTime.GetYear() - tBirthdayTime.GetYear() > 1)
- {
- int nYearCount = 0;
- nYearCount = tCurrentTime.GetYear() - tBirthdayTime.GetYear();
- if (tCurrentTime.GetMonth() >= tBirthdayTime.GetMonth() && tCurrentTime.GetDay() >= tBirthdayTime.GetDay()) // 满nYearCount周岁;
- {
- str.Format("%d周岁", nYearCount);
- }
- else // 不满nYearCount-1周岁;
- {
- str.Format("%d周岁", nYearCount - 1);
- }
- }
- }
- else if (tBirthdayTime.GetYear() == tCurrentTime.GetYear()) // 1周岁以下;
- {
- if (tCurrentTime.GetMonth() == tBirthdayTime.GetMonth())
- {
- if (tCurrentTime.GetDay() == tBirthdayTime.GetDay())
- {
- // 满月;
- str.Format("满月");
- }
- else
- {
- // 差多少天满月;
- str.Format("差%d天满月", tCurrentTime.GetDay() - tBirthdayTime.GetDay());
- }
- }
- else if (tCurrentTime.GetMonth() > tBirthdayTime.GetMonth())
- {
- int nMonthCount = tCurrentTime.GetMonth() - tBirthdayTime.GetMonth();
- if (tCurrentTime.GetDay() > tBirthdayTime.GetDay()) // 满nMonthCount月;
- {
- str.Format("%d月", nMonthCount);
- }
- else // 满nMonthCount-1月;
- {
- str.Format("%d月", nMonthCount - 1);
- }
- }
- }
- #else
- CTimeSpan dt=tCurrentTime-tBirthdayTime;
- days=dt.GetDays ()+1;
- if(days%365==0)
- days/=365;
- else
- {
- days/=365;
- days++;
- }
- str.Format ("%d岁", days);
- #endif
- m_List1array.ElementAt(i).InsertAt(4, str);
- }
- else
- {
- m_List1array.ElementAt(i).InsertAt(4, "未知");
- }
- m_List1array.ElementAt(i).InsertAt(4, m_List1array.ElementAt(i).ElementAt(29 + m_nAdd2));
- }
- #endif
- qsort(static_cast<void*>(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel8);
- qsort(static_cast<void*>(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel7);
- qsort(static_cast<void*>(&m_List1array[0]), m_List1array.GetSize(), sizeof(m_List1array[0]), CompareByLabel5);
- for (i = 0; i < failbrancharray.GetSize(); i++)
- {
- // AfxMessageBox("连接"+failbrancharray.ElementAt(i)+"服务器失败!", MB_ICONINFORMATION);
- }
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0; g_branchip = g_branchname = "";
- }
- void TodayForm::GetData2(CString strdate, CString strdate2)//选片客人;
- {
- CString sql;
- sql.Format("time4>='" + strdate + "' and time4<='" + strdate2 + "'");
- if (g_bAllBranch == 0)
- {
- g_sendhead.code[0] = 121;
- g_sendhead.tabcount = 1;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return;
- DataToArray(&m_List2array);
- return;
- }
- //////////////数据汇总
- m_List2array.RemoveAll();
- CStringArray failbrancharray;
- CString branch;
- for (int i = -1; i < g_brancharray.GetSize() - 1; i++)
- {
- if (i != -1)
- {
- branch = g_brancharray.ElementAt(i).ElementAt(0);
- g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
- g_pMainWnd->OnDisconnect();
- g_branchname = branch;
- g_bBranchModify = 1;
- }
- else
- branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0);
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 121;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)
- {
- failbrancharray.Add(branch);
- continue;
- }
- CArray<CStringArray, CStringArray>List1array;
- DataToArray(&List1array);
- int size = m_List2array.GetSize();
- for (int j = 0; j < List1array.GetSize(); j++)
- {
- size++;
- m_List2array.SetSize(size, 1);
- size--;
- m_List2array.ElementAt(size).Copy(List1array.ElementAt(j));
- m_List2array.ElementAt(size).InsertAt(0, branch);
- size++;
- }
- }
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0; g_branchip = g_branchname = "";
- }
- void TodayForm::GetData3(CString strdate, CString strdate2)//看设计客人;
- {
- CString sql;
- sql.Format("time6>='" + strdate + "' and time6<='" + strdate2 + "'");
- if (g_bAllBranch == 0)
- {
- g_sendhead.code[0] = 122;
- g_sendhead.tabcount = 1;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return;
- DataToArray(&m_List3array);
- return;
- }
- //////////////数据汇总
- m_List3array.RemoveAll();
- CStringArray failbrancharray;
- CString branch;
- for (int i = -1; i < g_brancharray.GetSize() - 1; i++)
- {
- if (i != -1)
- {
- branch = g_brancharray.ElementAt(i).ElementAt(0);
- g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
- g_pMainWnd->OnDisconnect();
- g_branchname = branch;
- g_bBranchModify = 1;
- }
- else
- branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0);
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 122;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)
- {
- failbrancharray.Add(branch);
- continue;
- }
- CArray<CStringArray, CStringArray>List1array;
- DataToArray(&List1array);
- int size = m_List3array.GetSize();
- for (int j = 0; j < List1array.GetSize(); j++)
- {
- size++;
- m_List3array.SetSize(size, 1);
- size--;
- m_List3array.ElementAt(size).Copy(List1array.ElementAt(j));
- m_List3array.ElementAt(size).InsertAt(0, branch);
- size++;
- }
- }
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0; g_branchip = g_branchname = "";
- }
- void TodayForm::GetData4(CString strdate, CString strdate2)//取件客人
- {
- CString sql;
- sql.Format("time5>='" + strdate + "' and time5<='" + strdate2 + "' and [status3]='未取'");
- if (g_bAllBranch == 0)
- {
- g_sendhead.code[0] = 123;
- g_sendhead.tabcount = 1;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return;
- DataToArray(&m_List4array);
- return;
- }
- //////////////数据汇总
- m_List4array.RemoveAll();
- CStringArray failbrancharray;
- CString branch;
- for (int i = -1; i < g_brancharray.GetSize() - 1; i++)
- {
- if (i != -1)
- {
- branch = g_brancharray.ElementAt(i).ElementAt(0);
- g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
- g_pMainWnd->OnDisconnect();
- g_branchname = branch;
- g_bBranchModify = 1;
- }
- else
- branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0);
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 123;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)
- {
- failbrancharray.Add(branch);
- continue;
- }
- CArray<CStringArray, CStringArray>List1array;
- DataToArray(&List1array);
- int size = m_List4array.GetSize();
- for (int j = 0; j < List1array.GetSize(); j++)
- {
- size++;
- m_List4array.SetSize(size, 1);
- size--;
- m_List4array.ElementAt(size).Copy(List1array.ElementAt(j));
- m_List4array.ElementAt(size).InsertAt(0, branch);
- size++;
- }
- }
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0; g_branchip = g_branchname = "";
- }
- void TodayForm::GetData5(CString strdate, CString strdate2)// 近期生日;
- {
- CString sql;
- sql.Format("hqdate>='" + strdate + "' and hqdate<='" + strdate2 + "' and kind='2'");
- // sql.Format ("%s,%s", strdate,strdate2);
- if (g_bAllBranch == 0)
- {
- g_sendhead.code[0] = 227;
- g_sendhead.tabcount = 1;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(sql); if (g_bSendOK == 0)return;
- DataToArray(&m_List5array);
- return;
- }
- //////////////数据汇总
- m_List5array.RemoveAll();
- CStringArray failbrancharray;
- CString branch;
- for (int i = -1; i < g_brancharray.GetSize() - 1; i++)
- {
- if (i != -1)
- {
- branch = g_brancharray.ElementAt(i).ElementAt(0);
- g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
- g_pMainWnd->OnDisconnect();
- g_branchname = branch;
- g_bBranchModify = 1;
- }
- else
- branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0);
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 227;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)
- {
- failbrancharray.Add(branch);
- continue;
- }
- CArray<CStringArray, CStringArray>List1array;
- DataToArray(&List1array);
- int size = m_List5array.GetSize();
- for (int j = 0; j < List1array.GetSize(); j++)
- {
- size++;
- m_List5array.SetSize(size, 1);
- size--;
- m_List5array.ElementAt(size).Copy(List1array.ElementAt(j));
- m_List5array.ElementAt(size).InsertAt(0, branch);
- size++;
- }
- }
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0;
- g_branchip = g_branchname = "";
- }
- void TodayForm::OnBUTtakeaway() // 打印;
- {
- if (IsHasRights2new(2) == 0)return;
- if (m_radio == 0)
- {
- SelMemberCardFund seldlg;
- seldlg.m_mode = 1;
- if (seldlg.DoModal() != IDOK)return;
- if (seldlg.m_radio1 == 0)
- {
- OnBUTtakeaway1(); return;
- }
- }
- else if (m_radio == 1)
- {
- OnBUTtakeaway2(); return;
- }
- else if (m_radio == 2)
- {
- OnBUTtakeaway3(); return;
- }
- else if (m_radio == 3)
- {
- OnBUTtakeaway4(); return;
- }
- else if (m_radio == 4)
- {
- OnBUTtakeaway5(); return;
- }
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要打印的项目!", MB_ICONINFORMATION);
- return;
- }
- int iItem;
- CArray<CStringArray, CStringArray>Listarray;
- int count = m_List1.GetItemCount();
- Listarray.SetSize(count, 1);
- count = 0;
- int curpos = 0;
- CString str;
- int nChild = 1;
- CString name, m_name1, m_name2;
- CString phone, m_phone1, m_phone2;
- #ifdef CHILD_VERSION
- nChild = 2;
- #endif
- while (pos)
- {
- name = "";
- phone = "";
- iItem = m_List1.GetNextSelectedItem(pos);
- Listarray.ElementAt(curpos).Add("日期");
- Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 8 + nChild + m_nAdd + m_nAdd2));
- Listarray.ElementAt(curpos).Add("时间");
- Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 9 + nChild + m_nAdd + m_nAdd2));
- m_name1 = m_List1.GetItemText(iItem, 1 + m_nAdd);
- m_name2 = m_List1.GetItemText(iItem, 2 + m_nAdd);
- m_phone1 = m_List1.GetItemText(iItem, 3 + m_nAdd);
- m_phone2 = m_List1.GetItemText(iItem, 4 + m_nAdd);
- #ifdef CHILD_VERSION
- m_phone1 = m_List1.GetItemText(iItem, 5 + m_nAdd);
- m_phone2 = m_List1.GetItemText(iItem, 6 + m_nAdd);
- #endif
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2; phone.TrimRight(",");
- Listarray.ElementAt(curpos).Add("客人姓名");
- Listarray.ElementAt(curpos).Add(name);
- Listarray.ElementAt(curpos).Add("联系电话");
- Listarray.ElementAt(curpos).Add(phone);
- Listarray.ElementAt(curpos).Add("景点");
- Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 6 + nChild + m_nAdd));
- Listarray.ElementAt(curpos).Add("摄影师");
- Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 12 + nChild + m_nAdd + m_nAdd2));
- Listarray.ElementAt(curpos).Add("助理");
- Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 13 + nChild + m_nAdd + m_nAdd2));
- #ifdef CHILD_VERSION
- Listarray.ElementAt(curpos).Add("引导师");
- #else
- Listarray.ElementAt(curpos).Add("化妆师");
- #endif
- Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 14 + nChild + m_nAdd + m_nAdd2));
- Listarray.ElementAt(curpos).Add("助理");
- Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 15 + nChild + m_nAdd + m_nAdd2));
- Listarray.ElementAt(curpos).Add("服装");
- Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 16 + nChild + m_nAdd + m_nAdd2));
- Listarray.ElementAt(curpos).Add("门市");
- Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 18 + nChild + m_nAdd + m_nAdd2));
- Listarray.ElementAt(curpos).Add("备注");
- Listarray.ElementAt(curpos).Add(m_List1.GetItemText(iItem, 17 + nChild + m_nAdd + m_nAdd2));
- curpos++;
- }
- Listarray.SetSize(curpos, 1);
- g_pMainWnd->PrintTakeForm(&Listarray);
- }
- void TodayForm::GetCalendarData()
- {
- if (m_bInit == 0)return;
- if (m_bShowCalendar == 0)return;
- m_spinyear.EnableWindow(0);
- m_spinmonth.EnableWindow(0);
- m_spinday.EnableWindow(0);
- UpdateData();
- CString strdate, strdate2;
- strdate.Format("%04d-%02d-%02d", m_year, m_month, 1);
- strdate2.Format("%04d-%02d-%02d", m_year, m_month, 31);
- CString sql;
- 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'";
- g_sendhead.code[0] = 120;
- g_sendhead.code[1] = 121;
- g_sendhead.code[2] = 122;
- g_sendhead.code[3] = 123;
- g_sendhead.code[4] = 139;
- g_sendhead.tabcount = 5;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- m_spinyear.EnableWindow(1);
- m_spinmonth.EnableWindow(1);
- m_spinday.EnableWindow(1);
- if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>m_List1array;
- CArray<CStringArray, CStringArray>m_List2array;
- CArray<CStringArray, CStringArray>m_List3array;
- CArray<CStringArray, CStringArray>m_List4array;
- CArray<CStringArray, CStringArray>m_List5array;
- DataToArray(&m_List1array, &m_List2array, &m_List3array, &m_List4array, &m_List5array);
- CArray<int, int>array1; // Jeff:每日的拍照预约客人数量;
- CArray<int, int>array2; // Jeff:每日的选片客人数量;
- CArray<int, int>array3; // Jeff:......看样......;
- CArray<int, int>array4; // Jeff:......取件......;
- CArray<int, int>array5; // Jeff:......婚庆......;
-
- int pos;
- int i = 0;
- for ( i = 0; i < 32; i++)
- {
- array1.Add(0);
- array2.Add(0);
- array3.Add(0);
- array4.Add(0);
- array5.Add(0);
- }
- for (i = 0; i < m_List1array.GetSize(); i++)
- {
- // - old code: Jeff remark:没有对集团版进行处理;
- // #ifdef CHILD_VERSION
- // pos=atoi(m_List1array.ElementAt (i).ElementAt (8).Right (2));
- // #else
- // pos=atoi(m_List1array.ElementAt (i).ElementAt (9).Right (2));
- // #endif
- // the follow is modify by Jeff;
- #ifdef CHILD_VERSION // 儿童版
- #ifdef ENTERPRISE_VERSION
- pos = atoi(m_List1array.ElementAt(i).ElementAt(9).Right(2));
- #else
- pos = atoi(m_List1array.ElementAt(i).ElementAt(8).Right(2));
- #endif
- #else // 婚纱版
- #ifdef ENTERPRISE_VERSION
- pos=atoi(m_List1array.ElementAt (i).ElementAt (10).Right (2));
- #else
- pos = atoi(m_List1array.ElementAt(i).ElementAt(9).Right(2));
- #endif
- #endif
- array1.SetAt(pos, array1.ElementAt(pos) + 1);
- }
- for (i = 0; i < m_List2array.GetSize(); i++)
- {
- pos = atoi(m_List2array.ElementAt(i).ElementAt(5).Right(2));
- array2.SetAt(pos, array2.ElementAt(pos) + 1);
- }
- for (i = 0; i < m_List3array.GetSize(); i++)
- {
- pos = atoi(m_List3array.ElementAt(i).ElementAt(5).Right(2));
- array3.SetAt(pos, array3.ElementAt(pos) + 1);
- }
- for (i = 0; i < m_List4array.GetSize(); i++)
- {
- pos = atoi(m_List4array.ElementAt(i).ElementAt(5).Right(2));
- array4.SetAt(pos, array4.ElementAt(pos) + 1);
- }
- for (i = 0; i < m_List5array.GetSize(); i++)
- {
- pos = atoi(m_List5array.ElementAt(i).ElementAt(6).Right(2));
- array5.SetAt(pos, array5.ElementAt(pos) + 1);
- }
- m_CalendarFrm.m_oCalendar.m_Array.RemoveAll();
- CString str;
- for (i = 0; i < 32; i++)
- {
- #ifndef CHILD_VERSION //wangwenbin mark
- str.Format("拍照客人: %d\n选片客人: %d\n看样客人: %d\n取件客人: %d\n婚庆客人: %d\n",
- array1.ElementAt(i), array2.ElementAt(i), array3.ElementAt(i), array4.ElementAt(i), array5.ElementAt(i));
- #else
- str.Format("拍照客人: %d\n选片客人: %d\n看样客人: %d\n取件客人: %d\n",
- array1.ElementAt(i), array2.ElementAt(i), array3.ElementAt(i), array4.ElementAt(i));
- #endif
- m_CalendarFrm.m_oCalendar.m_Array.Add(str); // Jeff:添加到日历控件中;
- }
- //SetDate(iYear, iMonth, iDay);
- m_CalendarFrm.DateChange(m_year, m_month);
- m_CalendarFrm.m_oCalendar.Invalidate();
- }
- // Jeff:按钮:详情图表;
- void TodayForm::OnBUTall() // 详情;
- {
- // TODO: Add your control notification handler code here
- m_bShowCalendar = !m_bShowCalendar;
- if (m_bShowCalendar)
- {
- GetDlgItem(IDC_BUTall)->SetWindowText("详情");
- m_List1.ShowWindow(SW_HIDE);
- m_List2.ShowWindow(SW_HIDE);
- m_List3.ShowWindow(SW_HIDE);
- m_List4.ShowWindow(SW_HIDE);
- m_List5.ShowWindow(SW_HIDE);
- m_List6.ShowWindow(SW_HIDE);
- m_CalendarFrm.ShowWindow(SW_SHOW);
- }
- else
- {
- GetDlgItem(IDC_BUTall)->SetWindowText("图表");
- m_CalendarFrm.ShowWindow(SW_HIDE);
- DateChange();
- }
- }
- void TodayForm::SetDate(int m_iYear, int m_iMonth, int m_iDay)
- {
- UpdateData();
- m_year = m_iYear;
- m_month = m_iMonth;
- m_day = m_iDay;
- UpdateData(false);
- }
- void TodayForm::OnBUTall2()
- {
- OnBUTall();
- }
- void TodayForm::OnRadio9()
- {
- // TODO: Add your control notification handler code here
- OnRadio8();
- }
- void TodayForm::OnRadio14()
- {
- // TODO: Add your control notification handler code here
- OnRadio8();
- }
- void TodayForm::OnRadio15()
- {
- // TODO: Add your control notification handler code here
- OnRadio8();
- }
- void TodayForm::OnRadio16()
- {
- // TODO: Add your control notification handler code here
- OnRadio8();
- }
- //hideprice
- void TodayForm::OnRadio10()
- {
- // TODO: Add your control notification handler code here
- OnRadio8();
- }
- void TodayForm::ReLoad1()
- {
- DateChange();
- }
- CString TodayForm::GetDate()
- {
- UpdateData();
- CString strdate;
- strdate.Format("%04d-%02d-%02d", m_year, m_month, m_day);
- return strdate;
- }
- //天后生日
- void TodayForm::OnBUTtakeaway1()
- {
- CArray<CStringArray, CStringArray>Listarray;
- CString name, m_name1, m_name2;
- CString phone, m_phone1, m_phone2;
- int nChild = 1;
- #ifdef CHILD_VERSION
- nChild = 2;
- #endif
- int count = m_List1.GetItemCount() / 45;
- if (m_List1.GetItemCount() % 45)count++;
- Listarray.SetSize(m_List1.GetItemCount() + count, 1);
- int pos = 0;
- for (int i = 0; i < m_List1.GetItemCount(); i++)
- {
- if (i % 45 == 0)
- {
- Listarray.ElementAt(pos).Add("客人/电话");
- Listarray.ElementAt(pos).Add("景点");
- Listarray.ElementAt(pos).Add("日期/时间");
- Listarray.ElementAt(pos).Add("摄影/助理");
- Listarray.ElementAt(pos).Add("化妆/助理");
- Listarray.ElementAt(pos).Add("服装");
- Listarray.ElementAt(pos).Add("门市");
- pos++;
- }
- name = ""; phone = "";
- m_name1 = m_List1.GetItemText(i, 1 + m_nAdd);
- m_name2 = m_List1.GetItemText(i, 2 + m_nAdd);
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- m_phone1 = m_List1.GetItemText(i, 3 + m_nAdd);
- m_phone2 = m_List1.GetItemText(i, 4 + m_nAdd);
- #ifdef CHILD_VERSION
- m_phone1 = m_List1.GetItemText(i, 5 + m_nAdd);
- m_phone2 = m_List1.GetItemText(i, 6 + m_nAdd);
- #endif
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2; phone.TrimRight(",");
- Listarray.ElementAt(pos).Add(name + "/" + phone);
- Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 6 + nChild + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 8 + nChild + m_nAdd + m_nAdd2) + "/" + m_List1.GetItemText(i, 9 + nChild + m_nAdd + m_nAdd2));
- Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 12 + nChild + m_nAdd + m_nAdd2) + "/" + m_List1.GetItemText(i, 13 + nChild + m_nAdd + m_nAdd2));
- Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 14 + nChild + m_nAdd + m_nAdd2) + "/" + m_List1.GetItemText(i, 15 + nChild + m_nAdd + m_nAdd2));
- Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 16 + nChild + m_nAdd + m_nAdd2));
- Listarray.ElementAt(pos).Add(m_List1.GetItemText(i, 18 + nChild + m_nAdd + m_nAdd2));
- pos++;
- }
- Listarray.SetSize(pos, 1);
- g_pMainWnd->PrintTakeForm1(&Listarray);
- }
- void TodayForm::OnBUTtakeaway2()
- {
- CArray<CStringArray, CStringArray>Listarray;
- CString name, m_name1, m_name2;
- CString phone, m_phone1, m_phone2;
- int nChild = 0;
- #ifdef CHILD_VERSION
- nChild = -1;
- #endif
- int count = m_List2.GetItemCount() / 45;
- if (m_List2.GetItemCount() % 45)count++;
- Listarray.SetSize(m_List2.GetItemCount() + count, 1);
- int pos = 0;
- for (int i = 0; i < m_List2.GetItemCount(); i++)
- {
- if (i % 45 == 0)
- {
- Listarray.ElementAt(pos).Add("客人/电话");
- Listarray.ElementAt(pos).Add("日期/时间");
- Listarray.ElementAt(pos).Add("选片人");
- Listarray.ElementAt(pos).Add("套系");
- Listarray.ElementAt(pos).Add("门市");
- pos++;
- }
- name = "";
- phone = "";
- m_name1 = m_List2.GetItemText(i, 1 + m_nAdd);
- m_name2 = m_List2.GetItemText(i, 2 + m_nAdd);
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- m_phone1 = m_List2.GetItemText(i, 3 + m_nAdd);
- m_phone2 = m_List2.GetItemText(i, 4 + m_nAdd);
- #ifdef CHILD_VERSION
- m_phone1 = m_List2.GetItemText(i, 3 + m_nAdd);
- m_phone2 = m_List2.GetItemText(i, 4 + m_nAdd);
- #endif
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2;
- phone.TrimRight(",");
- Listarray.ElementAt(pos).Add(name + "/" + phone);
- Listarray.ElementAt(pos).Add(m_List2.GetItemText(i, 5 + m_nAdd) + "/" + m_List2.GetItemText(i, 6 + m_nAdd));// 日期/时间;
- #if JEFF_TEST_ON // 由于添加了录入人和录入时间,所以要向后移动;
- Listarray.ElementAt(pos).Add(m_List2.GetItemText(i, 11 + nChild + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List2.GetItemText(i, 13 + nChild + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List2.GetItemText(i, 12 + nChild + m_nAdd));
- #else
- Listarray.ElementAt(pos).Add(m_List2.GetItemText(i, 9 + nChild + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List2.GetItemText(i, 11 + nChild + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List2.GetItemText(i, 10 + nChild + m_nAdd));
- #endif
- pos++;
- }
- Listarray.SetSize(pos, 1);
- g_pMainWnd->PrintTakeForm2(&Listarray);
- }
- void TodayForm::OnBUTtakeaway3()
- {
- CArray<CStringArray, CStringArray>Listarray;
- CString name, m_name1, m_name2;
- CString phone, m_phone1, m_phone2;
- int nChild = 0;
- #ifdef CHILD_VERSION
- nChild = -1;
- #endif
- int count = m_List3.GetItemCount() / 45;
- if (m_List3.GetItemCount() % 45)count++;
- Listarray.SetSize(m_List3.GetItemCount() + count, 1);
- int pos = 0;
- for (int i = 0; i < m_List3.GetItemCount(); i++)
- {
- if (i % 45 == 0)
- {
- Listarray.ElementAt(pos).Add("客人/电话");
- Listarray.ElementAt(pos).Add("日期/时间");
- Listarray.ElementAt(pos).Add("看设计人");
- Listarray.ElementAt(pos).Add("套系");
- Listarray.ElementAt(pos).Add("门市");
- pos++;
- }
- name = ""; phone = "";
- m_name1 = m_List3.GetItemText(i, 1 + m_nAdd);
- m_name2 = m_List3.GetItemText(i, 2 + m_nAdd);
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- m_phone1 = m_List3.GetItemText(i, 3 + m_nAdd);
- m_phone2 = m_List3.GetItemText(i, 4 + m_nAdd);
- #ifdef CHILD_VERSION
- m_phone1 = m_List3.GetItemText(i, 3 + m_nAdd);
- m_phone2 = m_List3.GetItemText(i, 4 + m_nAdd);
- #endif
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2; phone.TrimRight(",");
- Listarray.ElementAt(pos).Add(name + "/" + phone);
- Listarray.ElementAt(pos).Add(m_List3.GetItemText(i, 5 + m_nAdd) + "/" + m_List3.GetItemText(i, 6 + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List3.GetItemText(i, 10 + nChild + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List3.GetItemText(i, 12 + nChild + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List3.GetItemText(i, 11 + nChild + m_nAdd));
- pos++;
- }
- Listarray.SetSize(pos, 1);
- g_pMainWnd->PrintTakeForm3(&Listarray);
- }
- void TodayForm::OnBUTtakeaway4()
- {
- CArray<CStringArray, CStringArray>Listarray;
- CString name, m_name1, m_name2;
- CString phone, m_phone1, m_phone2;
- int nChild = 0;
- #ifdef CHILD_VERSION
- nChild = -1;
- #endif
- int count = m_List4.GetItemCount() / 45;
- if (m_List4.GetItemCount() % 45)count++;
- Listarray.SetSize(m_List4.GetItemCount() + count, 1);
- int pos = 0;
- for (int i = 0; i < m_List4.GetItemCount(); i++)
- {
- if (i % 45 == 0)
- {
- Listarray.ElementAt(pos).Add("客人/电话");
- Listarray.ElementAt(pos).Add("日期/时间");
- Listarray.ElementAt(pos).Add("取件人");
- Listarray.ElementAt(pos).Add("是否完件");
- Listarray.ElementAt(pos).Add("门市");
- pos++;
- }
- name = ""; phone = "";
- m_name1 = m_List4.GetItemText(i, 1 + m_nAdd);
- m_name2 = m_List4.GetItemText(i, 2 + m_nAdd);
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- m_phone1 = m_List4.GetItemText(i, 3 + m_nAdd);
- m_phone2 = m_List4.GetItemText(i, 4 + m_nAdd);
- #ifdef CHILD_VERSION
- m_phone1 = m_List4.GetItemText(i, 3 + m_nAdd);
- m_phone2 = m_List4.GetItemText(i, 4 + m_nAdd);
- #endif
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2; phone.TrimRight(",");
- Listarray.ElementAt(pos).Add(name + "/" + phone);
- Listarray.ElementAt(pos).Add(m_List4.GetItemText(i, 5 + m_nAdd) + "/" + m_List4.GetItemText(i, 6 + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List4.GetItemText(i, 10 + nChild + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List4.GetItemText(i, 9 + nChild + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List4.GetItemText(i, 11 + nChild + m_nAdd));
- pos++;
- }
- Listarray.SetSize(pos, 1);
- g_pMainWnd->PrintTakeForm4(&Listarray);
- }
- void TodayForm::OnBUTtakeaway5()
- {
- CArray<CStringArray, CStringArray>Listarray;
- CString name, m_name1, m_name2;
- CString phone, m_phone1, m_phone2;
- int count = m_List5.GetItemCount() / 45;
- if (m_List5.GetItemCount() % 45)count++;
- Listarray.SetSize(m_List5.GetItemCount() + count, 1);
- int pos = 0;
- int aa = 0;
- for (int i = 0; i < m_List5.GetItemCount(); i++)
- {
- CString date = m_List5.GetItemText(i, 7 + m_nAdd);
- if (!(date.GetLength() == 10 && date >= m_date1 && date <= m_date2))continue;
- if (aa % 45 == 0)
- {
- Listarray.ElementAt(pos).Add("客人/电话");
- Listarray.ElementAt(pos).Add("婚庆内容");
- Listarray.ElementAt(pos).Add("日期/时间");
- Listarray.ElementAt(pos).Add("服务人员");
- Listarray.ElementAt(pos).Add("服务人员2");
- Listarray.ElementAt(pos).Add("套系");
- Listarray.ElementAt(pos).Add("门市");
- pos++;
- }
- aa++;
- name = ""; phone = "";
- int idpos = i;
- while (m_List5.GetItemText(idpos, 0 + m_nAdd) == "")
- idpos--;
- m_name1 = m_List5.GetItemText(idpos, 1 + m_nAdd);
- m_name2 = m_List5.GetItemText(idpos, 2 + m_nAdd);
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- m_phone1 = m_List5.GetItemText(idpos, 3 + m_nAdd);
- m_phone2 = m_List5.GetItemText(idpos, 4 + m_nAdd);
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2; phone.TrimRight(",");
- Listarray.ElementAt(pos).Add(name + "/" + phone);
- Listarray.ElementAt(pos).Add(m_List5.GetItemText(i, 6 + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List5.GetItemText(i, 7 + m_nAdd) + "/" + m_List5.GetItemText(i, 8 + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List5.GetItemText(i, 9 + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List5.GetItemText(i, 10 + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List5.GetItemText(idpos, 14 + m_nAdd));
- Listarray.ElementAt(pos).Add(m_List5.GetItemText(idpos, 13 + m_nAdd));
- pos++;
- }
- Listarray.SetSize(pos, 1);
- g_pMainWnd->PrintTakeForm5(&Listarray);
- }
- void TodayForm::OnDblclkList8(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- OnBUTchoose();
- *pResult = 0;
- }
- /************************************************************************/
- /*
- */
- /************************************************************************/
- void TodayForm::DealChildBrithday(
- IN const int& nCheckDays,
- IN int& nItemSize,
- IN CString strCustomerKind,
- IN CTime& tmOftoday,
- IN CArray<CStringArray, CStringArray>& AryOfCustomer)
- {
- CString strCustomer;
- CString strSex;
- CString strBirthday;
- CString strPhone;
- CString strDifDays;
- BOOL bBirthdayKind = FALSE;
- int nSize = AryOfCustomer.GetSize();
- for (int i = 0; i < nSize; i++)
- {
- CStringArray &SubAry = AryOfCustomer.ElementAt(i);
- if (strCustomerKind == _T("订单客户"))
- {
- strSex = SubAry.ElementAt(9);
- strBirthday = SubAry.ElementAt(7);
- bBirthdayKind = atoi(SubAry.ElementAt(11));
- strCustomer = SubAry.ElementAt(1) + _T(",") + SubAry.ElementAt(2);
- strPhone = SubAry.ElementAt(3);
- }
- else if (strCustomerKind == _T("老客户"))
- {
- strSex = SubAry.ElementAt(3);
- strBirthday = SubAry.ElementAt(6);
- bBirthdayKind = atoi(SubAry.ElementAt(14));
- strCustomer = SubAry.ElementAt(1) + _T(",") + SubAry.ElementAt(2);
- strPhone = SubAry.ElementAt(4);
- }
- else if (strCustomerKind == _T("意向客户"))
- {
- strSex = SubAry.ElementAt(2);
- strBirthday = SubAry.ElementAt(9);
- bBirthdayKind = atoi(SubAry.ElementAt(13));
- strCustomer = SubAry.ElementAt(1) + _T(",") + SubAry.ElementAt(1);
- strPhone = SubAry.ElementAt(3);
- }
- else if ( strCustomerKind == _T("会员客户"))
- {
- // 会员;
- strSex = SubAry.ElementAt(3);
- strBirthday = SubAry.ElementAt(8);
- bBirthdayKind = 0;
- strCustomer = SubAry.ElementAt(2);
- strPhone = SubAry.ElementAt(4);
- }
- else if ( strCustomerKind.Find(_T("医院客户")) != -1 )
- {
- BOOL bChild = !_ttoi(SubAry.ElementAt(6));
- if ( bChild && m_radio2 != 3 )
- {// 儿童生日;
- strSex = SubAry.ElementAt(4);
- strBirthday = SubAry.ElementAt(7);
- strCustomer = SubAry.ElementAt(2);
- bBirthdayKind = _ttoi(SubAry.ElementAt(5));
- strPhone = SubAry.ElementAt(17);
- strCustomerKind = _T("医院客户儿童");
- }
- else if ( !bChild && m_radio2 == 3 )
- {// 孕妇预产期;
- strSex = _T("女");
- strBirthday = SubAry.ElementAt(7);
- strCustomer = SubAry.ElementAt(1);
- bBirthdayKind = _ttoi(SubAry.ElementAt(5));
- strPhone = SubAry.ElementAt(17);
- strCustomerKind = _T("医院客户孕妇");
- strCustomer.TrimLeft(_T(","));
- strCustomer.TrimRight(_T(","));
- DealChildDate(nCheckDays, nItemSize, strCustomerKind, strCustomer, strSex, strBirthday, strPhone, bBirthdayKind, tmOftoday);
- continue;
- }
- else
- {
- continue;
- }
- }
- strCustomer.TrimLeft(_T(","));
- strCustomer.TrimRight(_T(","));
- DealChildDate(nCheckDays, nItemSize, strCustomerKind, strCustomer, strSex, strBirthday, strPhone, bBirthdayKind, tmOftoday);
- }
- }
- void TodayForm::DealChildDate(
- IN const int& nCheckDays,
- IN int &nItemIndex,
- IN CString &strCustomerType,
- IN CString &strCustomer,
- IN CString strSex,
- IN CString& strBirthday,
- IN CString& strPhone,
- IN BOOL bDateType,
- IN CTime& tmOftoday)
- {
- // 判断日期是否有效;
- CString strBirthdayBak = strBirthday;
- if (bDateType)
- {// 农历生日类型;
- if ( m_radio2 == 1 || m_radio2 == 2 ) // 百天和满月只计算今年的;
- {
- if (!IsValidLunanrDate(strBirthday))return;
- strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(_ttoi(strBirthday.Left(4)), _ttoi(strBirthday.Mid(5, 2)), _ttoi(strBirthday.Mid(8, 2)));
- }
- else
- {
- strBirthday.Format("%04d-%02d-%02d",tmOftoday.GetYear(), _ttoi(strBirthdayBak.Mid(5, 2)), _ttoi(strBirthdayBak.Mid(8, 2)));
- if (!IsValidLunanrDate(strBirthday))return;
- strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(tmOftoday.GetYear(), _ttoi(strBirthday.Mid(5, 2)), _ttoi(strBirthday.Mid(8, 2)));
- }
- if ( tmOftoday.GetYear() < _ttoi(strBirthday.Left(4)) )
- {// 超过1年日期;
- return;
- }
-
- if ( strBirthday == _T("1900-01-01") )
- {// 没有找到该农历日期;
- // 排除大月30号出生,但是今年只有小月29号;
- if ( m_radio2 == 1 || m_radio2 == 2 ) // 百天和满月只计算今年的;
- strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(_ttoi(strBirthday.Left(4)), _ttoi(strBirthdayBak.Mid(5, 2)), _ttoi(strBirthdayBak.Mid(8, 2)) - 1 );
- else
- strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(tmOftoday.GetYear(), _ttoi(strBirthdayBak.Mid(5, 2)), _ttoi(strBirthdayBak.Mid(8, 2)) - 1 );
-
- if ( strBirthday == _T("1900-01-01") )
- {// 仍然是不存在,则可能日期是乱写的;
- return;
- }
- }
- }
- else
- {// 公历生日类型;
- if (!IsValidDate(strBirthday))return;
- }
- int ndays = -1;
- CString strDays;
- int nMemorialYear = 0;
- if ( m_radio2 == 0 )
- { // 生日;
- strBirthday = g_date.Left(4) + strBirthday.Right(6);
- CTime tm = GetTmFromStr(strBirthday);
- CTimeSpan dt = tm - tmOftoday;
- ndays = dt.GetDays();
- strDays.Format(_T("%d天后生日"), ndays);
- if (ndays == 0)strDays = _T("今天生日");
- }
- else if (m_radio2 == 1)
- { // 满月;
- CTime tm = GetTmFromStr(strBirthday);
- int year = tm.GetYear();
- int month = tm.GetMonth();
- int day = tm.GetDay();
- tm += CTimeSpan(28, 0, 0, 0);
- while (1)
- {
- if (tm.GetDay() >= day && (tm.GetMonth() == month + 1 || tm.GetYear() == year + 1))break;
- if (tm.GetMonth() > month + 1)
- {
- tm -= CTimeSpan(1, 0, 0, 0);
- break;
- }
- tm += CTimeSpan(1, 0, 0, 0);
- }
- CTimeSpan dt = tm - tmOftoday;
- ndays = dt.GetDays();
- strDays.Format(_T("%d天后满月"), ndays);
- if (ndays == 0)strDays = _T("今天满月");
- }
- else if (m_radio2 == 2)
- { // 百天;
- CTime tm = GetTmFromStr(strBirthday);
- tm += CTimeSpan(100, 0, 0, 0);
- CTimeSpan dt = tm - tmOftoday;
- ndays = dt.GetDays();
- strDays.Format(_T("%d天后满100天"), ndays);
- if (ndays == 0)strDays = _T("今天满100天");
- }
- else if ( m_radio2 == 3 )
- {// 医院宝宝生日或孕妇预产期;
- if ( strCustomerType == _T("医院客户孕妇"))
- {
- CTime tm = GetTmFromStr(strBirthday);
- CTimeSpan dt = tm - tmOftoday;
- ndays = dt.GetDays();
- strDays.Format(_T("%d天后预产期"), ndays);
- if (ndays == 0)strDays = _T("今天预产期");
- }
- }
-
- if (ndays < nCheckDays && ndays >= 0 && strCustomer != _T(""))
- {
- m_List6array.SetSize(nItemIndex + 1, 1);
- m_List6array.ElementAt(nItemIndex).Add(strCustomer);
- m_List6array.ElementAt(nItemIndex).Add(strSex);
- m_List6array.ElementAt(nItemIndex).Add(strBirthdayBak);
- if (bDateType)
- m_List6array.ElementAt(nItemIndex).Add(_T("农历"));
- else
- m_List6array.ElementAt(nItemIndex).Add(_T("公历"));
- m_List6array.ElementAt(nItemIndex).Add(strCustomerType);
- m_List6array.ElementAt(nItemIndex).Add(strPhone);
- m_List6array.ElementAt(nItemIndex).Add(strDays);
- nItemIndex++;
- }
- }
- /************************************************************************/
- /* 函数:[3/2/2016 IT];
- /* 描述:;
- /* 参数:;
- /* [IN] :;
- /* [OUT] :;
- /* [IN/OUT] :;
- /* 返回:void;
- /* 注意:;
- /* 示例:;
- /*
- /* 修改:;
- /* 日期:;
- /* 内容:;
- /************************************************************************/
- void TodayForm::DealWeddingBrithday(
- IN const int& nCheckDays,
- IN int& nItemSize,
- IN CString strCustomerKind,
- IN CTime& tmOftoday,
- IN CArray<CStringArray, CStringArray>& AryOfCustomer)
- {
- CString strCustomer;
- CString strSex;
- CString strBirthday;
- CString strPhone;
- CString strDifDays;
- BOOL bBirthdayKind = FALSE;
- int nSize = AryOfCustomer.GetSize();
- for (int i = 0; i < nSize; i++)
- {
- CStringArray &SubAry = AryOfCustomer.ElementAt(i);
- //////////////////////////////////////////////////////////////////////////
- // 男宾;
- if (strCustomerKind == _T("订单客户"))
- {
- strCustomer = SubAry.ElementAt(0);
- strPhone = SubAry.ElementAt(2);
- strBirthday = SubAry.ElementAt(5);
- bBirthdayKind = atoi(SubAry.ElementAt(10));
- if (m_radio2 == 1 || m_radio2 == 2)
- {
- strBirthday = SubAry.ElementAt(4); // 婚期日期;
- bBirthdayKind = atoi(SubAry.ElementAt(12));
- }
- DealWeddingDate(
- nCheckDays,
- nItemSize,
- strCustomerKind,
- strCustomer,
- _T("男"),
- strBirthday,
- strPhone,
- bBirthdayKind,
- tmOftoday);
- }
- else if (strCustomerKind == _T("老客户"))
- {
- strCustomer = SubAry.ElementAt(1);
- strPhone = SubAry.ElementAt(3);
- strBirthday = SubAry.ElementAt(7);
- bBirthdayKind = atoi(SubAry.ElementAt(17));
- if (m_radio2 == 1 || m_radio2 == 2)
- {
- strBirthday = SubAry.ElementAt(9); // 婚期日期;
- bBirthdayKind = atoi(SubAry.ElementAt(19));
- }
- DealWeddingDate(nCheckDays, nItemSize, strCustomerKind, strCustomer, _T("男"), strBirthday, strPhone, bBirthdayKind, tmOftoday);
- }
- else if (strCustomerKind == _T("意向客户"))
- {
- strSex = SubAry.ElementAt(2);
- strCustomer = SubAry.ElementAt(1);
- strPhone = SubAry.ElementAt(3);
- strBirthday = SubAry.ElementAt(9);
- bBirthdayKind = atoi(SubAry.ElementAt(13));
- if (m_radio2 == 1 || m_radio2 == 2)
- {
- return;
- }
- DealWeddingDate(nCheckDays, nItemSize, strCustomerKind, strCustomer, strSex, strBirthday, strPhone, bBirthdayKind, tmOftoday);
- }
- else
- {
- strSex = SubAry.ElementAt(3);
- strCustomer = SubAry.ElementAt(2);
- strPhone = SubAry.ElementAt(4);
- strBirthday = SubAry.ElementAt(8);
- bBirthdayKind = 0;
- if (m_radio2 == 1 || m_radio2 == 2)
- {
- return;
- }
- DealWeddingDate(nCheckDays, nItemSize, strCustomerKind, strCustomer, strSex, strBirthday, strPhone, bBirthdayKind, tmOftoday);
- }
- //////////////////////////////////////////////////////////////////////////
- // 女宾;
- if (strCustomerKind == _T("订单客户"))
- {
- strCustomer = SubAry.ElementAt(1);
- strPhone = SubAry.ElementAt(3);
- strBirthday = SubAry.ElementAt(6);
- bBirthdayKind = atoi(SubAry.ElementAt(11));
- if (m_radio2 == 1 || m_radio2 == 2)
- {
- strBirthday = SubAry.ElementAt(4); // 婚期日期;
- bBirthdayKind = atoi(SubAry.ElementAt(12));
- }
- DealWeddingDate(nCheckDays, nItemSize, strCustomerKind, strCustomer, _T("女"), strBirthday, strPhone, bBirthdayKind, tmOftoday);
- }
- else if (strCustomerKind == _T("老客户"))
- {
- strCustomer = SubAry.ElementAt(2);
- strPhone = SubAry.ElementAt(4);
- strBirthday = SubAry.ElementAt(8);
- bBirthdayKind = atoi(SubAry.ElementAt(18));
- if (m_radio2 == 1 || m_radio2 == 2)
- {
- strBirthday = SubAry.ElementAt(9); // 婚期日期;
- bBirthdayKind = atoi(SubAry.ElementAt(19));
- }
- DealWeddingDate(nCheckDays, nItemSize, strCustomerKind, strCustomer, _T("女"), strBirthday, strPhone, bBirthdayKind, tmOftoday);
- }
- }
- }
- /************************************************************************/
- /* 函数:[3/2/2016 IT];
- /* 描述:;
- /* 参数:;
- /* [IN] :;
- /* [OUT] :;
- /* [IN/OUT] :;
- /* 返回:void;
- /* 注意:;
- /* 示例:;
- /*
- /* 修改:;
- /* 日期:;
- /* 内容:;
- /************************************************************************/
- void TodayForm::DealWeddingDate(
- IN const int& nCheckDays,
- IN int &nItemIndex,
- IN CString &strCustomerType,
- IN CString &strCustomer,
- IN CString strSex,
- IN CString& strBirthday,
- IN CString& strPhone,
- IN BOOL bDateType,
- IN CTime& tmOftoday)
- {
- // 判断日期是否有效;
- CString strBirthdayBak = strBirthday;
- if (bDateType)
- {
- if ( m_radio2 == 1 ) // 结婚当天;
- {
- if (!IsValidLunanrDate(strBirthday))return;
- strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(_ttoi(strBirthday.Left(4)), _ttoi(strBirthday.Mid(5, 2)), _ttoi(strBirthday.Mid(8, 2)));
- }
- else
- {
- strBirthday.Format(_T("%04d-%02d-%02d"),tmOftoday.GetYear(), _ttoi(strBirthday.Mid(5, 2)), _ttoi(strBirthday.Mid(8, 2)));
- if (!IsValidLunanrDate(strBirthday))return;
- strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(tmOftoday.GetYear(), _ttoi(strBirthday.Mid(5, 2)), _ttoi(strBirthday.Mid(8, 2)));
- }
- if ( tmOftoday.GetYear() < _ttoi(strBirthday.Left(4)) )
- {// 超过1年日期;
- return;
- }
- if ( strBirthday == _T("1900-01-01") )
- {// 没有找到该农历日期;
- // 排除大月30号出生,但是今年只有小月29号;
- strBirthday = CCalendarEx::GetInstnace()->LuanrToSolarDate(tmOftoday.GetYear(), _ttoi(strBirthdayBak.Mid(5, 2)), _ttoi(strBirthdayBak.Mid(8, 2)) - 1 );
- if ( strBirthday == _T("1900-01-01") )
- {// 仍然是不存在,则可能日期是乱写的;
- return;
- }
- }
- }
- else
- {
- if (!IsValidDate(strBirthday))return;
- strBirthday.Format(_T("%04d-%s-%s"), tmOftoday.GetYear(), strBirthday.Mid(5, 2), strBirthday.Mid(8, 2));
- }
- int ndays = -1;
- CString strDays;
- int nMemorialYear = 0;
- if (m_radio2 == 1) // 当天结婚;
- {
- CTime tm = GetTmFromStr(strBirthday);
- CTimeSpan dt = tm - tmOftoday;
- ndays = dt.GetDays();
- if ( ndays < 0 ) return;
- strDays.Format(_T("%d天后结婚"), ndays);
- if (ndays == 0)
- strDays = _T("今天结婚");
- }
- else if (m_radio2 == 2) // 结婚纪念日;
- {
- if (g_date.Left(4) <= strBirthday.Left(4))
- return;
- strBirthday = g_date.Left(4) + strBirthday.Right(6);
- CTime tm = GetTmFromStr(strBirthday);
- CTimeSpan dt = tm - tmOftoday;
- ndays = dt.GetDays();
- if ( ndays < 0 ) return;
- nMemorialYear = atoi(g_date.Left(4)) - atoi(strBirthdayBak.Left(4));
- strDays.Format(_T("%d天后%d周年结婚纪念日"), ndays, nMemorialYear);
- if (ndays == 0)
- strDays.Format(_T("今天%d周年结婚纪念日"), nMemorialYear);
- }
- else // 生日;
- {
- strBirthday = g_date.Left(4) + strBirthday.Right(6);
- CTime tm = GetTmFromStr(strBirthday);
- CTimeSpan dt = tm - tmOftoday;
- ndays = dt.GetDays();
- if ( ndays < 0 ) return;
- strDays.Format(_T("%d天后生日"), ndays);
- if (ndays == 0)
- strDays = _T("今天生日");
- }
- if (ndays < nCheckDays && ndays >= 0 && strCustomer != _T(""))
- {
- m_List6array.SetSize(nItemIndex + 1, 1);
- m_List6array.ElementAt(nItemIndex).Add(strCustomer);
- m_List6array.ElementAt(nItemIndex).Add(strSex);
- m_List6array.ElementAt(nItemIndex).Add(strBirthdayBak);
- if (bDateType)
- m_List6array.ElementAt(nItemIndex).Add(_T("农历"));
- else
- m_List6array.ElementAt(nItemIndex).Add(_T("公历"));
- m_List6array.ElementAt(nItemIndex).Add(strCustomerType);
- m_List6array.ElementAt(nItemIndex).Add(strPhone);
- m_List6array.ElementAt(nItemIndex).Add(strDays);
- nItemIndex++;
- }
- }
|