| | |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <xcontrol/ximageview.hpp> |
| | | #include <xcontrol/xcell.hpp> |
| | | #include <adt/xarray.hpp> |
| | | #include <win32/xfile.hpp> |
| | | #include <wobject/xdouble.hpp> |
| | | |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | |
| | | itemStr += L"<ItemName>" + dw_cell.GetItemString(row, colItemName) + L"</ItemName>"; |
| | | itemStr += L"<ItemCName>" + dw_cell.GetItemString(row, colItemCName) + L"</ItemCName>"; |
| | | itemStr += L"<ItemSpec>" + dw_cell.GetItemString(row, colItemSpec) + L"</ItemSpec>"; |
| | | itemStr += L"<RowNo>" + (row - startRow + 1).toString() + L"</RowNo>"; |
| | | itemStr += L"<RowNo>" + xstring(row - startRow + 1) + L"</RowNo>"; |
| | | itemStr += L"<Purchor>" + dw_cell.GetItemString(row, colBuyer) + L"</Purchor>"; |
| | | itemStr += L"<Package>" + dw_cell.GetItemString(row, colPackage) + L"</Package>"; |
| | | itemStr += L"<NWT>" + dw_cell.GetItemString(row, colNW) + L"</NWT>"; |
| | |
| | | arg4.setNativePointer(xaserverarg::CreateInstance()); |
| | | trace(items); |
| | | arg4.AddArg(L"value", items); |
| | | OpenWindow(L"dev:xpage[QuoteFilePurched.vx]", cast(arg4 as int)); |
| | | OpenWindow(L"dev:xpage[QuoteFilePurched.vx]", arg4); |
| | | |
| | | if (arg4.GetArgString(L"process") != L"ok") return 1; |
| | | items = arg4.GetArgString(L"value"); |
| | | |
| | | xml x0 ; |
| | | x0.setNativePointer(xml::CreateInstance()); |
| | | x0.loadXML(items); |
| | | |
| | | KXMLDOMNodeList ts = x0.selectNodes(L"data/Item[IsSend='1']"); |
| | | int len = ts.length(); |
| | | if (len < 1) return L""; |
| | | if (len < 1) return 0; |
| | | |
| | | xstring content = L""; |
| | | xstring sdate = publiccode::GetCurrentDate(); |
| | |
| | | { |
| | | trace(L"\r\ntaskid:" + taskid + L" finished:" + finished); |
| | | ProcessSendMessage(myurl, L"", content, datacontent, true); |
| | | win32::PostMessage(GetFrameWindow().GetHWND(), 0x401, L"xmRefreshTask", 0); |
| | | PostMessage(GetFrameWindow().GetHWND(), 0x401, (WPARAM)L"xmRefreshTask", 0); |
| | | } |
| | | |
| | | return 1; |
| | |
| | | arg4.setNativePointer(xaserverarg::CreateInstance()); |
| | | trace(items); |
| | | arg4.AddArg(L"value", items); |
| | | OpenWindow(L"dev:xpage[QuoteFilePurch.vx]", cast(arg4 as int)); |
| | | OpenWindow(L"dev:xpage[QuoteFilePurch.vx]", arg4); |
| | | if (arg4.GetArgString(L"process") != L"ok") return 1; |
| | | items = arg4.GetArgString(L"value"); |
| | | |
| | |
| | | |
| | | xstring items = GetPurchItems(); |
| | | xaserverarg arg4 ; |
| | | arg4.setNativePointer(xaserverarg::CreateInstance()); |
| | | arg4.AddArg(L"value", items); |
| | | OpenWindow(L"dev:xpage[QuoteFilePurch.vx]", cast(arg4 as int)); |
| | | OpenWindow(L"dev:xpage[QuoteFilePurch.vx]", arg4); |
| | | if (arg4.GetArgString(L"process") != L"ok") return 1; |
| | | items = arg4.GetArgString(L"value"); |
| | | |
| | | xml x0 ; |
| | | x0.setNativePointer(xml::CreateInstance()); |
| | | x0.loadXML(items); |
| | | KXMLDOMNodeList ts1 = x0.selectNodes(L"data/Item"); |
| | | int len1 = ts1.length(); |
| | |
| | | } |
| | | } |
| | | |
| | | int purchercol1 = 0; |
| | | //update purch |
| | | if (1 == 0) |
| | | { |
| | |
| | | |
| | | headrow1 = row2; |
| | | startrow1 = headrow1 + 1; |
| | | int purchercol1 = getItemCol(cell1, headrow1, L"采购人员"); |
| | | purchercol1 = getItemCol(cell1, headrow1, L"采购人员"); |
| | | } |
| | | |
| | | |
| | | //Clear |
| | | if (1 == 1) |
| | |
| | | supplier = dw_cell.GetItemString(lastrow, purchercol); |
| | | if (supplier != username) |
| | | { |
| | | KXMLDOMNode n1 = x0.selectSingleNode(L"data/Item[IsSend='1' and Purchor='" + supplier + L"' and RowNo='" + (lastrow - row + 1).toString() + L"']"); |
| | | KXMLDOMNode n1 = x0.selectSingleNode(L"data/Item[IsSend='1' and Purchor='" + supplier + L"' and RowNo='" + xstring(lastrow - row + 1) + L"']"); |
| | | if (n1) |
| | | { |
| | | xstring rowid = getRowID(dw_cell, lastrow); |
| | |
| | | arg4.setNativePointer(xaserverarg::CreateInstance()); |
| | | trace(items); |
| | | arg4.AddArg(L"value", items); |
| | | OpenWindow(L"dev:xpage[QuoteFilePurch.vx]", cast(arg4 as int)); |
| | | OpenWindow(L"dev:xpage[QuoteFilePurch.vx]", arg4); |
| | | if (arg4.GetArgString(L"process") != L"ok") return 1; |
| | | items = arg4.GetArgString(L"value"); |
| | | |
| | |
| | | } |
| | | |
| | | xml x0 ; |
| | | x0.setNativePointer(xml::CreateInstance()); |
| | | x0.loadXML(items); |
| | | |
| | | while (supplier != L"") |
| | |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/TO/template/param", L"TemplateID", id); |
| | | |
| | | xml sheet ; |
| | | sheet.loadXML(x.selectSingleNode(L"data/*").xml); |
| | | sheet.loadXML(x.selectSingleNode(L"data/*").xml()); |
| | | |
| | | dw_cell.LoadTemplate(sheet); |
| | | dw_cell.Redraw(); |
| | |
| | | return L""; |
| | | } |
| | | |
| | | xstring appPath = GetModuleTmpPath(); |
| | | xstring appPath = xutil::GetModuleTmpPath(); |
| | | xaserver::CreateDirectory(appPath); |
| | | ret = xaserver::DownLoadFile(GetServerUrl(), L"/business/products/chanpin/" + str + L"/" + name, name, appPath + L"/" + name); |
| | | if (ret < 0) |
| | |
| | | dw_cell.SetCellProps(row, colPhoto, props); |
| | | dw_cell.SetCellProps(row, colPhoto1, props); |
| | | |
| | | xstring appPath = GetModuleTmpPath(); |
| | | xstring appPath = xutil::GetModuleTmpPath(); |
| | | xstring guid = ViewObject::GetGuid(); |
| | | xstring filename1 = UploadImage(guid); |
| | | if (filename1 != L"") |
| | |
| | | return 1; |
| | | } |
| | | |
| | | int GetOpenFileNames(StringArray items, xstring initFileName, xstring filter, xstring ext) |
| | | int GetOpenFileNames(xarray<xstring>& items, xstring initFileName, xstring filter, xstring ext) |
| | | { |
| | | //xstring path = GetOpenFileName(L"", |
| | | // "JPEG 文件(*.jpg)\0*.jpg;*.jpeg;*.png;*.gif;*.bmp\0全部文件(*.*)\0*.*\0", |
| | |
| | | ofn.nFileExtension = 0; |
| | | |
| | | //debugbreak(); |
| | | if (file::GetOpenFileName(ofn)) |
| | | if (xfile::GetOpenFileName(ofn)) |
| | | { |
| | | int pos = ofn.nFileOffset & 0xffff; |
| | | xstring path = szPath; |
| | |
| | | } |
| | | else |
| | | { |
| | | int start = cast(szPath as int); |
| | | wchar_t* start = szPath; |
| | | start += pos * 2; |
| | | xstring str = cast(start as xstring); |
| | | xstring str = start; |
| | | while (true) |
| | | { |
| | | if (str == L"")break; |
| | | items.push_back(path + L"/" + str); |
| | | start += (str.length() + 1) * 2; |
| | | str = cast(start as xstring); |
| | | str = start; |
| | | } |
| | | } |
| | | } |
| | | delete szFileName; |
| | | delete szPath; |
| | | delete ofn; |
| | | |
| | | return items.length(); |
| | | } |
| | | |
| | |
| | | int LastRow = dw_cell.GetValidRow(); |
| | | if (row < startRow) return 0; |
| | | |
| | | xstring appPath = GetModuleTmpPath(); |
| | | StringArray items; |
| | | items = StringArray::make(); |
| | | xstring appPath = xutil::GetModuleTmpPath(); |
| | | xarray<xstring> items; |
| | | GetOpenFileNames(items, L"", |
| | | "JPEG 文件(*.jpg)\0*.jpg;*.jpeg;*.png;*.gif;*.bmp\0全部文件(*.*)\0*.*\0", |
| | | "jpg"); |
| | | L"JPEG 文件(*.jpg)\0*.jpg;*.jpeg;*.png;*.gif;*.bmp\0全部文件(*.*)\0*.*\0", |
| | | L"jpg"); |
| | | if (items.length() < 1) return 1; |
| | | |
| | | int sRow = row; |
| | |
| | | dw_cell.SetCellProps(row, colPhoto, props); |
| | | dw_cell.SetCellProps(row, colPhoto1, props); |
| | | |
| | | xstring appPath = GetModuleTmpPath(); |
| | | StringArray items; |
| | | items = StringArray::make(); |
| | | xstring appPath = xutil::GetModuleTmpPath(); |
| | | xarray<xstring> items; |
| | | GetOpenFileNames(items, L"", |
| | | L"JPEG 文件(*.jpg)\0*.jpg;*.jpeg;*.png;*.gif;*.bmp\0全部文件(*.*)\0*.*\0", |
| | | "jpg"); |
| | | L"jpg"); |
| | | if (items.length() < 1) return 1; |
| | | |
| | | for (int i = 0; i < items.length(); i++) |
| | |
| | | double colFOBPriceEx = fobprice.toDouble(); |
| | | |
| | | double colFOBPriceS; |
| | | colFOBPriceS = colFOBPriceEx.round(2); |
| | | colFOBPriceS = xdouble(colFOBPriceEx).round(2); |
| | | xstring colFOBPriceS1 = xstring(colFOBPriceS); |
| | | xstring colFOBPriceS2 = colFOBPriceS1.left(colFOBPriceS1.find(L".")); |
| | | xstring colFOBPriceS3 = colFOBPriceS1.mid(colFOBPriceS1.find(L"."), colFOBPriceS1.length()); |
| | |
| | | xaserverarg argx ; |
| | | argx.setNativePointer(argx.CreateInstance()); |
| | | argx.AddArg(L"GoodsNo", dw_cell.GetItemString(row, colItemNo)); |
| | | OpenWindow(L"dev:xpage[CustomerItemNoList.vx]", cast(argx as int)); |
| | | OpenWindow(L"dev:xpage[CustomerItemNoList.vx]", argx); |
| | | if (argx.GetArgString(L"action") != L"ok") return 1; |
| | | |
| | | xml x1 ; |
| | |
| | | dw_cell.SetItemString(row, colQtyPerPack, str2 + L"/" + str1); |
| | | } |
| | | else |
| | | { |
| | | xstring str1 = goods.selectSingleNode(L"//PackingRate[1]").text(); |
| | | dw_cell.SetItemString(row, colQtyPerPack, str1); |
| | | } |
| | | } |
| | | ProcessItemImage(dw_cell.GetItemString(row, colSKUNo), row); |
| | | //ProcessItemImage1(dw_cell.GetItemString(row,colItemNo),row); |
| | |
| | | //if(qty2 !=L"") qty = qty*qty2.toDouble(); |
| | | qty = qty2.toDouble(); |
| | | double ttl = 65.0 * qty / v; |
| | | dw_cell.SetItemString(row, col40HQ, ttl.toInt().toString()); |
| | | dw_cell.SetItemString(row, col40HQ, xstring((int)ttl)); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | else if (comdid == L"xmRefreshTask1") |
| | | { |
| | | win32::PostMessage(GetFrameWindow().GetHWND(), 0x401, L"xmRefreshTask", 0); |
| | | PostMessage(GetFrameWindow().GetHWND(), 0x401, L"xmRefreshTask", 0); |
| | | return 1; |
| | | } |
| | | else if (comdid == L"xmFileOpen" || comdid == L"xmOpen" || comdid == L"xmNew") |
| | |
| | | dw_cell.Redraw(); |
| | | filename = args.GetArgString(L"filename"); |
| | | fileid = args.GetArgString(L"ID"); |
| | | win32::SetWindowText(GetHWND(), L"报价文件:" + filename); |
| | | SetWindowText(GetHWND(), L"报价文件:" + filename); |
| | | } |
| | | return 1; |
| | | } |
| | |
| | | dw_cell.Redraw(); |
| | | filename = L""; |
| | | fileid = L""; |
| | | win32::SetWindowText(GetHWND(), L"报价文件:[new]"); |
| | | SetWindowText(GetHWND(), L"报价文件:[new]"); |
| | | return 1; |
| | | } |
| | | else if (comdid == L"xmFileSave" || comdid == L"xmSave") |
| | |
| | | |
| | | xstring sh = doc.GetXml(); |
| | | int p = cast(sh as int); |
| | | win32::SendMessage(m_winHwnd, 0x401, p, 0); |
| | | SendMessage(m_winHwnd, 0x401, p, 0); |
| | | */ |
| | | return 1; |
| | | } |
| | |
| | | |
| | | dw_cell.openUrl(templateurl); |
| | | */ |
| | | //win32::SetWindowText(GetHWND(),L"报价文件:[new]"); |
| | | //SetWindowText(GetHWND(),L"报价文件:[new]"); |
| | | } |
| | | |
| | | ARow = 0; |