| | |
| | | } |
| | | |
| | | //焦点激活处理函数 |
| | | int OnSetFocus(ref TEvent evt, int param) |
| | | int OnSetFocus(TEvent* evt, LPARAM param) |
| | | { |
| | | //重置工具条 |
| | | SetAgent(); |
| | |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/TO/template/param", L"TemplateID", id); |
| | | |
| | | xml sheet ; |
| | | sheet.setNativePointer(x.CreateInstance()); |
| | | sheet.loadXML(x.selectSingleNode(L"data/*").xml); |
| | | |
| | | dw_cell.LoadTemplate(sheet); |
| | |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | static stdcall int GetModuleFileName(int hModule, xstring lpFileName, int nSize) native from "kernel32.dll" alias "GetModuleFileNameW"; |
| | | static stdcall int PathRemoveFileSpec(xstring lpFileName) native from "shlwapi.dll" alias "PathRemoveFileSpecW"; |
| | | |
| | | xstring GetModulePath() |
| | | { |
| | | xstring str = L""; |
| | | str = str.space(255); |
| | | GetModuleFileName(0, str, 250); |
| | | PathRemoveFileSpec(str); |
| | | return str; |
| | | } |
| | | |
| | | xstring GetModuleTmpPath() |
| | | { |
| | | xstring str = L""; |
| | | str = str.space(255); |
| | | GetModuleFileName(0, str, 250); |
| | | PathRemoveFileSpec(str); |
| | | xstring tmp = str + L"\\Temp"; |
| | | xaserver::CreateDirectory(tmp); |
| | | return tmp; |
| | | } |
| | | |
| | | xstring UploadImage(xstring guid) |
| | | { |
| | | return UploadImage(guid, L""); |
| | |
| | | { |
| | | xstring name = guid + L".jpg"; |
| | | xstring str = name.mid(0, 2); |
| | | str = str.upper(); |
| | | str = str.toUpper(); |
| | | int ret = 1; |
| | | if (filename != L"") |
| | | ret = xaserver::Upload(L"product" + str, name, filename, this.GetHWND(), L"", false); |
| | | ret = xaserver::Upload(L"product" + str, name, filename, GetHWND(), L"", false); |
| | | else |
| | | ret = xaserver::Upload(L"product" + str, name, this.GetHWND(), L"", false); |
| | | ret = xaserver::Upload(L"product" + str, name.c_str(), GetHWND(), L"", false); |
| | | if (ret == -1) return L""; |
| | | if (ret == 0) |
| | | { |
| | |
| | | } |
| | | |
| | | xutil::SmallImage(appPath+L"\\"+name,appPath+L"\\"+L"x_"+name,120,120); |
| | | int ret_1 = xaserver::Upload(L"product"+str, L"x_"+name,appPath+L"\\x_"+name, this.GetHWND(),L"",false); |
| | | int ret_1 = xaserver::Upload(L"product"+str, L"x_"+name,appPath+L"\\x_"+name, GetHWND(),L"",false); |
| | | //xaserver::DeleteFile(appPath+L"x_"+name); |
| | | //xaserver::DeleteFile(appPath+name); |
| | | if(ret_1 != 1) |
| | |
| | | { |
| | | xstring name = guid + L".jpg"; |
| | | xstring str = name.mid(0, 2); |
| | | str = str.upper(); |
| | | str = str.toUpper(); |
| | | int ret = 1; |
| | | if (filename != L"") |
| | | ret = xaserver::Upload(L"product" + str, name, filename, this.GetHWND(), L"", false); |
| | | ret = xaserver::Upload(L"product" + str, name, filename, GetHWND(), L"", false); |
| | | else |
| | | ret = xaserver::Upload(L"product" + str, name, this.GetHWND(), L"", false); |
| | | ret = xaserver::Upload(L"product" + str, name, GetHWND(), L"", false); |
| | | if (ret == -1) return L""; |
| | | if (ret == 0) |
| | | { |
| | |
| | | } |
| | | |
| | | xutil::SmallImage(appPath + L"\\" + name, appPath + L"\\" + L"x_" + name, 120, 120); |
| | | int ret_1 = xaserver::Upload(L"product" + str, L"x_" + name, appPath + L"\\x_" + name, this.GetHWND(), L"", false); |
| | | int ret_1 = xaserver::Upload(L"product" + str, L"x_" + name, appPath + L"\\x_" + name, GetHWND(), L"", false); |
| | | //xaserver::DeleteFile(appPath+L"x_"+name); |
| | | //xaserver::DeleteFile(appPath+name); |
| | | if (ret_1 != 1) |
| | |
| | | // "JPEG 文件(*.jpg)\0*.jpg;*.jpeg;*.png;*.gif;*.bmp\0全部文件(*.*)\0*.*\0", |
| | | // "jpg"); |
| | | |
| | | char[] szFileName = new char[4096]; |
| | | char[] szPath = new char[4096]; |
| | | wchar_t szFileName[4096]; |
| | | wchar_t szPath[4096]; |
| | | szFileName[0] = 0; |
| | | szPath[0] = 0; |
| | | |
| | | if (initFileName != L"") |
| | | { |
| | | int len = initFileName.length(); |
| | | char[] tmp = initFileName; |
| | | const wchar_t* tmp = initFileName.c_str(); |
| | | for (int i = 0; i < len + 1; i++) |
| | | { |
| | | //szFileName[i] = tmp[i]; |
| | | szPath[i] = tmp[i]; |
| | | } |
| | | } |
| | | |
| | | int nFilterIndex = 1; |
| | | ref OPENFILENAMEW ofn = new OPENFILENAMEW; |
| | | OPENFILENAMEW ofn; |
| | | |
| | | ofn.lStructSize = 88;//sizeof(ofn); |
| | | ofn.hwndOwner = 0; |
| | |
| | | return 1; |
| | | } |
| | | |
| | | int OnCellSelectChanged(ref TNotifyEvent evt, int p) |
| | | int OnCellSelectChanged(TEvent*, LPARAM p) |
| | | { |
| | | /*ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR); |
| | | xstring colname=hdr.colname; |
| | |
| | | return 1; |
| | | } |
| | | |
| | | int OnItemChanged(ref TNotifyEvent evt, int p) |
| | | int OnItemChanged(TEvent*, LPARAM p) |
| | | { |
| | | ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR); |
| | | xstring colname = hdr.colname; |
| | |
| | | xstring res = L"/sale/data/productlibrary3/pref/picture/imagelistskuno"; |
| | | if (xurl::get(res, arg_pic.GetString(), xp) != 1) |
| | | { |
| | | trace(xp.GetXml()); |
| | | trace(xp.xml()); |
| | | return 1; |
| | | } |
| | | else |
| | | { |
| | | //alert(xp.GetXml()); |
| | | //alert(xp.xml()); |
| | | ClearImageTerm(row, L"customer-photo"); |
| | | //alert(xp.GetXml()); |
| | | //alert(xp.xml()); |
| | | KXMLDOMNodeList nlistp = xp.selectNodes(L"ImageList/image"); |
| | | int lenp = nlistp.length(); |
| | | int ip = 0; |
| | |
| | | xstring res = L"/sale/data/ProductLibrary3/pref/picture/imagelistItemNo"; |
| | | if (xurl::get(res, arg_pic.GetString(), xp) != 1) |
| | | { |
| | | trace(xp.GetXml()); |
| | | trace(xp.xml()); |
| | | return 1; |
| | | } |
| | | else |
| | | { |
| | | ClearImageTerm(row, L"customer-photo"); |
| | | //alert(xp.GetXml()); |
| | | //alert(xp.xml()); |
| | | KXMLDOMNodeList nlistp = xp.selectNodes(L"ImageList/image"); |
| | | int lenp = nlistp.length(); |
| | | int ip = 0; |
| | |
| | | xstring GetExchangeRate(xstring pcur, xstring pdate) |
| | | { |
| | | |
| | | if (pcur.upper() == L"RMB") return L"1"; |
| | | if (pcur.toUpper() == L"RMB") return L"1"; |
| | | xstring exchangeRate = L""; |
| | | if (exchangeRate == L"") { |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/param", L"item", L"cryrate"); |
| | |
| | | return 1; |
| | | } |
| | | |
| | | int OnRowChanged(ref TNotifyEvent evt, int p) |
| | | int OnRowChanged(TEvent* evt, LPARAM p) |
| | | { |
| | | ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR); |
| | | DWNMHDR& hdr = *(DWNMHDR * )evt->notify.pnmh; |
| | | int row = hdr.row; |
| | | |
| | | return OnQuoteLineChanged(row); |
| | |
| | | int OnQuoteLineChanged(int row) |
| | | { |
| | | ximageview im = GetControl(L"im1"); |
| | | im.ResetEx(); |
| | | im.Reset(); |
| | | //xstring skuno = dw_goods.GetItemString(row,L"SKUNo"); |
| | | //OnShowImage(skuno,row); |
| | | //im.Redraw(); |
| | |
| | | ximageview im = GetControl(L"im1"); |
| | | |
| | | xml xp ; |
| | | xp.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg_pic ; |
| | | arg_pic.setNativePointer(arg_pic.CreateInstance()); |
| | | arg_pic.AddArg(L"SKUNo", skuno); |
| | | |
| | | xstring res = L"/sale/data/ProductLibrary3/pref/picture/imagelistSKUNo"; |
| | |
| | | bool hasIamge = false; |
| | | if (xurl::get(res, arg_pic.GetString(), xp) != 1) |
| | | { |
| | | trace(xp.GetXml()); |
| | | trace(xp.xml()); |
| | | return 1; |
| | | } |
| | | else |
| | |
| | | res = L"/sale/data/ProductLibrary3/pref/picture/imagelistSKUNo"; |
| | | if (xurl::get(res, arg_pic.GetString(), xp) != 1) |
| | | { |
| | | trace(xp.GetXml()); |
| | | trace(xp.xml()); |
| | | return 1; |
| | | } |
| | | else |
| | | { |
| | | nlistp = xp.selectNodes(L"ImageList/image"); |
| | | lenp = nlistp.length(); |
| | | for (ip = 0; ip < lenp; ip++) |
| | | KXMLDOMNodeList nlistp = xp.selectNodes(L"ImageList/image"); |
| | | long lenp = nlistp.length(); |
| | | for (int ip = 0; ip < lenp; ip++) |
| | | { |
| | | xitem = nlistp.item(ip); |
| | | picname = xitem.selectSingleNode(L"PicPath").text(); |
| | | goodno = xitem.selectSingleNode(L"GoodsNo").text(); |
| | | KXMLDOMNode xitem = nlistp.item(ip); |
| | | xstring picname = xitem.selectSingleNode(L"PicPath").text(); |
| | | xstring goodno = xitem.selectSingleNode(L"GoodsNo").text(); |
| | | if (picname == L"/business/products/Thumbs//") |
| | | picname = L"/business/products/Thumbs/00/00000000-0000-0000-0000-000000000000.jpg"; |
| | | im.AddImages(picname, goodno); |
| | |
| | | int OnUpdateProcessed() |
| | | { |
| | | int ret = ProcessSendMessage(L"/task/quote/update-processed", taskid, L"", L"", false); |
| | | win32::PostMessage(GetFrameWindow().GetHWND(), 0x401, L"xmRefreshTask", 0); |
| | | PostMessage(GetFrameWindow().GetHWND(), 0x401, (WPARAM)L"xmRefreshTask", 0); |
| | | return ret; |
| | | } |
| | | |
| | |
| | | if (filename == L"" || saveas) |
| | | { |
| | | xaserverarg arg ; |
| | | |
| | | arg.AddArg(L"src", myurl); |
| | | OpenWindow(L"dev:xpage[trade.document.saveas.vx]", cast(arg as int)); |
| | | OpenWindow(L"dev:xpage[trade.document.saveas.vx]", arg); |
| | | if (arg.GetArgString(L"result") == L"ok") |
| | | { |
| | | sfilename = arg.GetArgString(L"filename"); |
| | |
| | | xstring sguid = publiccode::GetGuid(); |
| | | xstring sname = sguid; |
| | | xstring str = sname.mid(0, 2); |
| | | str = str.upper(); |
| | | str = str.toUpper(); |
| | | xstring suri = L"attachment" + str; |
| | | int ret = xaserver::UploadData(suri, sguid + L".jpg", content); |
| | | if (ret < 0) |
| | |
| | | } |
| | | |
| | | xml x ; |
| | | |
| | | xaserverarg args ; |
| | | args.setNativePointer(args.CreateInstance()); |
| | | args.AddArg(L"myurl", myurl); |
| | |
| | | else |
| | | { |
| | | filename = sfilename; |
| | | win32::SetWindowText(GetHWND(), L"报价文件:" + filename); |
| | | SetWindowText(GetHWND(), L"报价文件:" + filename); |
| | | alert(x.text()); |
| | | } |
| | | |
| | |
| | | |
| | | int SendCtrlCmd(xcontrol xc, xstring cmd) |
| | | { |
| | | win32::SendMessage(xc.GetId(), 0x401, cmd, 0); |
| | | SendMessage(xc.GetHWND(), 0x401, cmd, 0); |
| | | return 1; |
| | | } |
| | | |
| | | int OnCellClicked(ref TNotifyEvent evt, int p) |
| | | int OnCellClicked(TEvent*, LPARAM p) |
| | | { |
| | | ref DWNMHDR dwhdr = cast(evt.pnmh as ref DWNMHDR); |
| | | int row = dwhdr.row; |
| | |
| | | } |
| | | |
| | | |
| | | int OnCellClicked1(ref TNotifyEvent evt, int p) |
| | | int OnCellClicked1(TEvent*, LPARAM p) |
| | | { |
| | | ref DWNMHDR dwhdr = cast(evt.pnmh as ref DWNMHDR); |
| | | int row = dwhdr.row; |