|  |  | 
 |  |  | public: | 
 |  |  |    static SO3list* CreateInstance(void* implPtr, void* hWnd) | 
 |  |  |    { | 
 |  |  | 		 | 
 |  |  |       SO3list* pWin = new SO3list(implPtr, (HWND)hWnd); | 
 |  |  |       return pWin; | 
 |  |  |    } | 
 |  |  | 
 |  |  |       { | 
 |  |  |          KXMLDOMElement e = nlist.item(i); | 
 |  |  |          string name = e.getAttribute(L"name"); | 
 |  |  |          HTREEITEM h = tv_folder.InsertChildItem(hItem, name, e.ptr(), image); | 
 |  |  |          HTREEITEM h = tv_folder.InsertChildItem(hItem, name, e, image); | 
 |  |  |          ExpandCatChildFolder(h, e, 35); | 
 |  |  |       } | 
 |  |  |       return 1; | 
 |  |  | 
 |  |  |       { | 
 |  |  |          KXMLDOMElement e = nlist.item(i); | 
 |  |  |          string name = e.getAttribute(L"name"); | 
 |  |  |          HTREEITEM h = tv_folder.InsertChildItem(hItem, name, e.ptr(), 35); | 
 |  |  |          HTREEITEM h = tv_folder.InsertChildItem(hItem, name, e, 35); | 
 |  |  |          ExpandCatChildFolder(h, e, 35); | 
 |  |  |       } | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |  | 
 |  |  |    //树展开 | 
 |  |  |    int OnTreeExpanding(TEvent* evt, int p) | 
 |  |  |    int OnTreeExpanding(TEvent* evt, LPARAM p) | 
 |  |  |    { | 
 |  |  |       NMTREEVIEW& nmtv = *(NMTREEVIEW*)evt->notify.pnmh; | 
 |  |  |       HTREEITEM hItem = nmtv.itemNew.hItem; | 
 |  |  | 
 |  |  |          xstring child = e.getAttribute(L"child"); | 
 |  |  |          int image = 15; | 
 |  |  |          if (sImage) image = sImage.toInt(); | 
 |  |  |          HTREEITEM h = tv_folder.InsertChildItem(hItem, name, e.ptr(), image); | 
 |  |  |          HTREEITEM h = tv_folder.InsertChildItem(hItem, name, e, image); | 
 |  |  |          if (child != L"no") tv_folder.SetItemChild(h, 1); | 
 |  |  |          //ExpandChildFolder(h, e); | 
 |  |  |       } | 
 |  |  | 
 |  |  |          int row = dw_list.GetRow(); | 
 |  |  |          if (row < 1) return 1; | 
 |  |  |          KXMLDOMElement ele = dw_list.GetRowElement(row); | 
 |  |  |          string id = GetEntityIDName(1); | 
 |  |  |          string entity = ele.selectSingleNode(id).text(); | 
 |  |  |          xstring id = GetEntityIDName(1); | 
 |  |  |          xstring entity = ele.selectSingleNode(id).text(); | 
 |  |  |          //trace(entity); | 
 |  |  |          SetAgent(L"list", entity); | 
 |  |  |          if (arg.GetArgString(L"state") != L"") | 
 |  |  | 
 |  |  |             dw_list.SetItemString(row, L"ApplyStatus", arg.GetArgString(L"state")); | 
 |  |  |          if (arg.GetArgString(L"billstatus") != L"") | 
 |  |  |          { | 
 |  |  |             string billstatus = arg.GetArgString(L"billstatus"); | 
 |  |  |             string statusName = GetBillStatusName(billstatus); | 
 |  |  |             xstring billstatus = arg.GetArgString(L"billstatus"); | 
 |  |  |             xstring statusName = GetBillStatusName(billstatus); | 
 |  |  |             dw_list.SetItemString(row, L"ApprovalStatus", billstatus); | 
 |  |  |             dw_list.SetItemDisplayString(row, L"ApprovalStatus", statusName); | 
 |  |  |          } | 
 |  |  | 
 |  |  |       return 1; | 
 |  |  |    } | 
 |  |  |  | 
 |  |  |    int PreOnCmdDispatch(string comdid) | 
 |  |  |    int PreOnCmdDispatch(xstring comdid) | 
 |  |  |    { | 
 |  |  |       if (comdid == L"action:bill.new") | 
 |  |  |       { | 
 |  |  |          string s = publiccode::GetUser().id; | 
 |  |  |          string no = publiccode::GetUser().no; | 
 |  |  |          xstring s = publiccode::GetUser().id; | 
 |  |  |          xstring no = publiccode::GetUser().no; | 
 |  |  |          if (no != L"00303" && no != L"admin") | 
 |  |  |          { | 
 |  |  |             KXMLDOMDocument supplier_x = ViewObject::RetrieveData(GetServerUrl(),L"/sale/data/SupplierV3/entity/FindBySaleType", L"id", s); | 
 |  |  | 
 |  |  |       } | 
 |  |  |       if (comdid == L"action:bill.annex") | 
 |  |  |       { | 
 |  |  |          string deptname = publiccode::GetUser().deptname; | 
 |  |  |          xstring deptname = publiccode::GetUser().deptname; | 
 |  |  |          if (deptname == L"采购部") | 
 |  |  |          { | 
 |  |  |             return 1; | 
 |  |  | 
 |  |  |       { | 
 |  |  |          Content = t.selectSingleNode(L"Content").text(); | 
 |  |  |       } | 
 |  |  |       xaserverarg& arg = *new xaserverarg; | 
 |  |  |       xaserverarg arg; | 
 |  |  |       arg.AddArg(L"value", Content); | 
 |  |  |       OpenWindow(L"dev:xpage[memo.edit.new.vx]", arg); | 
 |  |  |  | 
 |  |  | 
 |  |  |    { | 
 |  |  |       AttachEvent(L"tv_folder", L"TVN_SELCHANGED", (FEvent)&SO3list::OnTreeSelChanged); //树选择 | 
 |  |  |       AttachEvent(L"dw_list", L"DWV_ROWFOCUSCHANGED", (FEvent)&SO3list::OnRowChanged);//绑定行更改触发事件OnRowChanged | 
 |  |  |       AttachEvent(L"dw_list", L"DWV_DOUBLECLICKED", (FEvent)&listwin::OnDoubleClicked); | 
 |  |  |       //AttachEvent(L"dw_list", L"DWV_DOUBLECLICKED", (FEvent)&listwin::OnDoubleClicked); | 
 |  |  |       AttachEvent(L"cbx_1", L"CBN_SELCHANGE", (FEvent)&SO3list::OnSelectDdlb);//绑定下拉框更改触发事件OnSelectDdlb | 
 |  |  |       AttachEvent(L"cbx_datashow", L"CBN_SELCHANGE", (FEvent)&SO3list::OnSelectDataShowDdlb);//绑定选择数据显示下拉列表事件OnSelectDataShowDdlb | 
 |  |  |       return 1; | 
 |  |  | 
 |  |  |       dw_list.SetColumnState(L"SOID", false); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |       string groupname = publiccode::GetUser().groupname; | 
 |  |  |       xstring groupname = publiccode::GetUser().groupname; | 
 |  |  |       if (groupname == L"采购小组") | 
 |  |  |       { | 
 |  |  |          dw_list.SetColumnState(L"USDAmount", false); | 
 |  |  | 
 |  |  |       { | 
 |  |  |          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); | 
 |  |  |       } | 
 |  |  |       return 1; |