| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #include <wobject/xstring.hpp> |
| | | #include <xcontrol/xtreeview.hpp> |
| | | #include <xcontrol/xdwgrid.hpp> |
| | | #include <xcontrol/xcell.hpp> |
| | | |
| | | |
| | | #include "vbusiness/vframe/listwin.vframe.vbusiness.hpp" |
| | | #include "viewobject/view.base.hpp" |
| | | |
| | | using xml = KXMLDOMDocument; |
| | | |
| | | class __declspec(dllexport) Business5Win : public xframe |
| | | { |
| | | public: |
| | | xdwgrid dw_list; |
| | | xdwgrid dw_processed; |
| | | xdwgrid dw_message; |
| | | xdwgrid dw_outbox; |
| | | xdwgrid dw_Recovery; |
| | | xnode m_agentNode; //Agent Condition |
| | | xtreeview tv_folder; |
| | | |
| | | int hMessage; |
| | | int hTask; |
| | | |
| | | xstring agentFor; |
| | | xstring selectname; |
| | | xwin sheet; |
| | | |
| | | public: |
| | | Business5Win(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {} |
| | | public: |
| | | static Business5Win* CreateInstance(void* implPtr, void* hWnd) |
| | | { |
| | | Business5Win* pWin = new Business5Win(implPtr, (HWND)hWnd); |
| | | return pWin; |
| | | } |
| | | |
| | | int SetAgent() |
| | | { |
| | | xstring xfNodeAgentArea = L"agentarea"; |
| | | xnode anode = GetAgentNode(xfNodeAgentArea); |
| | | if(m_agentNode) |
| | | { |
| | | SetAgentNode (anode,m_agentNode); |
| | | } |
| | | else |
| | | { |
| | | KXMLDOMElement xframeElement = GetElement(); |
| | | KXMLDOMElement agent = xframeElement.selectSingleNode(L"agent/"+xfNodeAgentArea+L"[@for='"+agentFor+L"']/*"); |
| | | if(agent) |
| | | { |
| | | xstring s = agent.xml(); |
| | | m_agentNode = SetAgentNode (anode,s); |
| | | //FillGoodsCarList(); |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | //ç¦ç¹æ¿æ´»å¤ç彿° |
| | | int OnSetFocus(TEvent* evt, LPARAM param) |
| | | { |
| | | //é置工å
·æ¡ |
| | | SetAgent(); |
| | | return 1; |
| | | } |
| | | int RetrieveData() |
| | | { |
| | | xml x; |
| | | if(selectname == L"å·²å¤çä»»å¡") |
| | | { |
| | | x = ViewObject::RetrieveData(L"/sale/data/business/list/processedtask"); |
| | | dw_processed.Retrieve(x); |
| | | dw_processed.Redraw(); |
| | | dw_processed.SetReadOnly(true); |
| | | }else if(selectname == L"æ¶ä»¶ç®±") |
| | | { |
| | | xstring UserNO= publiccode::GetUser().no; |
| | | |
| | | x = ViewObject::RetrieveData(L"/sale/data/business/list/inbox"); |
| | | |
| | | dw_message.Retrieve(x); |
| | | dw_message.Redraw(); |
| | | dw_message.SetReadOnly(true); |
| | | } |
| | | else if(selectname == L"åä»¶ç®±") |
| | | { |
| | | x = ViewObject::RetrieveData(L"/sale/data/business/list/outbox"); |
| | | dw_outbox.Retrieve(x); |
| | | dw_outbox.Redraw(); |
| | | dw_outbox.SetReadOnly(true); |
| | | } |
| | | else if(selectname == L"åæ¶ç®±") |
| | | { |
| | | x = ViewObject::RetrieveData(L"/sale/data/business/list/Recovery"); |
| | | dw_Recovery.Retrieve(x); |
| | | dw_Recovery.Redraw(); |
| | | dw_Recovery.SetReadOnly(true); |
| | | } |
| | | AdjustTip(); |
| | | return 1; |
| | | } |
| | | int OnDelete() |
| | | { |
| | | int MB_OKCANCEL = 1; |
| | | int IDOK = 1; |
| | | int ret =MessageBox(GetHWND(),L"确认å 餿¶æ¯?",L"æç¤º",MB_OKCANCEL); |
| | | if(ret == IDOK) |
| | | { |
| | | KXMLDOMElement ele = dw_message.GetRowElement(dw_message.GetRow()); |
| | | xstring TaskID = ele.getAttribute(L"guid"); |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/business/message/delete",L"TaskID",TaskID); |
| | | xstring status = x.xml(); |
| | | if(status.find(L"ok") == 1) |
| | | { |
| | | alert(L"å 餿å"); |
| | | RetrieveData(); |
| | | }else |
| | | { |
| | | alert(L"å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int OnUpdateRecovery() |
| | | { |
| | | int MB_OKCANCEL = 1; |
| | | int IDOK = 1; |
| | | int ret =MessageBox(GetHWND(),L"确认æ¢å¤æ¶æ¯?",L"æç¤º",MB_OKCANCEL); |
| | | if(ret == IDOK) |
| | | { |
| | | KXMLDOMElement ele = dw_Recovery.GetRowElement(dw_Recovery.GetRow()); |
| | | xstring TaskID = ele.getAttribute(L"guid"); |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/business/Recovery/UpdateRecovery",L"TaskID",TaskID); |
| | | xstring status = x.xml(); |
| | | if(status.find(L"ok") == 1) |
| | | { |
| | | alert(L"æ¢å¤æå"); |
| | | RetrieveData(); |
| | | }else |
| | | { |
| | | alert(L"æ¢å¤å¤±è´¥"); |
| | | } |
| | | |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int OnDeleteRecovery() |
| | | { |
| | | int MB_OKCANCEL = 1; |
| | | int IDOK = 1; |
| | | int ret =MessageBox(GetHWND(),L"确认彻åºå 餿¶æ¯?",L"æç¤º",MB_OKCANCEL); |
| | | if(ret == IDOK) |
| | | { |
| | | KXMLDOMElement ele = dw_Recovery.GetRowElement(dw_Recovery.GetRow()); |
| | | xstring TaskID = ele.getAttribute(L"guid"); |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/business/Recovery/DeleteRecovery",L"TaskID",TaskID); |
| | | xstring status = x.xml(); |
| | | if(status.find(L"ok") == 1) |
| | | { |
| | | alert(L"å 餿å"); |
| | | RetrieveData(); |
| | | }else |
| | | { |
| | | alert(L"å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int OnAdd() |
| | | { |
| | | OpenWindow(L"dev:xpage[message.business.vx]"); |
| | | if(selectname == L"åä»¶ç®±" || selectname == L"è稿箱") RetrieveData(); |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | //å½ä»¤åå¸å½æ° |
| | | int OnCmdDispatch(xstring comdid) |
| | | { |
| | | int ret = 0; |
| | | if(comdid.find(L"action:",0)>=0) |
| | | { |
| | | ret =SendMessage(GetHWND(),0x401,(LPARAM)comdid,0); |
| | | } |
| | | if(comdid==L"xmRefreshTask") |
| | | { |
| | | trace(L"\r\n----refresh task--------"); |
| | | SendMessage(GetHWND(),0x401,(LPARAM)comdid,0); |
| | | return 1; |
| | | } |
| | | if(comdid==L"xmRefresh") |
| | | { |
| | | trace(L"\r\n----refresh--------"); |
| | | ret =SendMessage(GetHWND(),0x401, (LPARAM)comdid,0); |
| | | } |
| | | if(comdid == L"xmRertieve") |
| | | { |
| | | RetrieveData(); |
| | | ret = 1; |
| | | } |
| | | if(comdid==L"xmAdd") |
| | | { |
| | | OnAdd(); |
| | | ret = 1; |
| | | } |
| | | if(comdid == L"xmDelete") |
| | | { |
| | | OnDelete(); |
| | | ret = 1; |
| | | } |
| | | if(comdid == L"UpdateRecovery") |
| | | { |
| | | OnUpdateRecovery(); |
| | | ret = 1; |
| | | } |
| | | if(comdid == L"DeleteRecovery") |
| | | { |
| | | OnDeleteRecovery(); |
| | | ret = 1; |
| | | } |
| | | if(comdid == L"xmImage") |
| | | { |
| | | int row = dw_message.GetRow(); |
| | | xstring PriceID = dw_message.GetItemString(row,L"EntityID"); |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/Enquiry/PriceList/GetSkunoByPriceID",L"PriceID",PriceID); |
| | | KXMLDOMNodeList items = x.selectNodes(L"data/Item"); |
| | | KXMLDOMNode t = items.item(0); |
| | | xstring skunos = t.selectSingleNode(L"skuno").text(); |
| | | xaserverarg arg_pic; |
| | | |
| | | arg_pic.AddArg(L"SKUNoList",skunos); |
| | | #if 0 |
| | | arg_pic.AddArg(L"ParentWindow", GetHWND()); |
| | | #endif // 0 |
| | | |
| | | |
| | | |
| | | arg_pic.AddArg(L"OpenFlag",L"1"); |
| | | OpenWindow(L"dev:xpage[SKU.PictureView.Product3.vx]",arg_pic ); |
| | | return 1; |
| | | } |
| | | else if(comdid == L"xmSearchOne") |
| | | { |
| | | OnSearchOne(); |
| | | return 1; |
| | | } |
| | | else if(comdid == L"xmSearchTwo") |
| | | { |
| | | OnSearchTwo(); |
| | | return 1; |
| | | } |
| | | else if(comdid==L"Lognew") |
| | | { |
| | | xstring EntityID = dw_processed.GetItemString(dw_processed.GetRow(),L"EntityID"); |
| | | //alert(EntityID); |
| | | |
| | | xaserverarg args; |
| | | |
| | | args.AddArg(L"EntityID",EntityID); |
| | | //OpenWindow(L"dev:xpage[workflow.actionlog.vx]",cast(args as int)); |
| | | OpenWindow(L"dev:xpage[workflow.actionlog_vd.vx]",args); |
| | | |
| | | |
| | | |
| | | } |
| | | return ret; |
| | | } |
| | | |
| | | |
| | | int OnSearchOne() |
| | | { |
| | | xstring searchStr=L""; |
| | | xaserverarg arg; |
| | | |
| | | arg.AddArg(L"text", searchStr); |
| | | OpenWindow(L"dev:xpage[search.dialog.vx]", arg); |
| | | xstring str = arg.GetArgString(L"text"); |
| | | if(str != searchStr) |
| | | { |
| | | searchStr = str; |
| | | dw_message.Filter(L"*",searchStr); |
| | | return 1; |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int OnSearchTwo() |
| | | { |
| | | xstring searchStr=L""; |
| | | xaserverarg arg; |
| | | |
| | | arg.AddArg(L"text", searchStr); |
| | | OpenWindow(L"dev:xpage[search.dialog.vx]", arg); |
| | | xstring str = arg.GetArgString(L"text"); |
| | | if(str != searchStr) |
| | | { |
| | | searchStr = str; |
| | | dw_Recovery.Filter(L"*",searchStr); |
| | | return 1; |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | //å½ä»¤å¤çäºä»¶ |
| | | int OnXCommand(TEvent* evt, LPARAM param) |
| | | { |
| | | return OnCmdDispatch(evt->xcommand.pStrID); |
| | | } |
| | | |
| | | |
| | | //æ¥æ¾å½åæ 项ç顶级ç®å½ |
| | | HTREEITEM LookupTopFolder(HTREEITEM hItem) |
| | | { |
| | | HTREEITEM hRoot = tv_folder.GetRootItem(); |
| | | while (tv_folder.GetParentItem(hItem)) hItem = tv_folder.GetParentItem(hItem); |
| | | return hItem; |
| | | } |
| | | |
| | | int ResetAgent(xstring agentAsk) |
| | | { |
| | | if(agentFor != agentAsk) |
| | | { |
| | | agentFor = agentAsk; |
| | | m_agentNode = 0; |
| | | SetAgent(); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int OnTreeSelChanged(TEvent* evt, LPARAM p) |
| | | { |
| | | NMTREEVIEW& nmtv = *(NMTREEVIEW*)evt->notify.pnmh; |
| | | HTREEITEM hItem = nmtv.itemNew.hItem; |
| | | HTREEITEM hTopItem = LookupTopFolder(hItem); |
| | | |
| | | xstring data = tv_folder.GetItemData(hItem); |
| | | trace(L"\r\n"+data); |
| | | //KXMLDOMElement e = cast(tv_folder.GetItemData(hItem) as KXMLDOMElement); |
| | | //if(e)trace(e.xml()); |
| | | |
| | | xstring name = tv_folder.GetItemLabel(hTopItem); |
| | | selectname = tv_folder.GetItemLabel(hItem); |
| | | if(selectname == L"å¾
å¤çä»»å¡") |
| | | { |
| | | SwitchLayer(L"sheet2",L"frame"); |
| | | sheet = GetChildWin(L"sheet2"); |
| | | ResetAgent(L"business1"); |
| | | }else if(selectname == L"å·²å¤çä»»å¡") |
| | | { |
| | | SwitchLayer(L"sheet3",L"frame"); |
| | | RetrieveData(); |
| | | ResetAgent(L"business2"); |
| | | }else if(selectname == L"æ¶ä»¶ç®±") |
| | | { |
| | | SwitchLayer(L"sheet4",L"frame"); |
| | | RetrieveData(); |
| | | ResetAgent(L"business3"); |
| | | }else if(selectname == L"åä»¶ç®±") |
| | | { |
| | | SwitchLayer(L"sheet5",L"frame"); |
| | | RetrieveData(); |
| | | ResetAgent(L"business2"); |
| | | } |
| | | else if(selectname == L"äºå¡") |
| | | { |
| | | SwitchLayer(L"sheet1",L"frame"); |
| | | }else if(selectname == L"åæ¶ç®±") |
| | | { |
| | | SwitchLayer(L"sheet6",L"frame"); |
| | | RetrieveData(); |
| | | ResetAgent(L"business5"); |
| | | } |
| | | return 1; |
| | | } |
| | | int OnRowChanged(TEvent* evt, int p) |
| | | { |
| | | //fixed one event only one process |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | int row = hdr.row; |
| | | KXMLDOMElement ele; |
| | | if(selectname == L"å·²å¤çä»»å¡") |
| | | ele = dw_processed.GetRowElement(row); |
| | | else if(selectname == L"æ¶ä»¶ç®±") |
| | | { |
| | | ele = dw_message.GetRowElement(row); |
| | | xstring Subject = dw_message.GetItemString(row,L"Subject"); |
| | | if(Subject.find(L"ä»·æ ¼å") == -1) |
| | | { |
| | | ResetAgent(L"business3"); |
| | | }else{ |
| | | ResetAgent(L"business4"); |
| | | } |
| | | } |
| | | else if(selectname == L"åæ¶ç®±") |
| | | { |
| | | ele = dw_Recovery.GetRowElement(row); |
| | | xstring SubjectOne = dw_Recovery.GetItemString(row,L"Subject"); |
| | | } |
| | | else if(selectname == L"åä»¶ç®±") |
| | | ele = dw_outbox.GetRowElement(row); |
| | | xaserverarg arg; |
| | | |
| | | trace(ele.xml()); |
| | | arg.AddArg(L"content",ele.xml()); |
| | | xml doc=new xml; |
| | | if(getUrl(L"/sale/data/vpage/vstart/task",arg.GetString(),doc)!=1) |
| | | { |
| | | trace((xstring)L"error->:"+doc.xml()); |
| | | return 0; |
| | | } |
| | | if(doc.xml() == L"") |
| | | return -1; |
| | | //trace(doc.xml()); |
| | | htmlctrl ht = GetControl(L"taskinfo"); |
| | | ht.SetContent(doc.xml()); |
| | | ht.Redraw(); |
| | | return 1; |
| | | } |
| | | int OnItemAskStyle(TEvent* evt, int p) |
| | | { |
| | | int DMS_CSSSTYLE = 0x8; |
| | | ref DWASKSTYLENMHDR hdr = trust(evt.pnmh as ref DWASKSTYLENMHDR); |
| | | int row = hdr.row; |
| | | int col = hdr.col; |
| | | xstring colname = hdr.colname; |
| | | int rows = dw_message.GetRowCount(); |
| | | if(row < 1 || row > rows) |
| | | { |
| | | return 1; |
| | | } |
| | | if(colname==L"flowName" || colname==L"Process" || colname==L"sender" || |
| | | colname==L"SendDate"||colname==L"processer"||colname==L"ProcessedDate"|| |
| | | colname==L"Subject"||colname==L"Content") |
| | | { |
| | | xstring ReadedFlag = dw_message.GetItemString(row,L"ReadedFlag"); |
| | | if(ReadedFlag != L"Y") |
| | | { |
| | | hdr.mask = DMS_CSSSTYLE; |
| | | //hdr.cssstyle = L"color:#cccccc"; |
| | | hdr.cssstyle = L"font-weight:700"; |
| | | |
| | | } |
| | | } |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int OnDWClick(TEvent* evt, int p) |
| | | { |
| | | xstring UserNO=publiccode::GetUser().no; |
| | | if(UserNO !=L"00701") |
| | | { |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | xstring value = hdr.data; |
| | | xstring colname = hdr.colname; |
| | | int row = hdr.row; |
| | | KXMLDOMElement ele = dw_message.GetRowElement(row); |
| | | xstring TaskID = ele.getAttribute(L"guid"); |
| | | xstring ReadedFlag = dw_message.GetItemString(row,L"ReadedFlag"); |
| | | xstring flowName = dw_message.GetItemString(row,L"flowName"); |
| | | if(ReadedFlag != L"Y") |
| | | { |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/business/message/read",L"TaskID",TaskID); |
| | | dw_message.SetItemString(row,L"ReadedFlag",L"Y"); |
| | | if(ReadedFlag != L"Y" && flowName == L"ä»·æ ¼åå
񄧮") |
| | | { |
| | | xml x1 = ViewObject::RetrieveData(L"/sale/data/business/Recovery/MessageStatus",L"TaskID",TaskID); |
| | | } |
| | | dw_message.Redraw(); |
| | | //RetrieveData(); |
| | | } |
| | | AdjustTip(); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int OpenShowroom1(TEvent* evt, int p) |
| | | { |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | xstring value = hdr.data; |
| | | xstring colname = hdr.colname; |
| | | int row = hdr.row; |
| | | KXMLDOMElement ele = dw_outbox.GetRowElement(row); |
| | | xstring TaskID = ele.getAttribute(L"guid"); |
| | | xstring Category = dw_outbox.GetItemString(row,L"flowName"); |
| | | if(Category==L"æ®é"){ |
| | | xaserverarg arg2; |
| | | |
| | | if(dw_outbox.GetRowCount() < 1) return 1; |
| | | KXMLDOMElement ele1 = dw_outbox.GetRowElement(dw_outbox.GetRow()); |
| | | arg2.AddArg(L"EntityID",dw_outbox.GetItemString(dw_outbox.GetRow(),L"EntityID")); |
| | | arg2.AddArg(L"id",ele1.getAttribute(L"guid")); |
| | | OpenWindow(L"dev:xpage[message.business.vx]",arg2); |
| | | return 1; |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int OpenShowroom(TEvent* evt, int p) |
| | | { |
| | | DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh; |
| | | xstring value = hdr.data; |
| | | xstring colname = hdr.colname; |
| | | int row = hdr.row; |
| | | KXMLDOMElement ele = dw_message.GetRowElement(row); |
| | | xstring TaskID = ele.getAttribute(L"guid"); |
| | | xstring Category = dw_message.GetItemString(row,L"Category"); |
| | | if(Category==L"è´§å·ç³è¯·"){ |
| | | int p1 ; |
| | | OpenWindow(L"dev:xpage[UserProductApply.vx]", p1); |
| | | } |
| | | if(Category==L"æ®é"){ |
| | | xaserverarg arg2; |
| | | |
| | | if(dw_message.GetRowCount() < 1) return 1; |
| | | KXMLDOMElement ele1 = dw_message.GetRowElement(dw_message.GetRow()); |
| | | arg2.AddArg(L"EntityID",dw_message.GetItemString(dw_message.GetRow(),L"EntityID")); |
| | | arg2.AddArg(L"id",ele1.getAttribute(L"guid")); |
| | | OpenWindow(L"dev:xpage[message.business.vx]", arg2); |
| | | return 1; |
| | | } |
| | | else if(Category==L"æ¥ä»·åå
񄧮") |
| | | { |
| | | if(dw_message.GetRowCount() < 1) return 1; |
| | | xstring No = dw_message.GetItemString(dw_message.GetRow(),L"No"); |
| | | OpenWindow(L"dev:xpage[EnquiryEx.quote.vx]",cast(No as int)); |
| | | } |
| | | if(Category==L"SupplierV3") |
| | | { |
| | | xaserverarg arg; |
| | | |
| | | if(dw_message.GetRowCount() < 1) return 1; |
| | | arg.AddArg(L"EntityID",dw_message.GetItemString(dw_message.GetRow(),L"EntityID")); |
| | | //OpenWindow(L"dev:xpage[maint.Owner.Supplier.v3.vx]",cast(arg as int)); |
| | | arg.AddArg(L"config",L"/sale/view/SupplierV3/config/supplier/open"); |
| | | OpenWindow(L"dev:xpage[maintex.Owner.Supplier.v3.vx]",arg); |
| | | } |
| | | if(Category==L"ä¾åºååé") |
| | | { |
| | | xaserverarg arg1; |
| | | |
| | | if(dw_message.GetRowCount() < 1) return 1; |
| | | arg1.AddArg(L"EntityID",dw_message.GetItemString(dw_message.GetRow(),L"EntityID")); |
| | | OpenWindow(L"dev:xpage[maint.Owner.Supplier.v3.vx]",arg1); |
| | | } |
| | | return 1; |
| | | } |
| | | int OnAttachEvent() |
| | | { |
| | | //ç»å®å·¥å
·æ¡ç¹å»äºä»¶ |
| | | AttachEvent(L"WM_XCOMMAND", (FEvent)&Business5Win::OnXCommand); |
| | | //è·åç¦ç¹äºä»¶ï¼ç¨äºé置工å
·æ¡ |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&Business5Win::OnSetFocus); |
| | | //æ éæ© |
| | | AttachEvent(L"tv_folder", L"TVN_SELCHANGED", (FEvent)&Business5Win::OnTreeSelChanged); |
| | | AttachEvent(L"dw_processed",L"DWV_ROWFOCUSCHANGED", (FEvent)&Business5Win::OnRowChanged); |
| | | AttachEvent(L"dw_message",L"DWV_ROWFOCUSCHANGED", (FEvent)&Business5Win::OnRowChanged); |
| | | AttachEvent(L"dw_outbox",L"DWV_ROWFOCUSCHANGED", (FEvent)&Business5Win::OnRowChanged); |
| | | AttachEvent(L"dw_Recovery",L"DWV_ROWFOCUSCHANGED", (FEvent)&Business5Win::OnRowChanged); |
| | | AttachEvent(L"dw_message",L"DWV_ASKSTYLE", (FEvent)&Business5Win::OnItemAskStyle); |
| | | AttachEvent(L"dw_message",L"DWV_CLICKED", (FEvent)&Business5Win::OnDWClick); |
| | | AttachEvent(L"dw_message",L"DWV_DOUBLECLICKED", (FEvent)&Business5Win::OpenShowroom); |
| | | AttachEvent(L"dw_outbox",L"DWV_DOUBLECLICKED", (FEvent)&Business5Win::OpenShowroom1); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | int OnRetrieve() |
| | | { |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int InitialFolder() |
| | | { |
| | | KXMLDOMElement xframeElement = GetElement(); |
| | | KXMLDOMElement e = xframeElement.selectSingleNode(L"//xtree[@name='tv_folder']/initial"); |
| | | |
| | | //KXMLDOMElement e = xframeElement.selectSingleNode(L"//xtree[@name='tv_folder']/data/item[@name='"+L"']"); |
| | | //trace(e.xml()); |
| | | if(e) |
| | | ExpandChildFolder(0,e); |
| | | return 1; |
| | | } |
| | | |
| | | int ExpandChildFolder(int hItem, KXMLDOMElement pElement) |
| | | { |
| | | KXMLDOMNodeList nlist = pElement.selectNodes(L"Item"); |
| | | int len = nlist.length(); |
| | | for (int i = 0; i < len; i++) |
| | | { |
| | | KXMLDOMElement e = nlist.item(i); |
| | | xstring name = e.getAttribute(L"name"); |
| | | xstring sImage = e.getAttribute(L"image"); |
| | | xstring child = e.getAttribute(L"child"); |
| | | int image = 15; |
| | | if(sImage) image = sImage.toInt(); |
| | | int h= tv_folder.InsertChildItem(tv_folder.GetId(),hItem,name, trust(e as int),image); |
| | | if(child !=L"no" ) tv_folder.SetItemChild(h,1); |
| | | ExpandChildFolder(h,e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int AdjustTip() |
| | | { |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/business/list/AdjustTipNotify"); |
| | | KXMLDOMNodeList nlist = x.selectNodes(L"/data/Item"); |
| | | KXMLDOMNode t = nlist.item(0); |
| | | xstring informationQuantity =t.selectSingleNode(L"informationQuantity").text(); |
| | | tv_folder.SetItemLabel(hMessage, L"æ¶æ¯"+L"(L"+informationQuantity+L")L"); |
| | | |
| | | xml x1 = ViewObject::RetrieveData(L"/sale/data/business/list/AdjustTipTask"); |
| | | //alert(x1.xml()); |
| | | KXMLDOMNodeList nlist1 = x1.selectNodes(L"/data/Item"); |
| | | KXMLDOMNode t1= nlist1.item(0); |
| | | xstring informationQuantityTask =t1.selectSingleNode(L"informationQuantityTask").text(); |
| | | tv_folder.SetItemLabel(hTask, L"ä»»å¡"+L"(L"+informationQuantityTask+L")L"); |
| | | |
| | | /*select count(*) from bpm_task where typ='notify' and process='N' |
| | | and charindex('|'+'00303'+'|','|' + rtrim(receiver) +'|')>=1*/ |
| | | return 1; |
| | | } |
| | | |
| | | int onload() |
| | | { |
| | | agentFor = L"business"; |
| | | OnAttachEvent(); |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_processed = GetControl(L"dw_processed"); |
| | | dw_processed.openUrl(L"/sale/view/Business3/template/processedtask"); |
| | | dw_processed.SetColumnState(L"EntityID",false); |
| | | dw_processed.SetColumnState(L"Category",false); |
| | | |
| | | dw_message = GetControl(L"dw_message"); |
| | | dw_message.openUrl(L"/sale/view/Business3/template/message"); |
| | | dw_message.SetAskStyle(true); |
| | | dw_message.SetColumnState(L"EntityID",false); |
| | | dw_message.SetColumnState(L"Category",false); |
| | | dw_message.SetColumnState(L"ReadedFlag",false); |
| | | |
| | | dw_outbox = GetControl(L"dw_outbox"); |
| | | dw_outbox.openUrl(L"/sale/view/Business3/template/outbox"); |
| | | dw_outbox.SetColumnState(L"EntityID",false); |
| | | |
| | | dw_Recovery = GetControl(L"dw_Recovery"); |
| | | dw_Recovery.openUrl(L"/sale/view/Business3/template/message"); |
| | | dw_Recovery.SetColumnState(L"EntityID",false); |
| | | dw_Recovery.SetColumnState(L"Category",false); |
| | | dw_Recovery.SetColumnState(L"ReadedFlag",false); |
| | | dw_Recovery.SetColumnState(L"No",false); |
| | | |
| | | |
| | | tv_folder = GetControl(L"tv_folder"); |
| | | tv_folder.SetLineAtRoot(true); |
| | | sheet = GetChildWin(L"sheet1"); |
| | | |
| | | int hItem = tv_folder.GetRootItem(); |
| | | tv_folder.ExpandItem(hItem); |
| | | int hcItem =tv_folder.GetChildItem(hItem); |
| | | hTask = hcItem; |
| | | tv_folder.ExpandItemAll(hcItem); |
| | | tv_folder.ItemFocus(tv_folder.GetChildItem(hcItem)); |
| | | hcItem = tv_folder.GetNextItem(hcItem); |
| | | hMessage = hcItem; |
| | | tv_folder.ExpandItemAll(hcItem); |
| | | |
| | | AdjustTip(); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int onloaded() |
| | | { |
| | | SetAgent(); |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | }; |