|  |  | 
 |  |  | #include <wobject/xstring.hpp> | 
 |  |  | #include <xcontrol/xtreeview.hpp> | 
 |  |  | #include <xcontrol/xdwgrid.hpp> | 
 |  |  | #include <xcontrol/xcheckbox.hpp> | 
 |  |  |  | 
 |  |  | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" | 
 |  |  | #include "viewobject/view.base.hpp" | 
 |  |  | 
 |  |  |    } | 
 |  |  |  | 
 |  |  | public: | 
 |  |  |    xstring m_sType; //树选中的类型 | 
 |  |  |    xstring m_sTypeTxt; //树选中的数据 | 
 |  |  |    xstring m_sType; //树选中的类型 | 
 |  |  |    xstring m_sTypeTxt; //树选中的数据 | 
 |  |  |    xstring urlTree; | 
 |  |  |    xstring myDataUrl; | 
 |  |  |    xstring myDataUrl1; | 
 |  |  | 
 |  |  |          if(agent) | 
 |  |  |          { | 
 |  |  |             xstring s = agent.xml(); | 
 |  |  |             m_agentNode =  SetAgentNodeContent (anode,s); | 
 |  |  |             m_agentNode =  SetAgentNode(anode,s); | 
 |  |  |          } | 
 |  |  |       //} | 
 |  |  |       return 1; | 
 |  |  | 
 |  |  |        | 
 |  |  |       xml x ; | 
 |  |  |  | 
 |  |  |       xaserverarg& arg = *new xaserverarg; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance());	 | 
 |  |  |       xaserverarg arg; | 
 |  |  | 		 | 
 |  |  |       arg.AddArg(L"scene",scene,L"xs:xstring");  | 
 |  |  |       arg.AddArg(L"EntityID",EntityID,L"xs:xstring");  | 
 |  |  |       arg.AddArg(L"EntityName",GetEntityName(1),L"xs:xstring");  | 
 |  |  | 
 |  |  |       }*/ | 
 |  |  |       tools +=L"</vbox>"; | 
 |  |  |       //trace(tools); | 
 |  |  |       SetAgentNodeContent(anode, tools); | 
 |  |  |       SetAgentNode(anode, tools); | 
 |  |  |  | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  | 
 |  |  |    } | 
 |  |  |     | 
 |  |  |    //process tree | 
 |  |  |    //查找当前树项的顶级目录 | 
 |  |  |    //查找当前树项的顶级目录 | 
 |  |  |    HTREEITEM LookupTopFolder(HTREEITEM hItem) | 
 |  |  |    { | 
 |  |  |       HTREEITEM hRoot = tv_folder.GetRootItem(); | 
 |  |  | 
 |  |  |       {    | 
 |  |  |          KXMLDOMElement e = nlist.item(i); | 
 |  |  |          xstring name = e.getAttribute(L"name"); | 
 |  |  |          HTREEITEM h = tv_folder.InsertChildItem(hItem, name, (LPARAM)&e, image); | 
 |  |  |          HTREEITEM h = tv_folder.InsertChildItem(hItem, name, e, image); | 
 |  |  |          ExpandCatChildFolder(tv_folder,h,e,35); | 
 |  |  |       } | 
 |  |  |       return 1; | 
 |  |  | 
 |  |  |       {    | 
 |  |  |          KXMLDOMElement e = nlist.item(i); | 
 |  |  |          xstring name = e.getAttribute(L"name"); | 
 |  |  |          HTREEITEM h = tv_folder.InsertChildItem(hItem, name, (LPARAM)&e,35); | 
 |  |  |          HTREEITEM h = tv_folder.InsertChildItem(hItem, name, e,35); | 
 |  |  |          ExpandCatChildFolder(tv_folder,h,e,35); | 
 |  |  |       } | 
 |  |  |       return 1;             | 
 |  |  |    }    | 
 |  |  |  | 
 |  |  |    //树展开 | 
 |  |  |    //树展开 | 
 |  |  |    int OnTreeExpanding(TEvent* evt, int p) | 
 |  |  |    { | 
 |  |  |       NMTREEVIEW& nmtv = *(NMTREEVIEW*)evt->notify.pnmh; | 
 |  |  | 
 |  |  |       xstring name = tv_folder.GetItemLabel(hTopItem); | 
 |  |  |       HTREEITEM child = tv_folder.GetChildItem(hItem); | 
 |  |  |  | 
 |  |  |       KXMLDOMElement& e = *(KXMLDOMElement*)tv_folder.GetItemData(hItem); | 
 |  |  |       KXMLDOMElement e = tv_folder.GetItemData(hItem); | 
 |  |  |       if (!child)ExpandFolderItem(tv_folder,hItem,e.getAttribute(L"no")); | 
 |  |  |  | 
 |  |  |       return 1; | 
 |  |  | 
 |  |  |       xstring name = tv_folder_pricebill.GetItemLabel(hTopItem); | 
 |  |  |       HTREEITEM child = tv_folder_pricebill.GetChildItem(hItem); | 
 |  |  |  | 
 |  |  |       KXMLDOMElement& e = *(KXMLDOMElement*)tv_folder_pricebill.GetItemData(hItem); | 
 |  |  |       KXMLDOMElement e = tv_folder_pricebill.GetItemData(hItem); | 
 |  |  |       if (!child)ExpandFolderItem(tv_folder_pricebill,hItem,e.getAttribute(L"no")); | 
 |  |  |  | 
 |  |  |       return 1; | 
 |  |  | 
 |  |  |          int image = 15; | 
 |  |  |          if(sImage) image = sImage.toInt(); | 
 |  |  |           | 
 |  |  |          HTREEITEM h = tv_folder.InsertChildItem(hItem, name, (LPARAM)&e, image); | 
 |  |  |          HTREEITEM h = tv_folder.InsertChildItem(hItem, name, e, image); | 
 |  |  |          if(child !=L"no" ) tv_folder.SetItemChild(h,1); | 
 |  |  |          ExpandChildFolder(tv_folder,h,e); | 
 |  |  |       } | 
 |  |  | 
 |  |  |          xstring str = x.documentElement().getAttribute(L"text"); | 
 |  |  |          if(str == L"true") | 
 |  |  |          { | 
 |  |  |             alert(L"保存成功!");  | 
 |  |  |             alert(L"保存成功!");  | 
 |  |  |             dw_pricelistshare.ResetUpdateStatus(); | 
 |  |  |          }else  | 
 |  |  |          { | 
 |  |  |             alert(L"保存失败!"); | 
 |  |  |             alert(L"保存失败!"); | 
 |  |  |          } | 
 |  |  |       } | 
 |  |  |       if(x) x.Free(); | 
 |  |  |        | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  | 
 |  |  |       KXMLDOMElement xitem = nlist.item(0); | 
 |  |  |        | 
 |  |  |       xstring Reciever = xitem.selectSingleNode(L"userno").text();  | 
 |  |  |       xstring Subject = L"价格单已共享["+CName+L"]"; | 
 |  |  |       xstring Category = L"价格单共享"; | 
 |  |  |       xstring Subject = L"价格单已共享["+CName+L"]"; | 
 |  |  |       xstring Category = L"价格单共享"; | 
 |  |  |       xstring Content  = L""; | 
 |  |  |       KXMLDOMDocument x = ViewObject::AddMessage(Category, Reciever, NO, EntityID, Subject, Content); | 
 |  |  |       ViewObject::AddMessage(GetServerUrl(),Category, Reciever, NO, EntityID, Subject, Content); | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |    int SendNotice(xml content) | 
 |  |  | 
 |  |  |       xml x ; | 
 |  |  |        | 
 |  |  |       xaserverarg arg ; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance());	 | 
 |  |  | 		 | 
 |  |  |        | 
 |  |  |       dw_pricelistex.DwUpdateAllToEx(x); | 
 |  |  |       if(x.xml()!=L"") | 
 |  |  | 
 |  |  |                dw_pricelistex.ResetUpdateStatus(); | 
 |  |  |             }else  | 
 |  |  |             { | 
 |  |  |                alert(L"成品价格单保存失败!"); | 
 |  |  |                alert(L"成品价格单保存失败!"); | 
 |  |  |                return 1; | 
 |  |  |             } | 
 |  |  |          } | 
 |  |  | 
 |  |  |          xml x0 ; | 
 |  |  |           | 
 |  |  |          dw_pricelist.DwUpdateAllToEx(x0); | 
 |  |  |          if(x0.xml() !=L"") | 
 |  |  |          if((xstring)x0.xml() !=L"") | 
 |  |  |          { | 
 |  |  |             xml x1 = xml::Make(); | 
 |  |  |             xml x1; | 
 |  |  |             dw_priceitem.DwUpdateAllToEx(x1); | 
 |  |  |             if(x0.documentElement()) | 
 |  |  |             { | 
 |  |  |                if(x1.documentElement()) | 
 |  |  |                   x0.documentElement().appendChild(x1.documentElement()); | 
 |  |  |             }          | 
 |  |  |             x1.Free(); | 
 |  |  |             arg.AddArg(L"content", x0.xml() );    | 
 |  |  |             x0.Free(); | 
 |  |  |             if(xurl::get(L"/sale/data/Enquiry/update/pricelist", arg.GetString(),x)!=1) | 
 |  |  |             { | 
 |  |  |                error = x.text(); | 
 |  |  | 
 |  |  |                   dw_priceitem.ResetUpdateStatus(); | 
 |  |  |                }else  | 
 |  |  |                { | 
 |  |  |                   alert(L"组件价格单保存失败!"); | 
 |  |  |                   alert(L"组件价格单保存失败!"); | 
 |  |  |                   return 1; | 
 |  |  |                } | 
 |  |  |             } | 
 |  |  | 
 |  |  |          if(str == L"true") | 
 |  |  |          { | 
 |  |  |             dw_pricelistshare.ResetUpdateStatus(); | 
 |  |  |             alert(L"保存成功!");  | 
 |  |  |             OnProductPriceShareRetrieve();//刷新数据 | 
 |  |  |             SendNotice(x2);//发送通知 | 
 |  |  |             x2.Free(); | 
 |  |  |             alert(L"保存成功!");  | 
 |  |  |             OnProductPriceShareRetrieve();//刷新数据 | 
 |  |  |             SendNotice(x2);//发送通知 | 
 |  |  |          }else  | 
 |  |  |          { | 
 |  |  |             alert(L"共享数据保存失败!"); | 
 |  |  |             alert(L"共享数据保存失败!"); | 
 |  |  |          } | 
 |  |  |       } | 
 |  |  |       x.Free(); | 
 |  |  |        | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |           | 
 |  |  |    int ViewUpdate(int pr,xstring updateItem,xaserverarg  arg) | 
 |  |  |    int ViewUpdate(LPARAM  pr,xstring updateItem,xaserverarg  arg) | 
 |  |  |    { | 
 |  |  |       if(   updateItem==L"del") | 
 |  |  |       { | 
 |  |  | 
 |  |  |       return false; | 
 |  |  |    } | 
 |  |  |           | 
 |  |  |    //检索 | 
 |  |  |    //检索 | 
 |  |  |    int OnPreRetrieve() | 
 |  |  |    { | 
 |  |  |     | 
 |  |  |       int hItem = tv_folder.GetSelectedItem(); | 
 |  |  |       if(hItem <=0) return 1; | 
 |  |  |       HTREEITEM hItem = tv_folder.GetSelectedItem(); | 
 |  |  |       if(!hItem) return 1; | 
 |  |  |        | 
 |  |  |       int    hCursor = xutil::SetCursorWait(); | 
 |  |  |       KXMLDOMElement e1 = cast(tv_folder.GetItemData(hItem) as KXMLDOMElement); | 
 |  |  |       HCURSOR    hCursor = xutil::SetCursorWait(); | 
 |  |  |       KXMLDOMElement e1 = tv_folder.GetItemData(hItem); | 
 |  |  |       xstring no = e1.getAttribute(L"no"); | 
 |  |  |       xml x = 0; | 
 |  |  |       if(!(no ==L"Category:All" && IsEmptyQueryStr(m_QueryTxt))) | 
 |  |  | 
 |  |  |          dw_list.Redraw(); | 
 |  |  |       }else | 
 |  |  |       { | 
 |  |  |          dw_list.ResetEx(); | 
 |  |  |          dw_list.Reset(); | 
 |  |  |          dw_list.Redraw(); | 
 |  |  |          dw_goods.ResetEx(); | 
 |  |  |          dw_goods.Reset(); | 
 |  |  |          dw_goods.Redraw(); | 
 |  |  |       } | 
 |  |  |        | 
 |  |  | 
 |  |  |          dw_list2.Redraw(); | 
 |  |  |       }else | 
 |  |  |       { | 
 |  |  |          dw_list2.ResetEx(); | 
 |  |  |          dw_list2.Reset(); | 
 |  |  |          dw_list2.Redraw(); | 
 |  |  |          dw_goods2.ResetEx(); | 
 |  |  |          dw_goods2.Reset(); | 
 |  |  |          dw_goods2.Redraw(); | 
 |  |  |       } | 
 |  |  |        | 
 |  |  | 
 |  |  |          dw_list1.Redraw(); | 
 |  |  |       }else | 
 |  |  |       { | 
 |  |  |          dw_list1.ResetEx(); | 
 |  |  |          dw_list1.Reset(); | 
 |  |  |          dw_list1.Redraw(); | 
 |  |  |          dw_goods1.ResetEx(); | 
 |  |  |          dw_goods1.Reset(); | 
 |  |  |          dw_goods1.Redraw(); | 
 |  |  |       } | 
 |  |  |       x = ViewObject::RetrieveData(myDataUrl1,L"no",no,L"QueryTxt", m_QueryTxt); | 
 |  |  | 
 |  |  |          dw_list1.Redraw(); | 
 |  |  |       }else | 
 |  |  |       { | 
 |  |  |          dw_list1.ResetEx(); | 
 |  |  |          dw_list1.Reset(); | 
 |  |  |          dw_list1.Redraw(); | 
 |  |  |          dw_goods1.ResetEx(); | 
 |  |  |          dw_goods1.Reset(); | 
 |  |  |          dw_goods1.Redraw(); | 
 |  |  |       } | 
 |  |  |       dw_list1.SetReadOnly(true); | 
 |  |  | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |  | 
 |  |  |    //历史数据 | 
 |  |  |    //历史数据 | 
 |  |  |    int Onhistroydata() | 
 |  |  |    { | 
 |  |  |       return 1; | 
 |  |  | 
 |  |  |       if(row>0) | 
 |  |  |       {                | 
 |  |  |          KXMLDOMElement e =dw_list.GetRowElement(row); | 
 |  |  |          xaserverarg arg=new xaserverarg; | 
 |  |  |          arg.setNativePointer(arg.CreateInstance());	 | 
 |  |  |          xaserverarg arg;	 | 
 |  |  |          xstring sCustomerID = e.selectSingleNode(L"CustomerID").text();  | 
 |  |  |          arg.AddArg(L"CustomerID",sCustomerID,L""); | 
 |  |  |          xstring sCustomerName = e.selectSingleNode(L"CustomerName").text();  | 
 |  |  |          arg.AddArg(L"CustomerName",sCustomerName,L""); | 
 |  |  |          arg.AddArg(L"EntityName",GetEntityName(1),L""); | 
 |  |  |          arg.AddArg(L"EntityID",GetEntityID(1),L""); | 
 |  |  |          int p = arg.ptr_native_; | 
 |  |  |          openUrl(L"/sale/view/Enquiry3/xpage/histroydata", p);  | 
 |  |  |          openUrl(L"/sale/view/Enquiry3/xpage/histroydata", &arg);  | 
 |  |  |       } | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |     | 
 |  |  |    int OnPrint() | 
 |  |  |    { | 
 |  |  |       xaserverarg arg=new xaserverarg; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance());	 | 
 |  |  |       xaserverarg arg;	 | 
 |  |  |       arg.AddArg(L"EntityName",L"Enquiry",L""); | 
 |  |  |       arg.AddArg(L"EntityID",GetEntityID(1),L""); | 
 |  |  |       arg.AddArg(L"EntityNo",GetEntityNo(1),L""); | 
 |  |  |       int p = arg.ptr_native_; | 
 |  |  |       openUrl(L"/sale/view/view.base/xpage/Template/PrintViewEx", p); | 
 |  |  |       openUrl(L"/sale/view/view.base/xpage/Template/PrintViewEx", &arg); | 
 |  |  |       return 0; | 
 |  |  |    } | 
 |  |  |     | 
 |  |  | 
 |  |  |    { | 
 |  |  |       dw_priceitem.Reset(); | 
 |  |  |           | 
 |  |  |       xaserverarg arg = xaserverarg::Make(); | 
 |  |  |       xaserverarg arg; | 
 |  |  |       arg.AddArg(L"action",L"AddPriceList"); | 
 |  |  |           | 
 |  |  |       OpenWindow(L"dev:xpage[ProductSchemaSelect.vx]",cast(arg as int)); | 
 |  |  |       OpenWindow(L"dev:xpage[ProductSchemaSelect.vx]",arg); | 
 |  |  |       if(arg.GetArgString(L"process") == L"ok") | 
 |  |  |       { | 
 |  |  |        | 
 |  |  |          xml x = new xml; | 
 |  |  |          x.setNativePointer(xml::CreateInstance()); | 
 |  |  |          xml x; | 
 |  |  |          if (getUrl(L"/sale/data/Enquiry/PriceListEx/SKU",arg.GetString(),x)!=1) return 1; | 
 |  |  |          KXMLDOMNodeList nodes = x.selectNodes(L"data/Item"); | 
 |  |  |          int len = nodes.length(); | 
 |  |  | 
 |  |  |             } | 
 |  |  |             KXMLDOMNodeList items = ele.selectNodes(L"data/Item"); | 
 |  |  |             AddItems(id,items); | 
 |  |  |             items.Release(); | 
 |  |  |             ele.Release(); | 
 |  |  |          } | 
 |  |  |          x.Free(); | 
 |  |  |          nodes.Release(); | 
 |  |  |       } | 
 |  |  |       arg.Free(); | 
 |  |  |       //OnRetrieveItem(dw_pricelist.GetGuid(row)); | 
 |  |  |       return  1; | 
 |  |  |    } | 
 |  |  | 
 |  |  |        | 
 |  |  |       dw_priceitem.Reset(); | 
 |  |  |           | 
 |  |  |       xaserverarg arg = xaserverarg::Make(); | 
 |  |  |       xml x = new xml; | 
 |  |  |       x.setNativePointer(xml::CreateInstance()); | 
 |  |  |       xaserverarg arg ; | 
 |  |  |       xml x; | 
 |  |  |       arg.AddArg(L"SKUID",dw_pricelist.GetItemString(row,L"SKUID")); | 
 |  |  |       arg.AddArg(L"SchemaNo",dw_pricelist.GetItemString(row,L"BOMSchema")); | 
 |  |  |       if (getUrl(L"/sale/data/Enquiry/PriceListEx/SKU",arg.GetString(),x)!=1) return 1; | 
 |  |  | 
 |  |  |          } | 
 |  |  |          KXMLDOMNodeList items = ele.selectNodes(L"data/Item"); | 
 |  |  |          AddItems(id,items); | 
 |  |  |          items.Release(); | 
 |  |  |          ele.Release(); | 
 |  |  |       } | 
 |  |  |       nodes.Release(); | 
 |  |  |       x.Free(); | 
 |  |  |       arg.Free(); | 
 |  |  |        | 
 |  |  |       //OnRetrieveItem(dw_pricelist.GetGuid(row)); | 
 |  |  |       return  1; | 
 |  |  | 
 |  |  |       if(dw_pricelist.GetRow() < 1) return 1; | 
 |  |  |        | 
 |  |  |       int row = dw_pricelist.GetRow(); | 
 |  |  |       xaserverarg arg= new xaserverarg; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance());						 | 
 |  |  |       xaserverarg arg;						 | 
 |  |  |       arg.AddArg(L"SKUID",dw_pricelist.GetItemString(row,L"SKUID")); | 
 |  |  |       arg.AddArg(L"SchemaNo",dw_pricelist.GetItemString(row,L"BOMSchema")); | 
 |  |  |       OpenWindow(L"dev:xpage[PriceList.PurcharItemSelect.vx]",cast(arg as int)); | 
 |  |  |       OpenWindow(L"dev:xpage[PriceList.PurcharItemSelect.vx]",arg); | 
 |  |  |       xstring id = dw_pricelist.GetGuid(dw_pricelist.GetRow()); | 
 |  |  |       if(id==L"") | 
 |  |  |       { | 
 |  |  | 
 |  |  |       if(arg.GetArgString(L"process")==L"ok") | 
 |  |  |       { | 
 |  |  |          xstring content = arg.GetArgString(L"result"); | 
 |  |  |          xml x = xml::Make(); | 
 |  |  |          x.LoadXml(content); | 
 |  |  |          xml x; | 
 |  |  |          x.loadXML(content); | 
 |  |  |          KXMLDOMNodeList nodes = x.selectNodes(L"data/Item"); | 
 |  |  |          AddItems(id,nodes); | 
 |  |  |          nodes.Release(); | 
 |  |  |          xstring PriceInfo = L""; | 
 |  |  |          for(int i=1;i<=dw_pricelist.GetRowCount();i++) | 
 |  |  |          { | 
 |  |  | 
 |  |  |       return 1; | 
 |  |  |    }                | 
 |  |  |              | 
 |  |  |    int OnRowChanged(ref TNotifyEvent evt,int p) | 
 |  |  |    int OnRowChanged(TEvent* evt,LPARAM p) | 
 |  |  |    { | 
 |  |  |       listwin::OnRowChanged(evt,p); | 
 |  |  |        | 
 |  |  |       ref DWNMHDR  hdr = trust(evt.pnmh as ref DWNMHDR); | 
 |  |  |       DWNMHDR&  hdr = *(DWNMHDR*)evt->notify.pnmh; | 
 |  |  |       int row = hdr.row; | 
 |  |  |        | 
 |  |  |       int    hCursor = xutil::SetCursorWait(); | 
 |  |  |       HCURSOR    hCursor = xutil::SetCursorWait(); | 
 |  |  |       xstring EnquiryNo = dw_list.GetItemString(row,L"EnquiryNo"); | 
 |  |  |       xml x = ViewObject::RetrieveData(L"/sale/data/Enquiry/maint",L"id",EnquiryNo); | 
 |  |  |       if(x) | 
 |  |  | 
 |  |  |        | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |    int OnRowChanged2(ref TNotifyEvent evt,int p) | 
 |  |  |    int OnRowChanged2(TEvent* evt,LPARAM p) | 
 |  |  |    { | 
 |  |  |       ref DWNMHDR  hdr = trust(evt.pnmh as ref DWNMHDR); | 
 |  |  |       DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; | 
 |  |  |       int row = hdr.row; | 
 |  |  |        | 
 |  |  |       int    hCursor = xutil::SetCursorWait(); | 
 |  |  |       HCURSOR   hCursor = xutil::SetCursorWait(); | 
 |  |  |       xstring EnquiryNo = dw_list2.GetItemString(row,L"EnquiryNo"); | 
 |  |  |       xml x = ViewObject::RetrieveData(L"/sale/data/Enquiry/maint",L"id",EnquiryNo); | 
 |  |  |       if(x) | 
 |  |  | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |  | 
 |  |  |    int OnRowChanged1(ref TNotifyEvent evt,int p) | 
 |  |  |    int OnRowChanged1(TEvent* evt, LPARAM p) | 
 |  |  |    { | 
 |  |  |       //fixed one event only one process | 
 |  |  |       //listwin::OnRowChanged(evt,p); | 
 |  |  |        | 
 |  |  |       ref DWNMHDR  hdr = trust(evt.pnmh as ref DWNMHDR); | 
 |  |  |       DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; | 
 |  |  |       int row = hdr.row; | 
 |  |  |        | 
 |  |  |       int    hCursor = xutil::SetCursorWait(); | 
 |  |  |       HCURSOR   hCursor = xutil::SetCursorWait(); | 
 |  |  |       xstring ItemID = dw_list1.GetItemString(row,L"ItemID"); | 
 |  |  |       //alert(ItemID); | 
 |  |  |       xml x = ViewObject::RetrieveData(L"/sale/data/Enquiry/folder/listitemsex",L"itemID",ItemID,L"type",state2.toString()); | 
 |  |  |       xml x = ViewObject::RetrieveData(L"/sale/data/Enquiry/folder/listitemsex",L"itemID",ItemID,L"type",xstring(state2)); | 
 |  |  |       if(x) | 
 |  |  |          dw_goods1.Retrieve(x); | 
 |  |  |       else | 
 |  |  | 
 |  |  |        | 
 |  |  |    int OnShare() | 
 |  |  |    { | 
 |  |  |       xaserverarg arg = new xaserverarg; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance());	 | 
 |  |  |       xaserverarg arg;	 | 
 |  |  |  | 
 |  |  |       OpenWindow(L"dev:xpage[UserGroupShareEx.vx]",cast(arg as int)); | 
 |  |  |       OpenWindow(L"dev:xpage[UserGroupShareEx.vx]",arg); | 
 |  |  |       if(arg.GetArgString(L"process")==L"ok") | 
 |  |  |       { | 
 |  |  |          xdwgrid dw_obj = dw_pricelistex; | 
 |  |  |          if(sheetname==L"tab_pricebillex") dw_obj = dw_pricelist; | 
 |  |  |           | 
 |  |  |          sheetname=L"tab_pricebillshare"; | 
 |  |  |          SetAgent(L"list"); | 
 |  |  |          xframe::SetAgent(L"list"); | 
 |  |  |          SwitchLayer(L"sheet5",L"frame"); | 
 |  |  |          xml x = xml::Make(); | 
 |  |  |          x.LoadXml(arg.GetArgString(L"result")); | 
 |  |  |          xml x; | 
 |  |  |          x.loadXML(arg.GetArgString(L"result")); | 
 |  |  |          KXMLDOMNodeList nodes = x.selectNodes(L"root/item"); | 
 |  |  |          int count = nodes.length(); | 
 |  |  |          int row = dw_obj.GetNextSelectRow(1); | 
 |  |  | 
 |  |  |                dw_pricelistshare.SetItemString(crow,L"NO",No); | 
 |  |  |                dw_pricelistshare.SetItemString(crow,L"GroupOrEmp",GroupOrEmp); | 
 |  |  |                dw_pricelistshare.SetItemString(crow,L"EntityID",EntityID); | 
 |  |  |                dw_pricelistshare.SetItemString(crow,L"EntityName",L"产品价格单"); | 
 |  |  |                dw_pricelistshare.SetItemString(crow,L"EntityName",L"产品价格单"); | 
 |  |  |                if(node.selectSingleNode(L"UserGroupID")) | 
 |  |  |                   dw_pricelistshare.SetItemString(crow,L"UserGroupID",node.selectSingleNode(L"UserGroupID").text()); | 
 |  |  |                if(node.selectSingleNode(L"PersonID")) | 
 |  |  | 
 |  |  |                 | 
 |  |  |    int OnShare2() | 
 |  |  |    { | 
 |  |  |       xaserverarg arg = new xaserverarg; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance());	 | 
 |  |  |       xaserverarg arg ;	 | 
 |  |  |  | 
 |  |  |       OpenWindow(L"dev:xpage[UserGroupShareEx.vx]",cast(arg as int)); | 
 |  |  |       OpenWindow(L"dev:xpage[UserGroupShareEx.vx]",arg); | 
 |  |  |        | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |     | 
 |  |  |    int OnTransPriceBillEx() | 
 |  |  |    { | 
 |  |  |       xaserverarg arg= new xaserverarg; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance());			 | 
 |  |  |       xaserverarg arg;			 | 
 |  |  |       arg.AddArg(L"no",L"Category:All"); | 
 |  |  |       arg.AddArg(L"QueryTxt",L""); | 
 |  |  |       OpenWindow(L"dev:xpage[PriceList.PurcharItemSelectEx.vx]",cast(arg as int)); | 
 |  |  |       OpenWindow(L"dev:xpage[PriceList.PurcharItemSelectEx.vx]",arg); | 
 |  |  |       if(arg.GetArgString(L"process") == L"ok") | 
 |  |  |       { | 
 |  |  |          xml x = new xml; | 
 |  |  |          x.setNativePointer(xml::CreateInstance()); | 
 |  |  |          x.LoadXml(arg.GetArgString(L"result")); | 
 |  |  |          xml x; | 
 |  |  |          x.loadXML(arg.GetArgString(L"result")); | 
 |  |  |          KXMLDOMNodeList nodes = x.selectNodes(L"data/Item"); | 
 |  |  |          int len = nodes.length(); | 
 |  |  |          for(int i=0; i<len;i++) | 
 |  |  | 
 |  |  |             if(ele.selectSingleNode(L"EnquiryLineID")) dw_pricelistex.SetItemString(row,L"EnquiryLineID",ele.selectSingleNode(L"EnquiryLineID").text()); | 
 |  |  |             ele.Release(); | 
 |  |  |          } | 
 |  |  |          x.Free(); | 
 |  |  |          nodes.Release(); | 
 |  |  |       } | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |     | 
 |  |  |    int OnTransPriceBill() | 
 |  |  |    { | 
 |  |  |       xaserverarg arg= new xaserverarg; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance());			 | 
 |  |  |       xaserverarg arg;			 | 
 |  |  |       arg.AddArg(L"no",L"Category:All"); | 
 |  |  |       arg.AddArg(L"QueryTxt",L""); | 
 |  |  |       OpenWindow(L"dev:xpage[PriceList.PurcharItemSelectEx.vx]",cast(arg as int)); | 
 |  |  |       OpenWindow(L"dev:xpage[PriceList.PurcharItemSelectEx.vx]",arg); | 
 |  |  |       if(arg.GetArgString(L"process") == L"ok") | 
 |  |  |       { | 
 |  |  |          xml x = new xml; | 
 |  |  |          x.setNativePointer(xml::CreateInstance()); | 
 |  |  |          x.LoadXml(arg.GetArgString(L"result")); | 
 |  |  |          xml x; | 
 |  |  |          x.loadXML(arg.GetArgString(L"result")); | 
 |  |  |          KXMLDOMNodeList nodes = x.selectNodes(L"data/Item"); | 
 |  |  |          int len = nodes.length(); | 
 |  |  |          for(int i=0; i<len;i++) | 
 |  |  | 
 |  |  |             //items.Release(); | 
 |  |  |             ele.Release(); | 
 |  |  |          } | 
 |  |  |          x.Free(); | 
 |  |  |          nodes.Release(); | 
 |  |  |       } | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |     | 
 |  |  |    int OnTech(xdwgrid dw_term) | 
 |  |  |    { | 
 |  |  |       xaserverarg arg = new xaserverarg; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance());	 | 
 |  |  |       xaserverarg arg=GetArg();	 | 
 |  |  |       int row = dw_term.GetRow(); | 
 |  |  |       if(row < 1) return 0; | 
 |  |  |       xstring str = dw_term.GetItemString(row,L"TechNote"); | 
 |  |  |       arg.AddArg(L"value",str); | 
 |  |  |       OpenWindow(L"dev:xpage[memo.edit.new.vx]",arg.getNativePointer()); | 
 |  |  |       OpenWindow(L"dev:xpage[memo.edit.new.vx]",arg); | 
 |  |  |  | 
 |  |  |       if(arg.GetArgString(L"comdid")==L"xmOK") | 
 |  |  |       { | 
 |  |  |          str = arg.GetArgString(L"value"); | 
 |  |  | 
 |  |  |     | 
 |  |  |    int OnCopy() | 
 |  |  |    { | 
 |  |  |       xaserverarg arg = new xaserverarg; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance());	 | 
 |  |  |       xaserverarg arg ;	 | 
 |  |  |       int row = dw_pricelistex.GetRow(); | 
 |  |  |        | 
 |  |  |       if(row < 1) return 0; | 
 |  |  | 
 |  |  |       arg.AddArg(L"PayTerm",PayTerm); | 
 |  |  |       arg.AddArg(L"CustomerContactName",CustomerContactName); | 
 |  |  |       arg.AddArg(L"ContactTel",ContactTel); | 
 |  |  |       int pa = arg.getNativePointer(); | 
 |  |  |       openUrl(L"/sale/view/Enquiry3/xpage/maint", pa); | 
 |  |  |       openUrl(L"/sale/view/Enquiry3/xpage/maint", &arg); | 
 |  |  |       return 1; | 
 |  |  |    }    | 
 |  |  |     | 
 |  |  |    int OnGroupCopy() | 
 |  |  |    { | 
 |  |  |       xaserverarg arg = new xaserverarg; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance());	 | 
 |  |  |       xaserverarg arg ;	 | 
 |  |  |       int row = dw_priceitem.GetRow(); | 
 |  |  |       int row1 = dw_pricelist.GetRow(); | 
 |  |  |       if(row < 1) return 0; | 
 |  |  | 
 |  |  |       arg.AddArg(L"ContactTel",ContactTel); | 
 |  |  |     | 
 |  |  |        | 
 |  |  |       int pa = arg.getNativePointer(); | 
 |  |  |       openUrl(L"/sale/view/Enquiry3/xpage/maint", pa); | 
 |  |  |       openUrl(L"/sale/view/Enquiry3/xpage/maint", &arg); | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |     | 
 |  |  | 
 |  |  |       if(comdid==L"tab_pricebill") | 
 |  |  |       { | 
 |  |  |          sheetname=L"tab_pricebill"; | 
 |  |  |          SetAgent(L"list"); | 
 |  |  |          xframe::SetAgent(L"list"); | 
 |  |  |        | 
 |  |  |          SwitchLayer(L"tv_folder_pricebill",L"folder_frame"); | 
 |  |  |          if(dw_pricelistex.GetRowCount() < 1) OnProductPriceBillRetrieve(); | 
 |  |  | 
 |  |  |       else   if(comdid==L"tab_pricebillex") | 
 |  |  |       { | 
 |  |  |          sheetname=L"tab_pricebillex"; | 
 |  |  |          SetAgent(L"list"); | 
 |  |  |          xframe::SetAgent(L"list"); | 
 |  |  |          SwitchLayer(L"tv_folder_pricebill",L"folder_frame"); | 
 |  |  |          if(dw_pricelist.GetRowCount() < 1) OnPriceBillRetrieve(); | 
 |  |  |          return 0; | 
 |  |  | 
 |  |  |       { | 
 |  |  |          dw_list = GetControl(L"dw_list2"); | 
 |  |  |          sheetname = L"tab_list2"; | 
 |  |  |          SetAgent(L"list"); | 
 |  |  |          xframe::SetAgent(L"list"); | 
 |  |  |       } | 
 |  |  |        | 
 |  |  |       else if(comdid.left(4)==L"tab_") | 
 |  |  | 
 |  |  |          else | 
 |  |  |             SwitchLayer(L"tv_folder",L"folder_frame"); | 
 |  |  |          sheetname=comdid; | 
 |  |  |          SetAgent(L"list"); | 
 |  |  |          xframe::SetAgent(L"list"); | 
 |  |  |          return 0; | 
 |  |  |       } | 
 |  |  |        | 
 |  |  | 
 |  |  |             xml supplier_x = ViewObject::RetrieveData(L"/sale/data/SupplierV3/entity/FindBySaleType",L"id", s); | 
 |  |  |             if(supplier_x) | 
 |  |  |             { | 
 |  |  |                if(supplier_x.text == L"采购经理") | 
 |  |  |                if((xstring)supplier_x.text() == L"采购经理") | 
 |  |  |                   { | 
 |  |  |                   alert(L"当前角色不是采购员不能新增单子,请重新选择角色"); | 
 |  |  |                   alert(L"当前角色不是采购员不能新增单子,请重新选择角色"); | 
 |  |  |                   return 0; | 
 |  |  |                } | 
 |  |  |             } | 
 |  |  | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |     | 
 |  |  |    //xcombobox下拉 | 
 |  |  |    int OnSelectDdlb(ref TNotifyEvent evt,int p) | 
 |  |  |    //xcombobox下拉 | 
 |  |  |    int OnSelectDdlb(TEvent* evt,int p) | 
 |  |  |    { | 
 |  |  |       changeddlb=1; | 
 |  |  |       int wid = ddlb_1.GetId(); | 
 |  |  |       HWND wid = ddlb_1.GetHWND(); | 
 |  |  |       int CB_GETCURSEL  = 0x0147; | 
 |  |  |       int nIndex = win32::SendMessage(wid,CB_GETCURSEL,0,0); | 
 |  |  |       int nIndex = SendMessage(wid,CB_GETCURSEL,0,0); | 
 |  |  |       KXMLDOMElement e = ddlb_1.GetElement(); | 
 |  |  |       KXMLDOMElement e2 = e.selectSingleNode(L"item["+(nIndex+1).toString()+L"]"); | 
 |  |  |       KXMLDOMElement e2 = e.selectSingleNode(L"item["+xstring(nIndex+1)+L"]"); | 
 |  |  |       xstring no=e2.selectSingleNode(L"@element").text(); | 
 |  |  |        | 
 |  |  |       int hItem = tv_folder.GetRootItem(); | 
 |  |  |       HTREEITEM hItem = tv_folder.GetRootItem(); | 
 |  |  |       while(tv_folder.GetChildItem(hItem)) | 
 |  |  |          tv_folder.DeleteItem(tv_folder.GetChildItem(hItem)); | 
 |  |  |       ExpandFolderItem(tv_folder,hItem, no); | 
 |  |  | 
 |  |  |    } | 
 |  |  |     | 
 |  |  |        | 
 |  |  |    int OnCkbCLick(ref TEvent evt,int p) | 
 |  |  |    int OnCkbCLick(TEvent* evt,int p) | 
 |  |  |    {    | 
 |  |  |       xcheckbox cbx_1 = GetControl(L"cbx1");          | 
 |  |  |       int state=cbx_1.GetCheck(cbx_1.GetId()); | 
 |  |  |       if(evt.lParam == GetControl(L"cbx1").GetId()) | 
 |  |  |       int state=cbx_1.GetCheck(cbx_1.GetHWND()); | 
 |  |  |       if(evt->lParam == (LPARAM)GetControl(L"cbx1")->GetHWND()) | 
 |  |  |       { | 
 |  |  |          if (state== -1) | 
 |  |  |             SwitchLayer(L"sheet1",L"frame"); | 
 |  |  |          else | 
 |  |  |             SwitchLayer(L"sheet2",L"frame"); | 
 |  |  |          return 1; | 
 |  |  |       }else if(evt.lParam == GetControl(L"cbx2").GetId()) | 
 |  |  |       }else if(evt->lParam == (LPARAM)GetControl(L"cbx2")->GetHWND()) | 
 |  |  |       { | 
 |  |  |          cbx_1 = GetControl(L"cbx2");          | 
 |  |  |          state=cbx_1.GetCheck(cbx_1.GetId()); | 
 |  |  |          int    hCursor = xutil::SetCursorWait(); | 
 |  |  |          state=cbx_1.GetCheck(cbx_1.GetHWND()); | 
 |  |  |          HCURSOR   hCursor = xutil::SetCursorWait(); | 
 |  |  |          xstring ItemID = dw_list1.GetItemString(dw_list1.GetRow(),L"ItemID"); | 
 |  |  |           | 
 |  |  |          xml x = ViewObject::RetrieveData(L"/sale/data/Enquiry/folder/listitemsex",L"itemID",ItemID,L"type",state.toString()); | 
 |  |  |          xml x = ViewObject::RetrieveData(L"/sale/data/Enquiry/folder/listitemsex",L"itemID",ItemID,L"type",xstring(state)); | 
 |  |  |          if(x) | 
 |  |  |             dw_goods1.Retrieve(x); | 
 |  |  |          else | 
 |  |  | 
 |  |  |       } | 
 |  |  |    } | 
 |  |  |  | 
 |  |  |    int OnPriceListRowChanged(ref TNotifyEvent evt,int p) | 
 |  |  |    int OnPriceListRowChanged(TEvent* evt,LPARAM p) | 
 |  |  |    { | 
 |  |  |       ref DWNMHDR  hdr = trust(evt.pnmh as ref DWNMHDR); | 
 |  |  |       DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; | 
 |  |  |       int row = hdr.row; | 
 |  |  |        | 
 |  |  |       int    hCursor = xutil::SetCursorWait(); | 
 |  |  |       HCURSOR    hCursor = xutil::SetCursorWait(); | 
 |  |  |       OnRetrieveItem(dw_pricelist.GetGuid(row)); | 
 |  |  |        | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |        | 
 |  |  |    int OnItemAskStyle(ref TNotifyEvent evt,int p) | 
 |  |  |    int OnItemAskStyle(TEvent* evt,LPARAM p) | 
 |  |  |    { | 
 |  |  |       int DMS_CSSSTYLE = 0x8; | 
 |  |  |       ref DWASKSTYLENMHDR hdr = trust(evt.pnmh as ref DWASKSTYLENMHDR); | 
 |  |  |       DWASKSTYLENMHDR& hdr = *(DWASKSTYLENMHDR*)evt->notify.pnmh; | 
 |  |  |       int row = hdr.row; | 
 |  |  |       int col = hdr.col; | 
 |  |  |       xstring colname = hdr.colname; | 
 |  |  | 
 |  |  |          if(days < 0) | 
 |  |  |          { | 
 |  |  |             hdr.mask =  DMS_CSSSTYLE; | 
 |  |  |             hdr.cssstyle = L"color:#cccccc"; | 
 |  |  |             hdr.pCssStyle = (LPTSTR)L"color:#cccccc"; | 
 |  |  |          } | 
 |  |  |       } | 
 |  |  |       return 1; | 
 |  |  |    }    | 
 |  |  |    int OnFilter() | 
 |  |  |    { | 
 |  |  |       xstring str = GetControl(L"sl_search").GetText(); | 
 |  |  |       xstring str = xcontrol(GetControl(L"sl_search")).GetText(); | 
 |  |  |       xdwgrid dw_obj; | 
 |  |  |       if(sheetname==L"tab_goods") dw_obj = dw_list1; | 
 |  |  |       else if(sheetname==L"tab_pricebill") dw_obj = dw_pricelistex; | 
 |  |  | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |     | 
 |  |  |    int OnPriceListDoubleClicked(ref TNotifyEvent evt,int p) | 
 |  |  |    int OnPriceListDoubleClicked(TEvent* evt, LPARAM pr) | 
 |  |  |    { | 
 |  |  |       int hCursor = xutil::SetCursorWait(); | 
 |  |  |       HCURSOR hCursor = xutil::SetCursorWait(); | 
 |  |  |       int row = dw_pricelistex.GetRow(); | 
 |  |  |       if(row > 0) OnTech(dw_pricelistex); | 
 |  |  |       xutil::RestoreCursor(hCursor); | 
 |  |  |       return 1;       | 
 |  |  |    } | 
 |  |  |     | 
 |  |  |    int OnDoubleClicked(ref TNotifyEvent evt,int p) | 
 |  |  |    int OnDoubleClicked(TEvent* evt, LPARAM) | 
 |  |  |    { | 
 |  |  |       int hCursor = xutil::SetCursorWait(); | 
 |  |  |       HCURSOR hCursor = xutil::SetCursorWait(); | 
 |  |  |       int row = dw_list2.GetRow(); | 
 |  |  |       xaserverarg arg=new xaserverarg; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance()); | 
 |  |  |       xaserverarg arg; | 
 |  |  |        | 
 |  |  |       xstring EnquiryNo  = dw_list2.GetItemString(row,L"EnquiryNo"); | 
 |  |  |       arg.AddArg(L"EnquiryNo",EnquiryNo); | 
 |  |  |        | 
 |  |  |       int pa = arg.getNativePointer(); | 
 |  |  |       openUrl(L"/sale/view/Enquiry3/xpage/maint", pa); | 
 |  |  |       openUrl(L"/sale/view/Enquiry3/xpage/maint",&arg); | 
 |  |  |       xutil::RestoreCursor(hCursor); | 
 |  |  |       return 1;       | 
 |  |  |    } | 
 |  |  |    int OnDoubleClicked(ref TNotifyEvent evt,int p) | 
 |  |  |  | 
 |  |  |    int AttachListon() | 
 |  |  |    { | 
 |  |  |       int hCursor = xutil::SetCursorWait(); | 
 |  |  |       OnCmdDispatch(L"action:bill.open"); | 
 |  |  |       xutil::RestoreCursor(hCursor); | 
 |  |  |       return 1;		 | 
 |  |  |    } | 
 |  |  |    int AttachEvent() | 
 |  |  |    { | 
 |  |  |       AttachEvent(L"tv_folder", L"TVN_SELCHANGED",OnTreeSelChanged); //树选择 | 
 |  |  |       AttachEvent(L"tv_folder", L"TVN_ITEMEXPANDING",OnTreeExpanding); //树展开 | 
 |  |  |       AttachEvent(L"dw_list",L"DWV_ROWFOCUSCHANGED",OnRowChanged); | 
 |  |  |       AttachEvent(L"dw_list2",L"DWV_ROWFOCUSCHANGED",OnRowChanged2); | 
 |  |  |       AttachEvent(L"dw_list1",L"DWV_ROWFOCUSCHANGED",OnRowChanged1); | 
 |  |  |       AttachEvent(L"cbx_1",L"CBN_SELCHANGE",OnSelectDdlb); | 
 |  |  |       AttachEvent(L"WM_COMMAND",OnCkbCLick); | 
 |  |  |       AttachEvent(L"dw_list",L"DWV_ASKSTYLE",OnItemAskStyle); | 
 |  |  |       AttachEvent(L"dw_pricelist",L"DWV_ROWFOCUSCHANGED",OnPriceListRowChanged); | 
 |  |  |       AttachEvent(L"tv_folder_pricebill", L"TVN_SELCHANGED",OnPriceBillTreeSelChanged); //树选择 | 
 |  |  |       AttachEvent(L"tv_folder_pricebill", L"TVN_ITEMEXPANDING",OnPriceBillTreeExpanding); | 
 |  |  |       AttachEvent(L"tv_folder", L"TVN_SELCHANGED",(FEvent)&Enquiry3list::OnTreeSelChanged); //树选择 | 
 |  |  |       AttachEvent(L"tv_folder", L"TVN_ITEMEXPANDING", (FEvent)&Enquiry3list::OnTreeExpanding); //树展开 | 
 |  |  |       AttachEvent(L"dw_list",L"DWV_ROWFOCUSCHANGED", (FEvent)&Enquiry3list::OnRowChanged); | 
 |  |  |       AttachEvent(L"dw_list2",L"DWV_ROWFOCUSCHANGED", (FEvent)&Enquiry3list::OnRowChanged2); | 
 |  |  |       AttachEvent(L"dw_list1",L"DWV_ROWFOCUSCHANGED", (FEvent)&Enquiry3list::OnRowChanged1); | 
 |  |  |       AttachEvent(L"cbx_1",L"CBN_SELCHANGE", (FEvent)&Enquiry3list::OnSelectDdlb); | 
 |  |  |       AttachEvent(L"WM_COMMAND", (FEvent)&Enquiry3list::OnCkbCLick); | 
 |  |  |       AttachEvent(L"dw_list",L"DWV_ASKSTYLE", (FEvent)&Enquiry3list::OnItemAskStyle); | 
 |  |  |       AttachEvent(L"dw_pricelist",L"DWV_ROWFOCUSCHANGED", (FEvent)&Enquiry3list::OnPriceListRowChanged); | 
 |  |  |       AttachEvent(L"tv_folder_pricebill", L"TVN_SELCHANGED", (FEvent)&Enquiry3list::OnPriceBillTreeSelChanged); //树选择 | 
 |  |  |       AttachEvent(L"tv_folder_pricebill", L"TVN_ITEMEXPANDING", (FEvent)&Enquiry3list::OnPriceBillTreeExpanding); | 
 |  |  |        | 
 |  |  |       AttachEvent(L"dw_pricelistex",L"DWV_DOUBLECLICKED",OnPriceListDoubleClicked); | 
 |  |  |       AttachEvent(L"dw_list2",L"DWV_DOUBLECLICKED",OnDoubleClicked); | 
 |  |  |       AttachEvent(L"dw_pricelistex",L"DWV_DOUBLECLICKED", (FEvent)&Enquiry3list::OnPriceListDoubleClicked); | 
 |  |  |       AttachEvent(L"dw_list2",L"DWV_DOUBLECLICKED", (FEvent)&Enquiry3list::OnDoubleClicked); | 
 |  |  |        | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  | 
 |  |  |     | 
 |  |  |    int OnRetrieveItem(xstring EnquiryPriceListID) | 
 |  |  |    { | 
 |  |  |       xml x = new xml; | 
 |  |  |       x.setNativePointer(xml::CreateInstance()); | 
 |  |  |       xaserverarg arg = new xaserverarg; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance());	 | 
 |  |  |       xml x; | 
 |  |  |       xaserverarg arg ;	 | 
 |  |  |       arg.AddArg(L"EnquiryPriceListID",EnquiryPriceListID); | 
 |  |  |       if (getUrl(L"/sale/data/Enquiry/fetch/PriceList/item",arg.GetString(),x)!=1) | 
 |  |  |       { | 
 |  |  | 
 |  |  |     | 
 |  |  |    int  OnPriceBillRetrieve() | 
 |  |  |    { | 
 |  |  |       int hItem = tv_folder_pricebill.GetSelectedItem(); | 
 |  |  |       KXMLDOMElement e1 = cast(tv_folder_pricebill.GetItemData(hItem) as KXMLDOMElement); | 
 |  |  |       HTREEITEM hItem = tv_folder_pricebill.GetSelectedItem(); | 
 |  |  |       KXMLDOMElement e1 = tv_folder_pricebill.GetItemData(hItem); | 
 |  |  |       xstring no = e1.getAttribute(L"no"); | 
 |  |  |  | 
 |  |  |       xml x = new xml; | 
 |  |  |       x.setNativePointer(xml::CreateInstance()); | 
 |  |  |       xaserverarg arg = new xaserverarg; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance());	 | 
 |  |  |       xml x; | 
 |  |  |       xaserverarg arg;	 | 
 |  |  |       arg.AddArg(L"no",no); | 
 |  |  |       if (getUrl(L"/sale/data/Enquiry/fetch/PriceList",arg.GetString(),x)!=1) | 
 |  |  |       { | 
 |  |  | 
 |  |  |        | 
 |  |  |    int  OnProductPriceBillRetrieve() | 
 |  |  |    { | 
 |  |  |       int hItem = tv_folder_pricebill.GetSelectedItem(); | 
 |  |  |       KXMLDOMElement e1 = cast(tv_folder_pricebill.GetItemData(hItem) as KXMLDOMElement); | 
 |  |  |       HTREEITEM hItem = tv_folder_pricebill.GetSelectedItem(); | 
 |  |  |       KXMLDOMElement e1 = tv_folder_pricebill.GetItemData(hItem); | 
 |  |  |       xstring no = e1.getAttribute(L"no"); | 
 |  |  |  | 
 |  |  |       xml x = new xml; | 
 |  |  |       x.setNativePointer(xml::CreateInstance()); | 
 |  |  |       xaserverarg arg = new xaserverarg; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance());	 | 
 |  |  |       xml x; | 
 |  |  |       xaserverarg arg ;	 | 
 |  |  |       arg.AddArg(L"no",no); | 
 |  |  |       if (getUrl(L"/sale/data/Enquiry/ProductPriceList/nobom",arg.GetString(),x)!=1) | 
 |  |  |       { | 
 |  |  | 
 |  |  |     | 
 |  |  |    int  OnProductPriceShareRetrieve() | 
 |  |  |    { | 
 |  |  |       xml x = new xml; | 
 |  |  |       x.setNativePointer(xml::CreateInstance()); | 
 |  |  |       xaserverarg arg = new xaserverarg; | 
 |  |  |       arg.setNativePointer(arg.CreateInstance());	 | 
 |  |  |       xml x; | 
 |  |  |       xaserverarg arg ;	 | 
 |  |  |       if (getUrl(L"/sale/data/Enquiry/ProductPriceList/share",arg.GetString(),x)!=1) | 
 |  |  |       { | 
 |  |  |          trace(x.text()); | 
 |  |  | 
 |  |  |    } | 
 |  |  |    int onload() | 
 |  |  |    { | 
 |  |  |       SetArg(); | 
 |  |  |       state1=-1; | 
 |  |  |       state2=-1; | 
 |  |  |        | 
 |  |  | 
 |  |  |        | 
 |  |  |       tv_folder_pricebill = GetControl(L"tv_folder_pricebill"); | 
 |  |  |       InitialFolderPriceBill(); | 
 |  |  | 		 | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |        | 
 |  |  |    int onloaded() | 
 |  |  |    {    | 
 |  |  |       listwin::onloaded(); | 
 |  |  |        | 
 |  |  |       AttachEvent(); | 
 |  |  |       AttachListon(); | 
 |  |  |        | 
 |  |  |       dw_list.SetColumnState(L"EnquiryID",false); | 
 |  |  |       dw_list.SetColumnState(L"Days",false); | 
 |  |  | 
 |  |  |       OnProductPriceShareRetrieve(); | 
 |  |  |  | 
 |  |  |        | 
 |  |  |       int hItem = tv_folder.GetRootItem(); | 
 |  |  |       HTREEITEM hItem = tv_folder.GetRootItem(); | 
 |  |  |       tv_folder.ExpandItem(hItem); | 
 |  |  |       tv_folder.ItemFocus(hItem); | 
 |  |  |        | 
 |  |  | 
 |  |  |     | 
 |  |  |    int ProcessUsedArg(xaserverarg arg) | 
 |  |  |    { | 
 |  |  |       int hItem = tv_folder.GetCaretItem(); | 
 |  |  |       HTREEITEM hItem = tv_folder.GetCaretItem(); | 
 |  |  |       arg.AddArg(L"sheetname",sheetname); | 
 |  |  |       if(hItem > 0) | 
 |  |  |       if(!hItem) | 
 |  |  |       { | 
 |  |  |          KXMLDOMElement e = tv_folder.GetItemData(hItem); | 
 |  |  |           | 
 |  |  | 
 |  |  |             { | 
 |  |  |                arg.AddArg(L"CustomerID",e.getAttribute(L"id")); | 
 |  |  |                xstring name = e.getAttribute(L"name"); | 
 |  |  |                if(name.find(L"(L")>=0) name = name.left(name.find(L"(L")); | 
 |  |  |                if(name.find(L"(")>=0) name = name.left(name.find(L"(")); | 
 |  |  |                arg.AddArg(L"CustomerName",name); | 
 |  |  |             } | 
 |  |  |          } |