| | |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <xcontrol/ximageview.hpp> |
| | | |
| | | #include <win32/xfolder.hpp> |
| | | #include "vbusiness/vframe/maint.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | #include "viewobject/saleorder.view.hpp" |
| | |
| | | KXMLDOMElement e = tv_folder.GetItemData(hItem); |
| | | //xstring no = e.getAttribute(L"no"); |
| | | //if(no==L"") return 1; |
| | | xstring guid = e.getAttribute(L"guid"); |
| | | xaserverarg arg; |
| | | //xstring guid = e.getAttribute(L"guid"); |
| | | |
| | | |
| | | int row = dw_list.GetNextSelectRow(1); |
| | | if (row < 1) row = dw_list.GetRow(); |
| | | if (row < 1 || row > dw_list.GetRowCount()) return 0; |
| | | xstring guid = dw_list.GetItemString(row, L"@guid"); |
| | | if (guid == L"") return 1; |
| | | arg.AddArg(L"skuid", guid); |
| | | |
| | | /* |
| | | if(no==L"NP0000FS" || no==L"UP0000FS") |
| | |
| | | OpenWindow(L"dev:xpage[PackSchemaMaint.goodslib.vx]"); |
| | | }else |
| | | { |
| | | int pr = g_xdoc_product; |
| | | LPARAM pr = g_xdoc_product; |
| | | OpenWindow(L"dev:xpage[ProductLibraryItemMaint.vx]",pr); |
| | | } |
| | | */ |
| | | //KXMLDOMElement ele = g_xdoc_product.getRowElement(L"data/Item", 1); |
| | | //alert(ele.xml); |
| | | #ifdef shouldfinished |
| | | int pr = g_xdoc_product; |
| | | OpenWindow(L"dev:xpage[ProductLibraryItemMaint3.vx]", pr); |
| | | #endif |
| | | |
| | | OpenWindow(L"dev:xpage[ProductLibraryItemMaint3.vx]", arg); |
| | | # |
| | | return 1; |
| | | } |
| | | |
| | |
| | | alert(L"添加成功"); |
| | | return 1; |
| | | } |
| | | else if (comdid == L"xmExportImage") |
| | | { |
| | | return OnExportImages(dw_list); |
| | | } |
| | | return 0; |
| | | } |
| | | int OnExportImages(xdwgrid dw_obj) |
| | | { |
| | | xstring folder = xfolder::GetFolderForSave(); |
| | | if (folder == L"") return 1; |
| | | |
| | | xstring skunos = L""; |
| | | for (int i = 0; i <= dw_obj.GetRowCount(); i++) |
| | | { |
| | | if (i == 1)skunos = dw_obj.GetItemString(i, L"SKUNo"); |
| | | else skunos += L"," + dw_obj.GetItemString(i, L"SKUNo"); |
| | | } |
| | | xml x; |
| | | xaserverarg arg; |
| | | |
| | | arg.AddArg(L"SKUNoList", skunos); |
| | | xstring src = L"/sale/data/ProductLibrary3/pref/picture/imagelistSKUNoList"; |
| | | |
| | | //trace("SKUNo="+SKUNo);//要有展示图片查询条件内必定要skuno |
| | | if (xurl::get(src, arg.GetString(), x) != 1) |
| | | { |
| | | trace(L"error for download skuno pic!"); |
| | | return 1; |
| | | } |
| | | |
| | | xstring spath = L""; |
| | | xstring path = folder;// GetModuleTmpPath(); |
| | | xstring ext = L"jpg"; |
| | | |
| | | trace(x.xml()); |
| | | const wchar_t* str = x.xml(); |
| | | |
| | | KXMLDOMNodeList items = x.selectNodes(L"*/*"); |
| | | long len = items.length(); |
| | | for (int i = 0; i <= len; i++) |
| | | { |
| | | KXMLDOMElement ele = items.item(i); |
| | | if (ele.selectSingleNode(L"FileExt[1]")) |
| | | { |
| | | ext = ele.selectSingleNode(L"FileExt[1]").text(); |
| | | } |
| | | xstring SKUNo = L""; |
| | | if (ele.selectSingleNode(L"FullName[1]")) |
| | | { |
| | | SKUNo = ele.selectSingleNode(L"FullName[1]").text(); |
| | | xstring filename = SKUNo + L"." + ext; |
| | | if (ele.selectSingleNode(L"PicPath[1]")) |
| | | spath = ele.selectSingleNode(L"PicPath[1]").text(); |
| | | if (spath != L"") |
| | | { |
| | | xaserver::DownLoadFile(this->GetServerUrl(), spath, L"", path + L"/" + filename); |
| | | } |
| | | } |
| | | } |
| | | alert(L"样品图片生成完成"); |
| | | return 1; |
| | | } |
| | | //命令处理事件 |
| | | int OnXCommand(TEvent* evt, int param) |
| | | { |
| | |
| | | else |
| | | return 1; |
| | | |
| | | /* dw_list.SetDataObject(ProductLibraryView::GetMaintListForm3(no).GetXmlDoc()); |
| | | /* dw_list.SetDataObject(ProductLibraryView::GetMaintListForm3(no)); |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.Reset(); |
| | | dw_list.SetReadOnly(true); |
| | |
| | | int len = nlist.length(); |
| | | for (int i = 0; i < len; i++) |
| | | { |
| | | KXMLDOMElement& e = * new KXMLDOMElement(nlist.item(i)); |
| | | KXMLDOMElement e = nlist.item(i); |
| | | xstring name = e.getAttribute(L"cname"); |
| | | xstring sImage = e.getAttribute(L"image"); |
| | | int image = 15; |
| | |
| | | return 1; |
| | | } |
| | | |
| | | int OnImgDBClicked(TEvent * evt, int pr) |
| | | int OnImgDBClicked(TEvent * evt, LPARAM pr) |
| | | { |
| | | IMGNNMHDR& nmtv = *(IMGNNMHDR*)evt->notify.pnmh; |
| | | xstring src = nmtv.path; |