| | |
| | | #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" |
| | | #include "viewobject/view.base.hpp" |
| | | #include "viewobject/quote.view.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | using xml = KXMLDOMDocument;xxxx |
| | | class __declspec(dllexport) QuoteFileView : public xframe |
| | | { |
| | | |
| | |
| | | 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"") |
| | |
| | | } |
| | | |
| | | //焦点激活处理函数 |
| | | 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); |
| | | sheet.loadXML(x.selectSingleNode(L"data/*").xml()); |
| | | |
| | | dw_cell.LoadTemplate(sheet); |
| | | dw_cell.Redraw(); |
| | |
| | | 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) |
| | | { |
| | |
| | | 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) |
| | |
| | | } |
| | | |
| | | 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) |
| | |
| | | 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", |
| | | // "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; |
| | |
| | | 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)); |
| | | } |
| | | } |
| | | |
| | |
| | | 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* evt, LPARAM p) |
| | | { |
| | | ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR); |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | xstring colname = hdr.colname; |
| | | xstring value = hdr.data; |
| | | int row = hdr.row; |
| | |
| | | int startRow = getItemHeadRow(dw_cell); |
| | | |
| | | //没有找到商品行的标题 |
| | | if (startRow < 1) return L""; |
| | | if (startRow < 1) return 0; |
| | | startRow++; |
| | | |
| | | int colItemNo = getItemCol(dw_cell, startRow - 1, L"我司型号,ItemNo"); |
| | |
| | | int ProcessItemImage(xstring goodsno, int row) |
| | | { |
| | | xml xp ; |
| | | xp.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg_pic ; |
| | | arg_pic.setNativePointer(arg_pic.CreateInstance()); |
| | | arg_pic.AddArg(L"SKUNo", goodsno); |
| | | |
| | | ximageview im = GetControl(L"frame:im1"); |
| | | im.ResetEx(); |
| | | im.Reset(); |
| | | 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; |
| | |
| | | int ProcessItemImage1(xstring goodsno, int row) |
| | | { |
| | | xml xp ; |
| | | xp.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg_pic ; |
| | | arg_pic.setNativePointer(arg_pic.CreateInstance()); |
| | | arg_pic.AddArg(L"GoodsNo", goodsno); |
| | | |
| | | ximageview im = GetControl(L"frame:im1"); |
| | | im.ResetEx(); |
| | | im.Reset(); |
| | | 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; |
| | |
| | | im.AddImages(picname,goodsno);*/ |
| | | if (ip == 0) |
| | | { |
| | | xstring appPath = GetModuleTmpPath(); |
| | | xstring appPath = xutil::GetModuleTmpPath(); |
| | | xaserver::CreateDirectory(appPath); |
| | | xaserver::DownLoadFile(GetServerUrl(), L"/business/products/chanpin/" + id.left(2) + L"/" + name, name, appPath + L"/" + name); |
| | | |
| | |
| | | } |
| | | 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") |
| | | { |
| | | xstring suserid = publiccode::GetUser().id; |
| | | xaserverarg args ; |
| | | args.setNativePointer(args.CreateInstance()); |
| | | |
| | | if (comdid == L"xmNew") |
| | | OpenWindow(L"dev:xpage[TONewSelectDlg.vx]", cast(args as int)); |
| | | OpenWindow(L"dev:xpage[TONewSelectDlg.vx]", args); |
| | | else |
| | | OpenWindow(L"dev:xpage[TOSelectDlg.vx]", cast(args as int)); |
| | | OpenWindow(L"dev:xpage[TOSelectDlg.vx]", args); |
| | | fileid = args.GetArgString(L"id"); |
| | | templateID = args.GetArgString(L"templateID"); |
| | | xstring myaction = args.GetArgString(L"action"); |
| | |
| | | |
| | | args.AddArg(L"src", L"data/QuoteFile/" + suserid); |
| | | args.AddArg(L"process", L"path"); |
| | | OpenWindow(L"dev:xpage[trade.document.selectdlg.vx]", cast(args as int)); |
| | | OpenWindow(L"dev:xpage[trade.document.selectdlg.vx]", args); |
| | | if (args.GetArgString(L"result") == L"ok") |
| | | { |
| | | xstring u = args.GetArgString(L"src"); |
| | |
| | | |
| | | xaserver::LoadUrl(GetServerUrl(), u, L"", x); |
| | | trace(x.xml()); |
| | | dw_cell.LoadTemplateEx(x.documentElement); |
| | | dw_cell.LoadTemplateEx(x.documentElement()); |
| | | 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") |
| | |
| | | if (action == L"purch") |
| | | { |
| | | int crow = dw_cell.GetRow(); |
| | | xstring cmd = comdid.mid(3, comdid.length()); |
| | | if (getRowID(dw_cell, crow) == L"") SendCtrlCmd(dw_cell, cmd); |
| | | return 1; |
| | | } |
| | |
| | | Item += L"<ModifyDate>" + sdate + L"</ModifyDate>"; |
| | | |
| | | Item += L"</Item>"; |
| | | } |
| | | if (hasNew) |
| | | { |
| | | xstring newItem = L"<data>" + Item + L"</data>"; |
| | | trace(newItem); |
| | | if (OnSaveNewItem(newItem) == -1) return 1; |
| | | |
| | | if (hasNew) |
| | | { |
| | | xstring newItem = L"<data>" + Item + L"</data>"; |
| | | trace(newItem); |
| | | if (OnSaveNewItem(newItem) == -1) return 1; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | xstring str = x.documentElement.getAttribute(L"text"); |
| | | xstring str = x.documentElement().getAttribute(L"text"); |
| | | if (str == L"true") |
| | | { |
| | | dw_goods.ResetUpdateStatus(); |
| | |
| | | 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); |
| | |
| | | if (pos >= 0) |
| | | { |
| | | pos1 = content.find(L"</display>", pos); |
| | | str = content.mid(pos1 + L"</display>".length(), 9999999); |
| | | str = content.mid(pos1 + xstring(L"</display>").length(), 9999999); |
| | | content = content.left(pos) + str; |
| | | } |
| | | else |
| | |
| | | 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 (pos >= 0) |
| | | { |
| | | pos1 = content.find(L"</display>", pos); |
| | | str = content.mid(pos1 + L"</display>".length(), 9999999); |
| | | str = content.mid(pos1 + xstring(L"</display>").length(), 9999999); |
| | | content = content.left(pos) + str; |
| | | } |
| | | else |
| | |
| | | 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); |
| | | args.AddArg(L"name", sfilename); |
| | | args.AddArg(L"filepath", sname); |
| | |
| | | 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* evt, LPARAM p) |
| | | { |
| | | ref DWNMHDR dwhdr = cast(evt.pnmh as ref DWNMHDR); |
| | | DWNMHDR& dwhdr=*(DWNMHDR*)evt->notify.pnmh; |
| | | int row = dwhdr.row; |
| | | int col = dwhdr.col; |
| | | //xstring col = dwhdr.colname; |
| | |
| | | if (row < startRow + 1) return 1; |
| | | startRow++; |
| | | |
| | | trace(xstring(row) + L"---" + (startRow - 1).toString()); |
| | | trace(xstring(row) + L"---" + xstring(startRow - 1)); |
| | | |
| | | int colItemNo = getItemCol(dw_cell, startRow - 1, L"我司型号,ItemNo"); |
| | | int colCustomerItemNo = getItemCol(dw_cell, startRow - 1, L"客户型号,Customer ItemNo,Customer Item No"); |
| | |
| | | xstring pitems = L""; |
| | | for (int i = 0; i < count; i++) |
| | | { |
| | | pitems += L"<row><显示列>" + items.item(i).selectSingleNode(L"Name").text + L"</显示列><数据列>" |
| | | + items.item(i).selectSingleNode(L"Name").text + L"</数据列></row>"; |
| | | pitems += (xstring)L"<row><显示列>" + items.item(i).selectSingleNode(L"Name").text() + L"</显示列><数据列>" |
| | | + items.item(i).selectSingleNode(L"Name").text() + L"</数据列></row>"; |
| | | |
| | | } |
| | | xstring prop = L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | "<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems + L"</data>'/>" + |
| | | "</cellprop>"; |
| | | xstring prop = (xstring)L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | L"<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems + L"</data>'/>" + |
| | | L"</cellprop>"; |
| | | dw_cell.SetCellProps(row, col, prop); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (dw_cell.GetItemString(row, col) == L"") |
| | | dw_cell.SetItemString(row, col, L" "); |
| | | xstring prop2 = L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | "<edit edittype='query' dddwxpageurl='' dddwdataurl='xquery:[Convert.quickcode.xq]?id=Supplier' dddwtemplateurl='dev:sheet[Supplier.v3.tpl/List]' dddwdatacolumn='Name' dddwdisplaycolumn='Name' dddwwidth='' dddwheight='' dddwautoselect='N' dddwshowbutton='否' dddwcanedit='是'/>" + |
| | | "</cellprop>"; |
| | | xstring prop2 = (xstring)L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | L"<edit edittype='query' dddwxpageurl='' dddwdataurl='xquery:[Convert.quickcode.xq]?id=Supplier' dddwtemplateurl='dev:sheet[Supplier.v3.tpl/List]' dddwdatacolumn='Name' dddwdisplaycolumn='Name' dddwwidth='' dddwheight='' dddwautoselect='N' dddwshowbutton='否' dddwcanedit='是'/>" + |
| | | L"</cellprop>"; |
| | | dw_cell.SetCellProps(row, col, prop2); |
| | | dw_cell.Redraw(); |
| | | } |
| | | else if (col == colTyp1 || col == colTyp || col == colTyp2 || col == colTyp3) |
| | | { |
| | | xstring pitems1 = L""; |
| | | pitems1 += L"<row><显示列>成品</显示列><数据列>" |
| | | pitems1 += (xstring)L"<row><显示列>成品</显示列><数据列>" |
| | | + L"成品</数据列></row>"; |
| | | pitems1 += L"<row><显示列>散货</显示列><数据列>" |
| | | pitems1 += (xstring)L"<row><显示列>散货</显示列><数据列>" |
| | | + L"散货</数据列></row>"; |
| | | pitems1 += L"<row><显示列>包装</显示列><数据列>" |
| | | pitems1 += (xstring)L"<row><显示列>包装</显示列><数据列>" |
| | | + L"包装</数据列></row>"; |
| | | xstring prop1 = L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | "<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems1 + L"</data>'/>" + |
| | | "</cellprop>"; |
| | | xstring prop1 = (xstring)L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | L"<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems1 + L"</data>'/>" + |
| | | L"</cellprop>"; |
| | | dw_cell.SetCellProps(row, col, prop1); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | int OnCellClicked1(ref TNotifyEvent evt, int p) |
| | | int OnCellClicked1(TEvent* evt, LPARAM p) |
| | | { |
| | | ref DWNMHDR dwhdr = cast(evt.pnmh as ref DWNMHDR); |
| | | DWNMHDR dwhdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | int row = dwhdr.row; |
| | | int col = dwhdr.col; |
| | | //xstring col = dwhdr.colname; |
| | |
| | | if (row < startRow + 1) return 1; |
| | | startRow++; |
| | | |
| | | trace(xstring(row) + L"---" + (startRow - 1).toString()); |
| | | trace(xstring(row) + L"---" + xstring(startRow - 1)); |
| | | |
| | | int colItemNo = getItemCol(dw_cell, startRow - 1, L"我司型号,ItemNo"); |
| | | int colCustomerItemNo = getItemCol(dw_cell, startRow - 1, L"客户型号,Customer ItemNo,Customer Item No"); |
| | |
| | | xstring pitems = L""; |
| | | for (int i = 0; i < count; i++) |
| | | { |
| | | pitems += L"<row><显示列>" + items.item(i).selectSingleNode(L"Name").text + L"</显示列><数据列>" |
| | | + items.item(i).selectSingleNode(L"Name").text + L"</数据列></row>"; |
| | | pitems += (xstring)L"<row><显示列>" + items.item(i).selectSingleNode(L"Name").text() + L"</显示列><数据列>" |
| | | + items.item(i).selectSingleNode(L"Name").text() + L"</数据列></row>"; |
| | | |
| | | } |
| | | xstring prop = L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | "<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems + L"</data>'/>" + |
| | | "</cellprop>"; |
| | | xstring prop = (xstring)L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | L"<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems + L"</data>'/>" + |
| | | L"</cellprop>"; |
| | | dw_cell.SetCellProps(row, col, prop); |
| | | } |
| | | if (col == colPackage) |
| | |
| | | xaserverarg argx ; |
| | | argx.setNativePointer(argx.CreateInstance()); |
| | | argx.AddArg(L"GoodsNo", dw_cell.GetItemString(ARow, 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") |
| | | { |
| | | ARow = row; |
| | |
| | | { |
| | | /*计算体积*/ |
| | | xstring desc = dw_cell.GetItemString(ARow, colVolDesc); |
| | | double v = 0.0; |
| | | if (desc == L"") |
| | | dw_cell.SetItemString(ARow, colVol, L""); |
| | | else |
| | | { |
| | | double v = calcVol(desc) / 1000000.00; |
| | | v = calcVol(desc) / 1000000.00; |
| | | xstring str = xstring(v); |
| | | if (str.find(L".") >= 0) str = str.left(str.find(L".") + 5); |
| | | dw_cell.SetItemString(ARow, colVol, str); |
| | |
| | | if (qty1 != L"") qty = qty1.toDouble(); |
| | | if (qty2 != L"") qty = qty * qty2.toDouble(); |
| | | double ttl = 65.0 * qty / v; |
| | | dw_cell.SetItemString(ARow, col40HQ, ttl.toInt().toString()); |
| | | dw_cell.SetItemString(ARow, col40HQ, xstring((int)ttl)); |
| | | } |
| | | } |
| | | |
| | |
| | | pitems1 += (xstring)L"<row><显示列>包装</显示列><数据列>" |
| | | + L"包装</数据列></row>"; |
| | | xstring prop1 = (xstring)L"<cellprop searchcolumn='' celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='' cellvisibleex='' cellvisible='' cellneeddata='' cellvalid='' cellinitial='' cellsource='' fontstyle='' windowurl=''>" + |
| | | "<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems1 + L"</data>'/>" + |
| | | "</cellprop>"; |
| | | L"<edit edittype='ddlb' ddlbdataurl='' ddlbxml='<data>" + pitems1 + L"</data>'/>" + |
| | | L"</cellprop>"; |
| | | dw_cell.SetCellProps(row, col, prop1); |
| | | } |
| | | |
| | |
| | | |
| | | 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; |
| | | } |
| | |
| | | int OnAttachListon() |
| | | { |
| | | //绑定工具条点击事件 |
| | | AttachEvent(L"WM_XCOMMAND", OnXCommand); |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&QuoteFileView::OnXCommand); |
| | | //获取焦点事件,用于重置工具条 |
| | | AttachEvent(L"WM_SETFOCUS", OnSetFocus); |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&QuoteFileView::OnSetFocus); |
| | | |
| | | AttachEvent(L"frame:im1", L"IMG_LDBCLICK", OnImgDBClicked); |
| | | AttachEvent(L"frame:im1", L"IMG_LDBCLICK", (FEvent)&QuoteFileView::OnImgDBClicked); |
| | | |
| | | AttachEvent(L"dw_base", L"DWV_ITEMCHANGED", OnItemChanged); |
| | | AttachEvent(L"dw_goods", L"DWV_ROWFOCUSCHANGED", OnRowChanged); |
| | | AttachEvent(L"dw_base", L"DWV_ITEMCHANGED", (FEvent)&QuoteFileView::OnItemChanged); |
| | | AttachEvent(L"dw_goods", L"DWV_ROWFOCUSCHANGED", (FEvent)&QuoteFileView::OnRowChanged); |
| | | |
| | | AttachEvent(L"dw_cell", L"DWV_CLICKED", OnCellClicked); |
| | | AttachEvent(L"dw_cell", L"CELL_ITEMCHANGED", OnCellItemChanged); |
| | | AttachEvent(L"dw_cell", L"CELL_SELECTCHANGED", OnCellSelectChanged); |
| | | AttachEvent(L"dw_cell", L"DWV_CLICKED", (FEvent)&QuoteFileView::OnCellClicked); |
| | | AttachEvent(L"dw_cell", L"CELL_ITEMCHANGED", (FEvent)&QuoteFileView::OnCellItemChanged); |
| | | AttachEvent(L"dw_cell", L"CELL_SELECTCHANGED", (FEvent)&QuoteFileView::OnCellSelectChanged); |
| | | return 1; |
| | | } |
| | | |
| | |
| | | xstring templ = L""; |
| | | taskid = L""; |
| | | xaserverarg arg; |
| | | if (GetParam()) { |
| | | arg ; |
| | | arg.setNativePointer(GetParam()); |
| | | if (GetWinParam()) { |
| | | arg = GetArg(); |
| | | templ = arg.GetArgString(L"template"); |
| | | entityID = arg.GetArgString(L"EntityID"); |
| | | taskid = arg.GetArgString(L"TaskID"); |
| | |
| | | |
| | | dw_cell.openUrl(templateurl); |
| | | */ |
| | | //win32::SetWindowText(GetHWND(),L"报价文件:[new]"); |
| | | //SetWindowText(GetHWND(),L"报价文件:[new]"); |
| | | } |
| | | |
| | | ARow = 0; |
| | |
| | | } |
| | | } |
| | | |
| | | OnAttachEvent(); |
| | | OnAttachListon(); |
| | | filename = L""; |
| | | |
| | | /* #define LayerFlow_None 0x00000001 //not layer space |
| | |
| | | xaserverarg arg ; |
| | | arg.setNativePointer(xaserverarg::CreateInstance()); |
| | | arg.AddArg(L"value", content); |
| | | OpenWindow(L"dev:xpage[QuoteSupplierItem.vx]", cast(arg as int)); |
| | | OpenWindow(L"dev:xpage[QuoteSupplierItem.vx]", arg); |
| | | |
| | | return 1; |
| | | } |
| | |
| | | bool hasParty(xstring name) |
| | | { |
| | | xml x ; |
| | | |
| | | xaserverarg arg ; |
| | | arg.setNativePointer(xaserverarg::CreateInstance()); |
| | | arg.AddArg(L"Name", name); |
| | | if (getUrl(L"/sale/data/SupplierV3/HasParty", arg.GetString(), x) != 1) |
| | | { |
| | | alert(L"error:" + x.xml()); |
| | | alert((xstring)L"error:" + x.xml()); |
| | | } |
| | | xstring count = x.documentElement.getAttribute(L"count"); |
| | | xstring count = x.documentElement().getAttribute(L"count"); |
| | | if (count != L"0") return true; |
| | | |
| | | return false; |
| | |
| | | |
| | | int LoadPurcher() |
| | | { |
| | | purcher ; |
| | | purcher.setNativePointer(xml::CreateInstance()); |
| | | xml purcher ; |
| | | xaserverarg arg ; |
| | | arg.setNativePointer(xaserverarg::CreateInstance()); |
| | | arg.AddArg(L"id", L"采购员"); |
| | | if (getUrl(L"/sale/data/Quote/Purcher", arg.GetString(), purcher) != 1) |
| | | { |
| | | alert(L"error:" + purcher.GetXml()); |
| | | alert((xstring)L"error:" + purcher.xml()); |
| | | } |
| | | return 1; |
| | | } |
| | |
| | | LoadPurcher(); |
| | | |
| | | xaserverarg arg; |
| | | if (GetParam()) { |
| | | arg ; |
| | | arg.setNativePointer(GetParam()); |
| | | if (GetWinParam()) { |
| | | arg = GetArg(); |
| | | if (arg.GetArgString(L"bill.purchor") == L"1") OnNextPurch(); |
| | | } |
| | | return 1; |