// BeautifySkinFrom2.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "BeautifySkinFrom2.h" #include "MyMdi.H" #include "ModifyDinDan.h" #include "InputPsw.h" #include "ImportPhoto.h" #include "ShowPic.h" #include "SelectPhotoDlg.h" #include "./helper/ffsco.h" #include "ShowCut.h" #include "CompressOption.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif //#pragma comment(lib, "Shlwapi.lib") ///////////////////////////////////////////////////////////////////////////// // BeautifySkinFrom2 IMPLEMENT_DYNCREATE(BeautifySkinFrom2, MyFormView) BeautifySkinFrom2::BeautifySkinFrom2() : MyFormView(BeautifySkinFrom2::IDD) { //{{AFX_DATA_INIT(BeautifySkinFrom2) m_filter = _T(""); m_nAdd=0; //}}AFX_DATA_INIT if(g_bAllBranch) { m_nAdd=1; } } BeautifySkinFrom2::~BeautifySkinFrom2() { } void BeautifySkinFrom2::DoDataExchange(CDataExchange* pDX) { MyFormView::DoDataExchange(pDX); //{{AFX_DATA_MAP(BeautifySkinFrom2) 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); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(BeautifySkinFrom2, MyFormView) //{{AFX_MSG_MAP(BeautifySkinFrom2) 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_BUTexportphoto, OnBUTexportphoto) ON_BN_CLICKED(IDC_BUTexportphoto2, OnBUTexportphoto2) ON_BN_CLICKED(IDC_BUTTON2, OnButton2) ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2) ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2) ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter) ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // BeautifySkinFrom2 diagnostics #ifdef _DEBUG void BeautifySkinFrom2::AssertValid() const { MyFormView::AssertValid(); } void BeautifySkinFrom2::Dump(CDumpContext& dc) const { MyFormView::Dump(dc); } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // BeautifySkinFrom2 message handlers void BeautifySkinFrom2::OnInitialUpdate() { MyFormView::OnInitialUpdate(); // TODO: Add your specialized code here and/or call the base class 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); int idarray[]={IDC_BUTprint3,IDC_BUTexportphoto,IDC_BUTimportphoto,IDC_BUTshowphoto,IDC_BUTexportphoto2,IDC_BUTclose}; int idcount=6; 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 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 (122); } else { #ifdef CHILD_VERSION m_List1.SetHeadings("店名,100;订单号,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;女宾电话,100" ); #endif m_List1.LoadColumnInfo (198); GetDlgItem(IDC_BUTprint3)->ShowWindow (1); } 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 ()); GetDlgItem(IDC_BUTexportphoto)->EnableWindow(IsHasRights2new(10)); GetDlgItem(IDC_BUTexportphoto2)->EnableWindow(IsHasRights2new(11)); } void BeautifySkinFrom2::FillGrid(BOOL bStatus) { if(g_bSearchFilter) { m_List1.DeleteAllItems2 (); int ii=0; m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 ); int count=0; { for(ii=0; iig_filterdate2) continue; } if(g_waiter1!="") { if(m_List1array.ElementAt (ii).ElementAt (11+m_nAdd)!=g_waiter1) continue; } if(g_bAllBranch && g_filterbranch!="") { if(m_List1array.ElementAt (ii).ElementAt (0)!= g_filterbranch) continue; } if(1) { m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii)); } } } 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 { m_List1.DeleteAllItems2 (); int ii=0; m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 ); int count=0; if(m_filter.IsEmpty ()) { if(bStatus) { for(ii=0; iiSendMessage(WM_CLOSE); } void BeautifySkinFrom2::OnSelchangeCombo1() { // TODO: Add your control notification handler code here SetTimer(1, 100, NULL); } void BeautifySkinFrom2::OnTimer(UINT nIDEvent) { // TODO: Add your message handler code here and/or call default KillTimer(nIDEvent); OnButton1(); } BOOL BeautifySkinFrom2::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(...) { } } void BeautifySkinFrom2::OnBUTimportphoto() { // TODO: Add your control notification handler code here 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); CString oldstatus=m_List1.GetItemText (iItem, 6+m_nAdd); CString time9=m_List1.GetItemText (iItem, 7+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, 15+m_nAdd)+","+m_List1.GetItemText (iItem, 16+m_nAdd); phone.TrimLeft (","); phone.TrimRight (","); phone="电话:"+phone; #ifdef ENTERPRISE_VERSION if(::CheckFolderFileExist (g_path4)==0) ::CreateDirectory (g_path4, NULL); #endif if(!::CheckFolderFileExist (g_path4)) { AfxMessageBox("精修片保存机器目录未设置, 请通知系统管理员!", MB_ICONINFORMATION); return; } CString savepath; if(g_bAllBranch) { CString branchpath=GetBranchPhotoPath(branch); savepath=g_path4+branchpath+"\\"; if(::CheckFolderFileExist (savepath)==0) ::CreateDirectory (savepath, NULL); } else savepath=g_path4+"\\"; savepath+=id+"\\"; if(::CheckFolderFileExist (savepath)==0) ::CreateDirectory (savepath, NULL); /* IsGrowthTx growthtxdlg; growthtxdlg.m_id=id; growthtxdlg.DoModal (); if(growthtxdlg.m_bReturnOK==0) return; if(growthtxdlg.m_bGrowthTx && growthtxdlg.m_seltxname.IsEmpty ()) return; if(!growthtxdlg.m_seltxname.IsEmpty ()) { savepath+=growthtxdlg.m_seltxname+"\\"; if(::CheckFolderFileExist (savepath)==0) ::CreateDirectory (savepath, NULL); }*/ CString srcdir;CString str; GetSavePath(srcdir); if(srcdir.IsEmpty()) { CString status6; if(AfxMessageBox("客照是否全部精修完毕?", MB_YESNO|MB_ICONINFORMATION)==IDYES) status6="OK"; else status6="修片中"; CString sql; if(time9.IsEmpty ()) sql="update dindan set status6='"+status6+"',time9='"+g_date+"' where id='"+id+"'"; else sql="update dindan set status6='"+status6+"' where id='"+id+"'"; 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 { for(int i=0; iOnDisconnect(); 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; savepath+="ok"; ::DeleteFile (savepath); AfxMessageBox("导入客照成功!", MB_ICONINFORMATION); if(g_bAllBranch==0) { GetData(); } else { for(int i=0; iGetSize(); i++) { if(pArray->ElementAt(i)==Str) return i; } return -1; } void BeautifySkinFrom2::GetNo(CString str, CStringArray &array) { if(!str.IsEmpty ()) { int pos=str.Find (","); while(pos!=-1) { if(FindArray(&array, str.Left (pos))==-1) array.Add (str.Left (pos)); str=str.Right (str.GetLength ()-pos-1); pos=str.Find (","); } if(FindArray(&array, str)==-1) array.Add(str); } } CString BeautifySkinFrom2::GetSelName(CString name, CArray&spnamearray) { CString ret; name=","+name+","; CString str; for(int i=0; i'入册' and name<>'入底'"; if(m_seltxname!="" && m_seltxname!="全部") { filter="id='"+id+"' and growthtxname='"+m_seltxname+"';id='"+id+"';id='"+id+"' and name<>'入册' and name<>'入底'"; } #else CString filter="id='"+id+"';id='"+id+"';id='"+id+"' and kind<>'2' and name<>'入册' and name<>'入底'"; #endif g_sendhead.bsql=0; g_sendhead.code[0]=50; g_sendhead.code[1]=11; g_sendhead.code[2]=56; g_sendhead.tabcount=3; if(g_bAllBranch) { g_branchip=GetIP(branch); g_pMainWnd->OnDisconnect(); g_branchname=branch; g_bBranchModify=1; g_pMainWnd->ProcessChatMessageRequest2(filter); g_pMainWnd->OnDisconnect();g_bBranchModify=0;g_branchip=g_branchname=""; } else g_pMainWnd->ProcessChatMessageRequest2(filter); if(g_bSendOK==0)return; CArraysparray; CArraysparray2; DataToArray( &sparray, &g_List1array, &sparray2); CString path; if(g_bAllBranch) { CString branchpath=GetBranchPhotoPath(branch); path=g_path2+branchpath+"\\"; } else path=g_path2+"\\"; SelectPhotoDlg selectdlg; selectdlg.DoModal (); path+=id; path +="\\"; if(m_seltxname!="" && m_seltxname!="全部") { path+=m_seltxname; path +="\\"; } //////////////////////////////////////// CString str,spname; CStringArray noarray; CStringArray spnamearray; for(int i=0; iEnableWindow(1); } else GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0); /* if(waiter7.IsEmpty () && IsHasRights2new(6) || IsHasRights2new(49)) { GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1); } else if(waiter7==g_user.name && IsHasRights2new(6) ) { GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1); } else GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);*/ *pResult = 0; } void BeautifySkinFrom2::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 BeautifySkinFrom2::HidePrice() { #ifdef LKAY_VERSION if(IsHasRights2new(31))return; for(int i=0; i< m_List1array.GetSize (); i++) { m_List1array.ElementAt (i).SetAt (14+m_nAdd, "***"); m_List1array.ElementAt (i).SetAt (15+m_nAdd, "***"); m_List1array.ElementAt (i).SetAt (16+m_nAdd, "***"); m_List1array.ElementAt (i).SetAt (13+m_nAdd, "***"); } #else if(IsHasRights2new(31))return; for(int i=0; i< m_List1array.GetSize (); i++) { m_List1array.ElementAt (i).SetAt (16+m_nAdd, "***"); m_List1array.ElementAt (i).SetAt (15+m_nAdd, "***"); } #endif } void BeautifySkinFrom2::OnBtnsearchfilter() { // TODO: Add your control notification handler code here SearchFilter dlg; dlg.m_mode =2; if(dlg.DoModal ()==IDOK)FillGrid(); g_bSearchFilter=0; } void BeautifySkinFrom2::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]=35; g_sendhead.tabcount=1; g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return; } else { g_sendhead.bsql=0; g_sendhead.code[0]=35; 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; iOnDisconnect(); 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]=35; g_sendhead.tabcount=1; g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)continue; } else { g_sendhead.bsql=0; g_sendhead.code[0]=35; g_sendhead.tabcount=1; g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)continue; } CArrayList1array; DataToArray(&List1array); int size=m_List1array.GetSize (); for(int j=0; jOnDisconnect(); g_bBranchModify=0;g_branchip=g_branchname=""; } HidePrice(); FillGrid(); } void BeautifySkinFrom2::OnBUTprint3() { // TODO: Add your control notification handler code here GetData(); } void BeautifySkinFrom2::OnBUTexportphotoAddName() { if(IsHasRights2new(10)==0)return; // TODO: Add your control notification handler code here UpdateData(); POSITION pos; pos=m_List1.GetFirstSelectedItemPosition(); if(pos==NULL) { AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION); return; } int iItem=m_List1.GetNextSelectedItem(pos); CString status2=m_List1.GetItemText (iItem, 4); if(status2!="OK") { AfxMessageBox("此单未选片!", MB_ICONINFORMATION); return; } CString id=m_List1.GetItemText (iItem, 0); CString name1=m_List1.GetItemText (iItem, 1); CString name2=m_List1.GetItemText (iItem, 2); CString filter="id='"+id+"';id='"+id+"'"; g_sendhead.bsql=0; g_sendhead.code[0]=50; g_sendhead.code[1]=11; g_sendhead.tabcount=2; g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return; CArraysparray; DataToArray( &sparray, &g_List1array); CString path=g_path2+"\\"; SelectPhotoDlg selectdlg; selectdlg.DoModal (); path+=id; path +="\\"; //////////////////////////////////////// CString str,spname; CStringArray noarray; CStringArray spnamearray; for(int i=0; i