use "xcontrol.vframe.vbusiness.vd"
|
use "xbase.vframe.vbusiness.vd"
|
use "multi.vbind.vbind.wface.vd"
|
use "productlibrary.vd"
|
use "shoppingcart.vd"
|
|
unit trade
|
[
|
class ViewPictures : public frame
|
{
|
msxml::IXMLDOMElement imageElement;
|
string m_customer;
|
|
int OnCmdDispatch(string comdid)
|
{
|
if (comdid == "xmClose")
|
{
|
CloseWindow();
|
return 1;
|
}
|
return 0;
|
}
|
|
int OnXCommand(ref TXCommandEvent evt, int p)
|
{
|
return OnCmdDispatch(evt.pStrID);
|
}
|
|
int OnAttachEvent()
|
{
|
AttachEvent("WM_XCOMMAND", OnXCommand);
|
return 1;
|
}
|
|
int OnShowImage(string skuid)
|
{
|
imageview im = GetControl("im1");
|
//im.RemoveImage();
|
im.ResetEx();
|
|
xml xp = new xml;
|
xp.setNativePointer(xml::CreateInstance());
|
xaserverarg arg_pic = new xaserverarg;
|
arg_pic.setNativePointer(arg_pic.CreateInstance());
|
arg_pic.AddArg("SKUID", skuid);
|
if (url::get("/sale/data/ProductLibrary3/pref/picture/imagelistSKU", arg_pic.GetString(), xp) != 1)
|
{
|
trace("xxx", xp.GetXml());
|
}
|
else
|
{
|
|
trace(skuid + "===== " + xp.GetXml());
|
imageElement = xp.GetXmlDoc().documentElement;
|
msxml::IXMLDOMNodeList nlistp = xp.GetXmlDoc().selectNodes("ImageList/image");
|
int lenp = nlistp.length;
|
for (int ip = 0; ip < lenp; ip++)
|
{
|
msxml::IXMLDOMElement xitem = nlistp.item(ip);
|
string picname = xitem.selectSingleNode("PicPath").text;
|
string goodno = xitem.selectSingleNode("GoodsNo").text;
|
if (picname == "/business/products/Thumbs//")
|
picname = "/business/products/Thumbs/00/00000000-0000-0000-0000-000000000000.jpg";
|
im.AddImages(picname, "");
|
}
|
im.Redraw();
|
//win32::SendMessage(im.GetId(),0x000f,0,1);
|
//win32::InvalidateRect(im.GetId(),cast(0 as ref xrect),true);
|
}
|
return 1;
|
}
|
|
int onload()
|
{
|
OnAttachEvent();
|
xaserverarg arg = new xaserverarg;
|
arg.setNativePointer(arg.CreateInstance());
|
int p = GetParam();
|
arg.setNativePointer(p);
|
string skuid = arg.GetArgString("guid");
|
string customerItemNo = arg.GetArgString("CustomerItemNo");
|
OnShowImage(skuid);
|
return 1;
|
}
|
};
|
]
|