123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800 |
- // TakeFrom.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "TakeFrom.h"
- #include "MyMdi.H"
- #include "ModifyDinDan.h"
- #include "InputPsw.h"
- #include "ImportPhoto.h"
- #include "ShowPic.h"
- #include "TakeMoney2.h"
- #include "SelWaiter2.h"
- #include "TakeStautsSel.h"
- #include "SalaryRateSet2.h"
- #include "UploadPhoto.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- #pragma comment(lib, "Shlwapi.lib")
- IMPLEMENT_DYNCREATE(TakeFrom, MyFormView)
- TakeFrom::TakeFrom() : MyFormView(TakeFrom::IDD)
- {
- m_filter = _T("");
- m_nAdd = 0;
- if (g_bAllBranch)
- {
- m_nAdd = 1;
- }
- }
- TakeFrom::~TakeFrom()
- {
- }
- void TakeFrom::DoDataExchange(CDataExchange* pDX)
- {
- MyFormView::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_COMBO1, m_combo1);
- DDX_Control(pDX, IDC_LIST2, m_List1);
- DDX_Control(pDX, IDC_STATIC1, m_static1);
- DDX_CBString(pDX, IDC_COMBO1, m_filter);
- }
- BEGIN_MESSAGE_MAP(TakeFrom, MyFormView)
- ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
- ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
- ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
- ON_WM_TIMER()
- ON_BN_CLICKED(IDC_BUTimportphoto, OnBUTimportphoto)
- ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
- ON_BN_CLICKED(IDC_BUTmoney, OnBUTmoney)
- ON_BN_CLICKED(IDC_BTNaddsp, OnBTNaddsp)
- ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
- ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
- ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
- ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2)
- ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
- ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3)
- ON_BN_CLICKED(Btn_MicroShare, OnBnClickedMicroshare)
- END_MESSAGE_MAP()
- #ifdef _DEBUG
- void TakeFrom::AssertValid() const
- {
- MyFormView::AssertValid();
- }
- void TakeFrom::Dump(CDumpContext& dc) const
- {
- MyFormView::Dump(dc);
- }
- #endif //_DEBUG
- void TakeFrom::OnInitialUpdate()
- {
- MyFormView::OnInitialUpdate();
- // TODO: Add your specialized code here and/or call the base class
- CMyMdi Mdi;
- Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
- #ifdef LYFZ_VERSION
- GetDlgItem(IDC_BUTimportphoto)->ShowWindow(0);
- #endif
- // 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);
- int idarray[] = { IDC_BUTprint3, IDC_BUTimportphoto, IDC_BUTshowphoto, IDC_BUTTON2, IDC_BUTclose };
- int idcount = 5;
- 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_static1.SetFont(&g_titlefont);
- if (g_bAllBranch == 0)
- {
- #ifdef CHILD_VERSION
- #ifdef LKAY_VERSION
- m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;相片张数,100;景点,100;拍照,100;导片日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,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" );
- #endif
- #else
- m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
- #endif
- m_List1.LoadColumnInfo(114);
- }
- else
- {
- #ifdef CHILD_VERSION
- m_List1.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,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");
- #endif
- m_List1.LoadColumnInfo(196);
- GetDlgItem(IDC_BUTprint3)->ShowWindow(1);
- }
- #if JEFF_DELETE_OFF // 多景点时排序有问题!
- m_List1.m_bSortSupport = 0;
- #endif
- GetData();
- m_combo1.AddString(g_user.name);
- m_combo1.GetWindowRect(rc2);
- ScreenToClient(rc2);
- rc2.bottom += 200;
- m_combo1.MoveWindow(rc2);
- GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
- SetComboHei(&m_combo1, rc2.Height());
- }
- void TakeFrom::FillGrid(BOOL bStatus/*=0*/)
- {
- if (g_bSearchFilter) // 1.按钮:条件查询;
- {
- m_List1.DeleteAllItems2();
- int ii = 0;
- m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
- int count = 0;
- {
- BOOL bFinded = 0;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (g_filterdate1 != "") // Jeff.查询过滤条件:日期;
- {
- if (m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) < g_filterdate1 || m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) > g_filterdate2)
- {
- bFinded = 0;
- continue;
- }
- }
- if (g_waiter1 != "") // Jeff.查询过滤条件:门市;
- {
- if (m_List1array.ElementAt(ii).ElementAt(11 + m_nAdd) != g_waiter1)
- {
- bFinded = 0;
- continue;
- }
- }
- if (g_waiter2 != "") // Jeff.查询过滤条件:摄影师;
- {
- if (m_List1array.ElementAt(ii).ElementAt(7 + m_nAdd) != g_waiter2)
- {
- bFinded = 0;
- continue;
- }
- }
- if (g_waiter3 != "") // Jeff.查询过滤条件:化妆师;
- {
- if (m_List1array.ElementAt(ii).ElementAt(9 + m_nAdd) != g_waiter3)
- {
- bFinded = 0;
- continue;
- }
- }
- if (g_waiter4 != "") // Jeff.查询套系类别;
- {
- if (m_List1array.ElementAt(ii).ElementAt(3) != g_waiter4)
- {
- bFinded = 0;
- continue;
- }
- }
- if (g_bAllBranch && g_filterbranch != "") // Jeff.集团版查询过滤条件:分店名称;
- {
- if (m_List1array.ElementAt(ii).ElementAt(0) != g_filterbranch)
- {
- bFinded = 0;
- continue;
- }
- }
- // 2015.03.30
- // Jeff:上面已有判断,这里必须判断订单号非空才能添加,否则会添加其他空的选项;
- if (!m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- bFinded = 1;
- }
- }
- }
- m_List1.m_arLabels.SetSize(count, 1);
- ii = count;
- m_List1.m_LabelCount = ii;
- m_List1.SetItemCountEx(ii);
- CString str;
- str.Format("单数:%d", ii);
- SetDlgItemText(IDC_STATIC2, str);
- }
- else // 2.其他显示;
- {
- m_List1.DeleteAllItems2();
- int ii = 0;
- m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
- int count = 0;
- if (m_filter.IsEmpty()) // 2.1.没有查询关键字;
- {
- if (bStatus == 1) // bStatus==1,没用到;
- {
- BOOL bFinded = 0;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0)
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else if (bStatus == 2) // 今拍按钮用到;
- {
- BOOL bFinded = 0;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK" && m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date)
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else // bStatus==0;默认使用的值;
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- else // 2.2.指定查询条件 ;
- {
- if (bStatus == 1)
- {
- BOOL bFinded = 0;
- int type = GetType(m_filter);
- if (type == 1)//电话
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0 && (m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1))
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else if (type == 2)//拼音
- {
- BOOL bFinded = 0;
- m_filter.MakeUpper();
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0 && (m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1))
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else
- {
- BOOL bFinded = 0;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&\
- m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0 && \
- (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(4).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(5).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(6).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(7).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(8).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1))
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- }
- else if (bStatus == 2)
- {
- BOOL bFinded = 0;
- int type = GetType(m_filter);
- if (type == 1)//电话
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date && (m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1))
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else if (type == 2)//拼音
- {
- BOOL bFinded = 0;
- m_filter.MakeUpper();
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date && (m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1))
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else
- {
- BOOL bFinded = 0;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date &&\
- (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(4).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(5).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(6).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(7).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(8).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1))
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- }
- else
- {
- int type = GetType(m_filter);
- if (type == 1)//电话
- {
- BOOL bFinded = 0;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1)
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else if (type == 2)//拼音
- {
- BOOL bFinded = 0;
- m_filter.MakeUpper();
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1)
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else
- {
- BOOL bFinded = 0;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(4).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(5).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(6).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(7).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(8).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1)
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- }
- }
- m_List1.m_arLabels.SetSize(count, 1);
- ii = count;
- m_List1.m_LabelCount = ii;
- m_List1.SetItemCountEx(ii);
- CString str;
- str.Format("单数:%d", ii);
- SetDlgItemText(IDC_STATIC2, str);
- }
- if (!g_id.IsEmpty())
- {
- for (int i = 0; i < m_List1.GetItemCount(); i++)
- {
- if (g_id == m_List1.GetItemText(i, 0 + m_nAdd))
- {
- m_List1.SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
- m_List1.EnsureVisible(i, FALSE);
- break;
- }
- }
- }
- }
- void TakeFrom::OnBUTclose()
- {
- // TODO: Add your control notification handler code here
- GetParent()->SendMessage(WM_CLOSE);
- }
- void TakeFrom::OnSelchangeCombo1()
- {
- // TODO: Add your control notification handler code here
- SetTimer(1, 100, NULL);
- }
- void TakeFrom::OnTimer(UINT nIDEvent)
- {
- // TODO: Add your message handler code here and/or call default
- KillTimer(nIDEvent);
- OnButton1();
- }
- BOOL TakeFrom::PreTranslateMessage(MSG* pMsg)
- {
- // TODO: Add your specialized code here and/or call the base class
- try
- {
- if (pMsg->message == WM_KEYDOWN)
- {
- switch (pMsg->wParam)
- {
- case VK_RETURN:
- OnButton1();
- 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);
- }
- catch (...)
- {
- }
- }
- // Jeff.remark.
- // 1.弹出"拍照状态确认"对话框前,需要获取订单的拍照状态,以此来确定是否需要禁用check状态框;
- //
- void TakeFrom::OnBUTimportphoto() // 导入原片按钮;
- {
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
- return;
- }
- // 1.选中的起始行号;
- int iItem = m_List1.GetNextSelectedItem(pos);
- // 2.选中的行数;
- int itemcount = m_List1.GetItemCount();
- int iItemBak = iItem;
- CString status2 = "OK";
- CString branch;
- CString strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd); // .OrderNumber订单号;
- int beginno = atoi(m_List1.GetItemText(iItem, 3 + m_nAdd)) + 1; // .Jeff.起始编号,即下一次相片命名的号码数;由服务器减1,客户端加1;
- if (g_bAllBranch)
- branch = m_List1.GetItemText(iItem, 0);
- // Jeff.多景点时,选择了不是第一个景点,订单是空的;
- while (strOrderNumber == "")
- {
- iItem--;
- strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
- beginno = atoi(m_List1.GetItemText(iItem, 3 + m_nAdd)) + 1; // 由服务器减1,客户端加1;
- }
- int nTopItem = iItem;// Jeff add:记录第一个有订单号的项;
- //int nNotOkItem = -1; // Jeff add:第一个被记录未拍照ok的子景点项;如果是头景点呢?
- // .jdpos景点位置;并不能用来判断该订单是否多个景点,因为如果iItem是有订单号的话,无效;
- int jdpos = iItemBak - iItem;
- // .订单拍摄如果不是ok状态,设置为拍摄中;
- BOOL bOK = TRUE; //Jeff.add;
- #if 1 // Jeff.用于判断是否只剩下一个 未OK 状态时,拍照确认对话框的复选是否需要勾上;
- // 此时iItem为有订单号的头景点;
- if (m_List1.GetItemText(iItem, 5 + m_nAdd) != "OK")
- {
- status2 = "拍摄中";
- //bOK = FALSE;
- }
- // .子景点(如果有的话);
- ++iItem;
- while (iItem < itemcount && m_List1.GetItemText(iItem, 0 + m_nAdd) == "" && status2 != "拍摄中")
- {
- if (m_List1.GetItemText(iItem, 5 + m_nAdd) != "OK" && iItemBak != iItem) // Jeff.如果只有两个景点这里出错:第一个ok,第二个未拍;这里会跳出;
- {
- status2 = "拍摄中";
- //bOK = FALSE;
- //nNotOkItem = iItem;
- break;
- }
- iItem++;
- }
- // printf("Jeff:对话框前的状态:%s\n\n",status2);
- #endif
- iItem = iItemBak;
- CString dindanjd = m_List1.GetItemText(iItem, 4 + m_nAdd);
- CString waiter1 = m_List1.GetItemText(iItem, 7 + m_nAdd);
- CString waiter12 = m_List1.GetItemText(iItem, 8 + m_nAdd);
- CString waiter2 = m_List1.GetItemText(iItem, 9 + m_nAdd);
- CString waiter22 = m_List1.GetItemText(iItem, 10 + m_nAdd);
- strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
- while (strOrderNumber == "")
- {
- iItem--;
- strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
- }
- CString name = m_List1.GetItemText(iItem, 1 + m_nAdd) + "," + m_List1.GetItemText(iItem, 2 + m_nAdd);
- name.TrimLeft(",");
- name.TrimRight(",");
- name = "客人:" + name;
- CString phone = m_List1.GetItemText(iItem, 14 + m_nAdd) + "," + m_List1.GetItemText(iItem, 15 + m_nAdd);
- phone.TrimLeft(",");
- phone.TrimRight(",");
- phone = "电话:" + phone;
- if (g_path1.IsEmpty())
- {
- AfxMessageBox("未设置原片保存机器, 请通知系统管理员!", MB_ICONINFORMATION);
- return;
- }
- #ifdef ENTERPRISE_VERSION
- if (::CheckFolderFileExist(g_path1) == 0)
- ::CreateDirectory(g_path1, NULL);
- #endif
- if (!::CheckFolderFileExist(g_path1))
- {
- AfxMessageBox("原片保存机器目录未设置, 请通知系统管理员!", MB_ICONINFORMATION);
- return;
- }
- CString savepath;
- if (g_bAllBranch)
- {
- CString branchpath = GetBranchPhotoPath(branch);
- savepath = g_path1 + branchpath + "\\";
- if (::CheckFolderFileExist(savepath) == 0)
- ::CreateDirectory(savepath, NULL);
- }
- else
- savepath = g_path1 + "\\";
- savepath += strOrderNumber + "\\";
- if (::CheckFolderFileExist(savepath) == 0)
- ::CreateDirectory(savepath, NULL);
- CString calnopath = savepath;
- savepath += dindanjd + "\\";
- if (::CheckFolderFileExist(savepath) == 0)
- ::CreateDirectory(savepath, NULL);
- CString Filter = "图片文件 (*.jpg)|*.jpg|原始格式RAW (*.raw)|*.raw|原始格式NEF (*.nef)|*.nef|原始格式CR2 (*.cr2)|*.cr2||";
- // .选择要导入的相片,可多选;
- CFileDialog fdlg(true, NULL, "openfile", OFN_ALLOWMULTISELECT, Filter);
- TCHAR szBuffer[60000] = { 0 };
- fdlg.m_ofn.lpstrFile = szBuffer;
- fdlg.m_ofn.nMaxFile = 60000;
- if (fdlg.DoModal() != IDOK)
- {
- // .拍摄人员确认 SelWaiter2;
- SelWaiter2 waiterdlg;
- waiterdlg.waiter1 = waiter1;
- waiterdlg.waiter12 = waiter12;
- waiterdlg.waiter2 = waiter2;
- waiterdlg.waiter22 = waiter22;
- waiterdlg.beginno = beginno;// Jeff,实际上SelWaiter::beginno并没有任何作用,这里放置具有误导性!
- if (waiterdlg.DoModal() != IDOK)return;
- waiter1 = waiterdlg.waiter1;
- waiter12 = waiterdlg.waiter12;
- waiter2 = waiterdlg.waiter2;
- waiter22 = waiterdlg.waiter22;
- beginno = waiterdlg.beginno;
- CString status;
- // .拍照状态确认.对话框.
- TakeStautsSel dlg2;
- if (status2 == "OK") // .拍照状态为ok时;
- {
- dlg2.m_check1 = 1;
- // Jeff.add:已经是ok的拍照状态,禁用用户修改该状态;IDC_CHECK1
- //dlg2.DisEnableCheck();
- dlg2.m_bCheckEnalbe = FALSE;
- }
- dlg2.DoModal();
- if (dlg2.m_radio1 == 0)
- {
- status = "OK";
- }
- else if (dlg2.m_radio1 == 1)
- {
- status = "拍摄中";
- //dlg2.CheckChange();
- }
- else
- {
- status = "未拍";
- //dlg2.CheckChange();
- }
- #if 1
- //本次选择ok时,需要再检查一下,看是否全部都已经ok;
- // 此时iItem为有订单号的头景点;
- // printf("Jeff:景点拍照完成,nTopItem=%d\n\n",nTopItem);
- bOK = TRUE;
- status2 = "OK";
- int nItem = nTopItem;
- if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK")
- {
- if (nItem != iItemBak)
- {
- status2 = "拍摄中";
- // printf("Jeff:景点%d拍照完成\n\n",nItem);
- bOK = FALSE;
- }
- else if (status != "OK")
- {
- status2 = "拍摄中";
- // printf("Jeff:景点%d拍照完成\n\n",nItem);
- bOK = FALSE;
- }
- }
- // .子景点(如果有的话);
- ++nItem;
- while (nItem < itemcount && m_List1.GetItemText(nItem, 0 + m_nAdd) == "" && status2 != "拍摄中")
- {
- if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK" && iItemBak != nItem) // Jeff.如果只有两个景点这里出错:第一个ok,第二个未拍;这里会跳出;
- {
- status2 = "拍摄中";
- bOK = FALSE;
- // printf("Jeff:景点%d拍照完成\n\n",nItem);
- break;
- }
- else
- {
- if (status != "OK")
- {
- status2 = "拍摄中";
- bOK = FALSE;
- }
- }
- ++nItem;
- }
- if (bOK) status2 = "OK";
- #endif
- #if 1
- //if ( !bOK )
- // status2 = "拍摄中";
- //else if(dlg2.m_check1) // .拍照景点全部ok状态;
- // status2 = "OK";
- CString sql;
- if (dlg2.m_check1)
- {
- status2 = "OK";
- // Jeff:如果有多个景点,全部设置为拍照ok;
- // 需要遍历处理;
- sql.Format("update dindanjd set [status]='OK' where id='%s'", strOrderNumber);
- // printf("Jeff:全部景点选择拍照OK,SQL=%s\n\n",sql);
- }
- #endif
- //CString sql;
- //sql="update dindanjd set [status]='"+status+"',[waiter1]='"+waiter1+"',[waiter12]='"+waiter12+"',[waiter2]='"+waiter2+"',[waiter22]='"+waiter22+"' where [id]='"+id+"' and [name]='"+dindanjd+"'";
- sql += "***update dindanjd set [status]='" + status + "',[waiter1]='" + waiter1 + "',[waiter12]='" + waiter12 + "',[waiter2]='" + waiter2 + "',[waiter22]='" + waiter22 + "' where [id]='" + strOrderNumber + "' and [name]='" + dindanjd + "'";
- #ifndef LYFZ_VERSION
- if (jdpos == 0)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter1]='" + waiter1 + "',[waiter2]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
- else if (jdpos == 1)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter12]='" + waiter1 + "',[waiter22]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
- else if (jdpos == 2)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter13]='" + waiter1 + "',[waiter23]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
- else if (jdpos == 3)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter14]='" + waiter1 + "',[waiter24]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
- else
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end where [id]='" + strOrderNumber + "'";
- #else
- sql+="***update dindan set [status]=case when [status]<>'OK' then '"+status2+"' else [status] end where [id]='"+strOrderNumber+"'";
- #endif
- CString sql2;
- if (1)
- {
- sql2 = "***gentakecontent:" + strOrderNumber;
- sql += sql2;
- }
- g_sendhead.bsql = 1;
- if (g_bAllBranch)
- {
- g_branchip = GetIP(branch);
- g_pMainWnd->OnDisconnect();
- g_branchname = branch;
- g_bBranchModify = 1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0;
- g_branchip = g_branchname = "";
- }
- else
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)return;
- if (g_bAllBranch == 0)
- {
- GetData();
- }
- else
- {
- BOOL bFind = 0;
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- if (bFind && m_List1array.ElementAt(i).ElementAt(1) != "")break;
- if (strOrderNumber == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
- {
- bFind = 1;
- }
- if (bFind && dindanjd == m_List1array.ElementAt(i).ElementAt(4))
- {
- m_List1array.ElementAt(i).SetAt(7 + m_nAdd, waiter1);
- m_List1array.ElementAt(i).SetAt(8 + m_nAdd, waiter12);
- m_List1array.ElementAt(i).SetAt(9 + m_nAdd, waiter2);
- m_List1array.ElementAt(i).SetAt(10 + m_nAdd, waiter22);
- m_List1array.ElementAt(i).SetAt(5 + m_nAdd, status);
- FillGrid();
- break;
- }
- }
- }
- return;
- }
- pos = fdlg.GetStartPosition();
- CStringArray array;
- while (pos != NULL)
- {
- array.Add(fdlg.GetNextPathName(pos));
- }
- if (array.GetSize() == 0)return;
- if (1)
- {
- CString str;
- str.Format("%s\r\n%s\r\n景点:%s\r\n确认您选中的照片与客户资料相符吗? 是否继续?", name, phone, dindanjd);
- if (AfxMessageBox(str, MB_YESNO | MB_ICONINFORMATION) != IDYES)
- return;
- }
- SelWaiter2 waiterdlg;
- waiterdlg.waiter1 = waiter1;
- waiterdlg.waiter12 = waiter12;
- waiterdlg.waiter2 = waiter2;
- waiterdlg.waiter22 = waiter22;
- waiterdlg.beginno = beginno;
- if (waiterdlg.DoModal() != IDOK)return;
- waiter1 = waiterdlg.waiter1;
- waiter12 = waiterdlg.waiter12;
- waiter2 = waiterdlg.waiter2;
- waiter22 = waiterdlg.waiter22;
- beginno = waiterdlg.beginno;
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- // 导入拍照好的相片;
- ImportPhoto dlg;
- dlg.beginno = beginno; // 当前订单相片编号;
- dlg.m_bOfmat = 1; // 未知;
- dlg.m_branch = branch; // 分店名称;
- dlg.m_nphototype = 0; // 相片类型,==0表示原片;
- dlg.m_calnopath = calnopath; // 未知;
- dlg.m_mode = 2; // 未知;
- dlg.m_bOrigin = 1; // 未知;
- dlg.m_pArray = &array; // 要导入的相片路径集合;
- dlg.m_savepath = savepath; // 保存相片的目录;
- #ifdef ENTERPRISE_VERSION
- // if(!g_branchname.IsEmpty())
- {
- dlg.m_id = strOrderNumber;
- dlg.m_bSaveUploadTask = g_bSaveUploadTask1;
- dlg.m_sel = g_cominfoarraylocal.ElementAt(0).ElementAt(78);
- dlg.m_uploadtaskarray.Add(strOrderNumber + ";" + name);
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- }
- #endif
- dlg.DoModal();
- // Jeff.每次重新导入相片时,都删除ok文件;
- beginno = dlg.beginno;
- savepath += "ok";
- ::DeleteFile(savepath); // 删除ok文件;
- CString status;
- TakeStautsSel dlg2;
- if (status2 == "OK")
- {
- dlg2.m_check1 = 1;
- dlg2.m_bCheckEnalbe = FALSE;
- }
- dlg2.DoModal();
- if (dlg2.m_radio1 == 0)
- {
- status = "OK";
- }
- else if (dlg2.m_radio1 == 1)
- {
- status = "拍摄中";
- //dlg2.CheckChange();
- }
- else
- {
- status = "未拍";
- //dlg2.CheckChange();
- }
- #if 1
- //本次选择ok时,需要再检查一下,看是否全部都已经ok;
- // 此时iItem为有订单号的头景点;
- // printf("Jeff:景点拍照完成,nTopItem=%d\n\n",nTopItem);
- bOK = TRUE;
- status2 = "OK";
- int nItem = nTopItem;
- if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK")
- {
- if (nItem != iItemBak)
- {
- status2 = "拍摄中";
- // printf("Jeff:景点%d拍照完成\n\n",nItem);
- bOK = FALSE;
- }
- else if (status != "OK")
- {
- status2 = "拍摄中";
- // printf("Jeff:景点%d拍照完成\n\n",nItem);
- bOK = FALSE;
- }
- }
- // .子景点(如果有的话);
- ++nItem;
- while (nItem < itemcount && m_List1.GetItemText(nItem, 0 + m_nAdd) == "" && status2 != "拍摄中")
- {
- if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK" && iItemBak != nItem) // Jeff.如果只有两个景点这里出错:第一个ok,第二个未拍;这里会跳出;
- {
- status2 = "拍摄中";
- bOK = FALSE;
- // printf("Jeff:景点%d拍照完成\n\n",nItem);
- break;
- }
- else
- {
- if (status != "OK")
- {
- status2 = "拍摄中";
- bOK = FALSE;
- }
- }
- ++nItem;
- }
- if (bOK) status2 = "OK";
- #endif
- #if 1
- //if ( !bOK )
- // status2 = "拍摄中";
- //else if(dlg2.m_check1) // .拍照景点全部ok状态;
- // status2 = "OK";
- CString sql;
- if (dlg2.m_check1)
- {
- status2 = "OK";
- // Jeff:如果有多个景点,全部设置为拍照ok;
- // 需要遍历处理?;
- // 批量处理某个订单的就可以了;
- // SQL:update dindanjd set [status]='OK' where id='';
- // CString SQL;
- sql.Format("update dindanjd set [status]='OK' where id='%s'", strOrderNumber);
- // printf("Jeff:全部景点选择拍照OK,SQL=%s\n\n",sql);
- }
- #endif
- //CString sql;
- //sql="update dindanjd set [status]='"+status+"',[date]='"+g_date+"',[waiter1]='"+waiter1+"',[waiter12]='"+waiter12+"',[waiter2]='"+waiter2+"',[waiter22]='"+waiter22+"' where [id]='"+id+"' and [name]='"+dindanjd+"'";
- sql += "***update dindanjd set [status]='" + status + "',[date]='" + g_date + "',[waiter1]='" + waiter1 + "',[waiter12]='" + waiter12 + "',[waiter2]='" + waiter2 + "',[waiter22]='" + waiter22 + "' where [id]='" + strOrderNumber + "' and [name]='" + dindanjd + "'";
- CString sbeginno;
- sbeginno.Format("%d", beginno);
- #ifdef LYFZ_VERSION
- //sql+="***update dindan set [status]='"+status2+"' where [id]='"+id+"'";//旧文;
- sql+="***update dindan set [status]=case when [status]<>'OK' then '"+status2+"' else [status] end"+" where [id]='"+id+"'";
- #else
- // dindan time2为拍照时间,在第一次ok时,这个时间不能再修改;
- // Jeff.SQL参考例子:
- // update dindan set time2='2014-06-28' where id='20140628-007' and isnull(time2,'')=''
- #if 0 // 原.
- if(jdpos==0)
- sql+="***update dindan set [status]='"+status2+"',[waiter1]='"+waiter1+"',[waiter2]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
- else if(jdpos==1)
- sql+="***update dindan set [status]='"+status2+"',[waiter12]='"+waiter1+"',[waiter22]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
- else if(jdpos==2)
- sql+="***update dindan set [status]='"+status2+"',[waiter13]='"+waiter1+"',[waiter23]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
- else if(jdpos==3)
- sql+="***update dindan set [status]='"+status2+"',[waiter14]='"+waiter1+"',[waiter24]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
- else
- sql+="***update dindan set [status]='"+status2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
- #else
- //--------------------------------------------------------------------------
- // Jeff.SQL参考语句示例:
- // update dindan set time2=case when isnull(time2,'')='' then '2014-07-28' else time2 end , name2='OK',time3='2015-01-01',time1='2014-05-30' where id='20140628-007'
- //
- //---------------------------------------------------------------------
- // printf("Jeff:拍照状态=%s\n\n",status2);
- if (status2 != "OK") // !=ok,不记录拍照时间;--这样是否合理?
- {
- // 当数据库原本status不为OK时,可以修改时间和状态;否则状态和时间都不能修改,保持原样;
- if (jdpos == 0)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter1]='" + waiter1 + "',[waiter2]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else if (jdpos == 1)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter12]='" + waiter1 + "',[waiter22]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else if (jdpos == 2)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter13]='" + waiter1 + "',[waiter23]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else if (jdpos == 3)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter14]='" + waiter1 + "',[waiter24]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[curno]='" + sbeginno + "' where [id]='" + strOrderNumber + "'";
- // printf("Jeff:拍照中,SQL=%s\n\n",sql);
- }
- else // ==ok时,才记录拍照时间;
- {
- /*if(jdpos==0)
- sql+="***update dindan set [status]='"+status2+"',[waiter1]='"+waiter1+"',[waiter2]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";
- else if(jdpos==1)
- sql+="***update dindan set [status]='"+status2+"',[waiter12]='"+waiter1+"',[waiter22]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" +" where [id]='"+id+"'";
- else if(jdpos==2)
- sql+="***update dindan set [status]='"+status2+"',[waiter13]='"+waiter1+"',[waiter23]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";
- else if(jdpos==3)
- sql+="***update dindan set [status]='"+status2+"',[waiter14]='"+waiter1+"',[waiter24]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";
- else
- sql+="***update dindan set [status]='"+status2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";*/
- // 当数据库原本status为OK时,不可修改时间;否则可以修改时间;
- if (jdpos == 0)
- sql += "***update dindan set [status]='" + status2 + "',[waiter1]='" + waiter1 + "',[waiter2]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else if (jdpos == 1)
- sql += "***update dindan set [status]='" + status2 + "',[waiter12]='" + waiter1 + "',[waiter22]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else if (jdpos == 2)
- sql += "***update dindan set [status]='" + status2 + "',[waiter13]='" + waiter1 + "',[waiter23]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else if (jdpos == 3)
- sql += "***update dindan set [status]='" + status2 + "',[waiter14]='" + waiter1 + "',[waiter24]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else
- sql += "***update dindan set [status]='" + status2 + "',[curno]='" + sbeginno + "', [time2]=case when isnull([time2],'')='' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- // printf("Jeff:拍照OK,SQL=%s\n\n",sql);
- }
- #endif
- #endif
- /////////////////////////
- CString m_name1 = m_List1.GetItemText(iItem, 1 + m_nAdd);
- CString m_name2 = m_List1.GetItemText(iItem, 2 + m_nAdd);
- CString m_phone1 = m_List1.GetItemText(iItem, 14 + m_nAdd);
- CString m_phone2 = m_List1.GetItemText(iItem, 15 + m_nAdd);
- if (g_bAllBranch)
- {
- for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
- {
- if (strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && branch == m_List1arrayBak.ElementAt(i).ElementAt(0))
- {
- m_phone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
- m_phone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
- }
- }
- }
- else
- {
- for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
- {
- if (strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0))
- {
- m_phone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
- m_phone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
- }
- }
- }
- CString sql2;
- BOOL msgcheck = atoi(g_cominfoarray.ElementAt(0).ElementAt(101));
- CString msgcontent = g_cominfoarray.ElementAt(0).ElementAt(105);
- if (status != "OK")msgcheck = 0;
- #ifdef CHILD_VERSION
- if(msgcheck )
- {
- CString m_content3 = msgcontent;
- CString str,timestamp;
- timestamp="msgtimestamp";
- {
- CString name;
- if(!m_name1.IsEmpty ())
- name=m_name1+",";
- name+=m_name2;
- name.TrimRight (",");
- if(name.IsEmpty ()==0 && CheckPhoneType(m_phone1)!=-1 && CheckBadWords(name,0) )
- {
- str=name+m_content3;
- str.Replace ("xxx小朋友", "");
- int count=GetLengthEx(str)/MSG_LENGTH;
- if(GetLengthEx(str)%MSG_LENGTH)
- count++;
- CString scount;
- scount.Format ("%d", count);
- #if JEFF_TEST_ON
- sql2.Format(INSERT_SENDREG, _T("11"), m_phone1, str, timestamp, scount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
- sql += _T("***") + sql2;
- #else
- sql2="***insert into sendreg([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('"+m_phone1+"','"+str+"','"+timestamp+"','"+scount+"','0','0','0','系统自动发送')";
- sql+=sql2;
- #endif
- }
- }
- }
- #else
- if (msgcheck)
- {
- CString m_content3 = msgcontent;
- CString str, timestamp;
- timestamp = "msgtimestamp";
- int pos = m_content3.Find("xxx先生/女士");
- if (pos != -1)
- {
- if (m_name1.IsEmpty() == 0 && CheckPhoneType(m_phone1) != -1 && CheckBadWords(m_name1, 0) )
- {
- str = m_content3;
- str.Replace("xxx先生/女士", m_name1 + "先生");
- int count = GetLengthEx(str) / MSG_LENGTH;
- if (GetLengthEx(str) % MSG_LENGTH)
- count++;
- CString scount;
- scount.Format("%d", count);
- #if JEFF_TEST_ON
- sql2.Format(INSERT_SENDREG, _T("11"), m_phone1, str, timestamp, scount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
- sql += _T("***") + sql2;
- #else
- sql2 = "***insert into sendreg([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('" + m_phone1 + "','" + str + "','" + timestamp + "','" + scount + "','0','0','0','系统自动发送')";
- sql += sql2;
- #endif
- }
- if (m_name2.IsEmpty() == 0 && CheckPhoneType(m_phone2) != -1 && CheckBadWords(m_name2, 0) )
- {
- str = m_content3;
- str.Replace("xxx先生/女士", m_name2 + "女士");
- int count = GetLengthEx(str) / MSG_LENGTH;
- if (GetLengthEx(str) % MSG_LENGTH)
- count++;
- CString scount;
- scount.Format("%d", count);
- CTime tm = CTime::GetCurrentTime();
- tm += CTimeSpan(0, 0, 0, 3);
- timestamp = tm.Format("%Y%m%d%H%M%S");
- timestamp = "msgtimexxstamp";
- #if JEFF_TEST_ON
- sql2.Format(INSERT_SENDREG, _T("11"), m_phone2, str, timestamp, scount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
- sql += _T("***") + sql2;
- #else
- sql2 = "***insert into sendreg([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('" + m_phone2 + "','" + str + "','" + timestamp + "','" + scount + "','0','0','0','系统自动发送')";
- sql += sql2;
- #endif
- }
- }
- }
- #endif
- /////////////////////////
- if (1)//拍照OK时记录客人预定内容
- {
- sql2 = "***gentakecontent:" + strOrderNumber;
- sql += sql2;
- }
- g_sendhead.bsql = 1;
- if (g_bAllBranch)
- {
- g_branchip = GetIP(branch);
- g_pMainWnd->OnDisconnect();
- g_branchname = branch;
- g_bBranchModify = 1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0;
- g_branchip = g_branchname = "";
- }
- else
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)
- return;
- AfxMessageBox("导入客照成功!", MB_ICONINFORMATION);
- WriteLog(_T("拍照导入相片"));
- if (g_bAllBranch == 0)
- {
- GetData();
- }
- else
- {
- BOOL bFind = 0;
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- if (bFind && m_List1array.ElementAt(i).ElementAt(1) != "")break;
- if (strOrderNumber == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
- {
- bFind = 1;
- }
- if (bFind && dindanjd == m_List1array.ElementAt(i).ElementAt(4))
- {
- m_List1array.ElementAt(i).SetAt(7 + m_nAdd, waiter1);
- m_List1array.ElementAt(i).SetAt(8 + m_nAdd, waiter12);
- m_List1array.ElementAt(i).SetAt(9 + m_nAdd, waiter2);
- m_List1array.ElementAt(i).SetAt(10 + m_nAdd, waiter22);
- m_List1array.ElementAt(i).SetAt(5 + m_nAdd, status);
- m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date);
- m_List1array.ElementAt(i).SetAt(3 + m_nAdd, sbeginno);
- FillGrid();
- break;
- }
- }
- }
- }
- void TakeFrom::OnBUTshowphoto() // 查看原片
- {
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_List1.GetNextSelectedItem(pos);
- CString dindanjd = m_List1.GetItemText(iItem, 4 + m_nAdd);
- CString branch;
- CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- if (g_bAllBranch)
- branch = m_List1.GetItemText(iItem, 0);
- while (id == "")
- {
- iItem--;
- id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- }
- CString name = m_List1.GetItemText(iItem, 1 + m_nAdd) + "," + m_List1.GetItemText(iItem, 2 + m_nAdd);
- name.TrimLeft(",");
- name.TrimRight(",");
- name = "客人:" + name;
- ShowPic dlg;
- dlg.m_id = id;
- dlg.m_name = name;
- dlg.m_mode = 1;
- if (g_bAllBranch)
- {
- dlg.m_branch = branch;
- CString branchpath = GetBranchPhotoPath(branch);
- dlg.m_path = g_path1 + branchpath + "\\";
- }
- else
- dlg.m_path = g_path1 + "\\";
- dlg.m_path += id;
- dlg.m_path += "\\";
- if (g_pMainWnd->IsCtrlDown() == 0 && g_pMainWnd->IsShiftDown() == 0 && dindanjd != "")
- {
- if (AfxMessageBox("是否查看全部景点?", MB_YESNO | MB_ICONINFORMATION) != IDYES)
- {
- if (dindanjd == "系统默认景点")
- {
- if (::PathFileExists(dlg.m_path + dindanjd))
- {
- dlg.m_path += dindanjd;
- dlg.m_path += "\\";
- }
- }
- else
- {
- dlg.m_path += dindanjd;
- dlg.m_path += "\\";
- }
- }
- }
- else if (g_pMainWnd->IsCtrlDown())
- {
- if (dindanjd == "系统默认景点")
- {
- if (::PathFileExists(dlg.m_path + dindanjd))
- {
- dlg.m_path += dindanjd;
- dlg.m_path += "\\";
- }
- }
- else
- {
- dlg.m_path += dindanjd;
- dlg.m_path += "\\";
- }
- }
- dlg.DoModal();
- if (dlg.m_bdelall)
- {
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- if (g_bAllBranch)
- {
- if (id == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
- {
- #if JEFF_TEST_ON // 全部删除后,这里显示的值应该为0;
- m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "0");
- #else
- m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "1");
- #endif
- FillGrid();
- break;
- }
- }
- else
- {
- if (id == m_List1array.ElementAt(i).ElementAt(0))
- {
- #if JEFF_TEST_ON // 全部删除后,这里显示的值应该为0;
- m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "0");
- #else
- m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "1");
- #endif
- FillGrid();
- break;
- }
- }
- }
- }
- }
- void TakeFrom::OnBUTmoney() // 今拍 按钮;
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_filter.TrimLeft();
- m_filter.TrimRight();
- FillGrid(2);
- }
- void TakeFrom::OnBTNaddsp()
- {
- }
- void TakeFrom::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- return;
- }
- int iItem = m_List1.GetNextSelectedItem(pos);
- if (IsHasRights2new(4) || IsHasRights2new(49))
- {
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
- }
- else
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
- *pResult = 0;
- }
- void TakeFrom::OnButton1() // 查询按钮;
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_filter.TrimLeft();
- m_filter.TrimRight();
- FillGrid();
- }
- void TakeFrom::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);
- while (g_id == "")
- {
- iItem--;
- g_id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- }
- *pResult = 0;
- }
- void TakeFrom::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- OnBUTshowphoto();
- *pResult = 0;
- }
- void TakeFrom::HidePrice()
- {
- m_List1arrayBak.RemoveAll();
- m_List1arrayBak.SetSize(m_List1array.GetSize());
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- m_List1arrayBak.ElementAt(i).Copy(m_List1array.ElementAt(i));
- }
- #ifdef LKAY_VERSION
- if(IsHasRights2new(31))return;
- for( i=0; i<m_List1array.GetSize (); i++)
- {
- m_List1array.ElementAt (i).SetAt (11+m_nAdd, "***");
- m_List1array.ElementAt (i).SetAt (12+m_nAdd, "***");
- m_List1array.ElementAt (i).SetAt (13+m_nAdd, "***");
- m_List1array.ElementAt (i).SetAt (14+m_nAdd, "***");
- }
- #else
- if (IsHasRights2new(31))return;
- for (i = 0; i < m_List1array.GetSize(); i++)
- {
- m_List1array.ElementAt(i).SetAt(13 + m_nAdd, "***");
- m_List1array.ElementAt(i).SetAt(14 + m_nAdd, "***");
- }
- #endif
- }
- void TakeFrom::OnBtnsearchfilter() // 条件查询按钮;
- {
- SearchFilter dlg;
- dlg.m_mode = 0;
- if (dlg.DoModal() == IDOK)
- FillGrid();
- g_bSearchFilter = 0;
- }
- void TakeFrom::OnBUTprint3()
- {
- GetData();
- }
- void TakeFrom::OnButton2() // 客人头像按钮;
- {
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要拍头像的客人!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_List1.GetNextSelectedItem(pos);
- CString branch;
- CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- if (g_bAllBranch)
- branch = m_List1.GetItemText(iItem, 0);
- while (id == "")
- {
- iItem--;
- id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- }
- UploadPhoto dlg;
- if (g_bAllBranch)
- {
- CString branchpath = GetBranchPhotoPath(branch);
- dlg.m_path = g_path1 + branchpath + "\\";
- if (::CheckFolderFileExist(dlg.m_path) == 0)
- ::CreateDirectory(dlg.m_path, NULL);
- }
- else
- dlg.m_path = g_path1 + "\\";
- dlg.m_path += "客人头像\\";
- if (::CheckFolderFileExist(dlg.m_path) == 0)
- ::CreateDirectory(dlg.m_path, NULL);
- dlg.m_path += id + "\\";
- if (::CheckFolderFileExist(dlg.m_path) == 0)
- ::CreateDirectory(dlg.m_path, NULL);
- dlg.DoModal();
- }
- void TakeFrom::GetData()
- {
- if (g_bAllBranch == 0)
- {
- if (g_bShowOK == 0)
- {
- #ifdef LKAY_VERSION
- CString filter="status3='未取' and (dindantype<>'意向客户' or dindantype is null)";
- #else
- CString filter = "status3='未取'";
- #endif
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if (g_bSendOK == 0)return;
- }
- else
- {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
- g_sendhead.tabcount = 1;
- #ifdef LKAY_VERSION
- CString filter="dindantype<>'意向客户' or dindantype is null";
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- #else
- g_pMainWnd->ProcessChatMessageRequest2(1);
- #endif
- if (g_bSendOK == 0)return;
- }
- DataToArray(&m_List1array);
- }
- else
- {
- //////////////数据汇总
- m_List1array.RemoveAll();
- 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);
- if (g_bShowOK == 0)
- {
- CString filter = "status3='未取'";
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if (g_bSendOK == 0) continue;
- }
- else
- {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- if (g_bSendOK == 0) 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++;
- }
- }
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0;
- g_branchip = g_branchname = "";
- }
- HidePrice();
- FillGrid();
- }
- void TakeFrom::OnBnClickedMicroshare() // 微分享;
- {
- // 定义变量;
- CString strOrderNumber = _T(""); // 订单号;
- CString strScenery = _T(""); // 景点名;
- CString strCustomer = _T(""); // 顾客姓名;
- CString strMakeupArtist = _T(""); // 化妆师;
- CString strSourcePath = _T(""); // 相片根目录;
- CString strBranchName = _T(""); // 分店名;
- CString strBranchDomain = _T(""); // 分店域名;
- TCHAR szShareId[MAX_PATH] = _T(""); // 微分享相册ID;
- // 获取变量值;
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_List1.GetNextSelectedItem(pos);
- strScenery = m_List1.GetItemText(iItem, 4 + m_nAdd);
- strMakeupArtist = m_List1.GetItemText(iItem, 9 + m_nAdd);
- strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
- if (g_bAllBranch)
- strBranchName = m_List1.GetItemText(iItem, 0);
- while (strOrderNumber == "")
- {
- iItem--;
- strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
- }
- if (g_bAllBranch)
- {
- strBranchDomain = GetBranchPhotoPath(strBranchName);
- strSourcePath = g_path1 + strBranchDomain + "\\";
- }
- else
- {
- strSourcePath = g_path1 + "\\";
- }
- strSourcePath += strOrderNumber;
- strSourcePath += "\\";
- if (AfxMessageBox("是否查看全部景点?", MB_YESNO | MB_ICONINFORMATION) != IDYES)
- {
- if (::PathFileExists(strSourcePath + strScenery))
- {
- strSourcePath += strScenery;
- strSourcePath += "\\";
- }
- }
- // 加载动态库;
- if (LoadMicroShareLibrary() == FALSE)
- return;
- if ( g_lyfzCreateShare )
- {
- g_lyfzCreateShare(
- g_cominfoarray.ElementAt(0).ElementAt(147), // 微分享的登录账号;
- g_cominfoarray.ElementAt(0).ElementAt(148), // 微分享的登录账号密码;
- g_path1, // 相片根级目录;
- strBranchDomain, // 分店域名;
- strOrderNumber, // 订单号,用于生成二维码文件名;
- strScenery, // 景点名;
- strSourcePath,
- m_List1.GetItemText(iItem, 1 + m_nAdd), // 客人姓名1 ;
- m_List1.GetItemText(iItem, 2 + m_nAdd), // 客人姓名2
- strMakeupArtist, // 化妆师;
- szShareId // 返回微相册ID;
- );
- }
- FreeMicroShareLibrary();
- }
|