use "dev:code[SKUTemplate.vx]"
|
|
unit vbusiness.vpage
|
[
|
SKUTemplateImport is extend SKUTemplate;
|
about SKUTemplateImport
|
[
|
field:
|
xdwgrid__ dw_list;
|
xdwtable__ dw_other;
|
xdwtable__ dw_prop;
|
method:
|
[
|
|
string jxParam(string p, string n)
|
{
|
if(p != "")
|
{
|
|
int i = 1;
|
while (p.find("=",0)>0)
|
{
|
string name = p.mid(0, p.find("=",0));
|
string value = p.mid(p.find("=",0) + 1, p.find("=",0) - 1);
|
return ""+value;
|
i += 1;
|
}
|
}
|
return "";
|
}
|
int OnSelectAll()
|
{
|
if(this.dw_list.GetRowCount() > 0 )
|
this.dw_list.SelectRow(1,true);
|
|
this.dw_list.SelectRow(0,true);
|
this.dw_list.Redraw();
|
return 1;
|
}
|
|
int OnSelectNo()
|
{
|
this.dw_list.SelectRow(0,false);
|
this.dw_list.Redraw();
|
return 1;
|
}
|
|
int OnOk()
|
{
|
dw_other.openUrl("/sale/view/CustomerGoods/template/CustomerGoods/itemother");
|
dw_other.SetColHeaderHeight(0);
|
dw_other.SetRowSelectorWidth(0);
|
int row = SKUTemplate::dw_list.GetNextSelectRow(1);
|
if (row<1)
|
{
|
alert("ÇëÑ¡ÔñÄ£°å!");
|
return 1;
|
}
|
|
msxml::IXMLDOMElement e =SKUTemplate::dw_list.GetRowElement(row);
|
string TemplateContent = e.selectSingleNode("TemplateContent").text+"";
|
string TemplateID = e.selectSingleNode("TemplateID").text+"";
|
//trace(ItemName);
|
xml__ x = new xml__;
|
x.setNativePointer(x.CreateInstance());
|
x.LoadXml(TemplateContent);
|
dw_other.Retrieve(x);
|
dw_prop.SetItemString(1,"TemplateID",TemplateID);
|
CloseWindow();
|
return 1;
|
}
|
|
int OnCancel()
|
{
|
CloseWindow();
|
return 1;
|
}
|
int OnDoubleClicked(ref TNotifyEvent evt,int p)
|
{
|
OnOk();
|
return 1;
|
}
|
|
int OnCmdDispatch(string comdid)
|
{
|
if (comdid=="SelectAll") OnSelectAll();
|
else if (comdid=="SelectNo") OnSelectNo();
|
else if (comdid=="cb_import") OnOk();
|
else if (comdid=="cb_close") OnCancel();
|
//else if (comdid=="query") GridSearch();
|
return 0;
|
}
|
|
int OnXCommand(ref TXCommandEvent evt,int p)
|
{
|
return OnCmdDispatch(evt.pStrID);
|
}
|
|
int onload()
|
{
|
if (GetParam())
|
{
|
int iArgs = GetParam();
|
xaserverarg__ arg1 = new xaserverarg__;
|
arg1.setNativePointer(iArgs);
|
dw_other = new xdwtable__;
|
dw_other.setNativePointer(arg1.GetArgString("dw_other").toInt());
|
dw_prop = new xdwtable__;
|
dw_prop.setNativePointer(arg1.GetArgString("dw_prop").toInt());
|
}
|
//trace(dw_other.__nativept);
|
SKUTemplate::onload();
|
SKUTemplate::dw_list.SetSelectionMode(1); //3
|
SKUTemplate::dw_list.SetReadOnly(true);
|
AttachEvent("WM_XCOMMAND",OnXCommand);
|
AttachEvent("dw_list","DWV_DOUBLECLICKED",OnDoubleClicked);//ÐÐË«»÷
|
}
|
]
|
]
|
]
|