¶Ô±ÈÐÂÎļþ |
| | |
| | | use "win.vl" |
| | | use "dev:vm[xdwgrid.vm]" |
| | | use "dev:vm[xdwtable.vm]" |
| | | use "pref.vl" |
| | | use "dev:vm[xml.vm]" |
| | | use "dev:vm[xaserverarg.vm]" |
| | | use "dev:vm[xaserver.vm]" |
| | | use "dev:vm[xutil.vm]" |
| | | use "frame.vl" |
| | | use "treeview.vm" |
| | | |
| | | //unit vclient.vobject tpp |
| | | unit vbusiness.xpage |
| | | [ |
| | | HrJob is extend frame; |
| | | about HrJob |
| | | [ |
| | | field: |
| | | [ |
| | | treeview__ tv_1; |
| | | xdwgrid__ dw_list; |
| | | string m_type; |
| | | |
| | | xnode__ m_agentNode; //Agent Condition |
| | | string m_agentCond; //Agent Node |
| | | ] |
| | | |
| | | method: |
| | | [ |
| | | int SetAgent() |
| | | { |
| | | string xfNodeAgentArea = "agentarea"; |
| | | xnode__ anode = new xnode__; |
| | | anode.setNativePointer(GetAgentNode(xfNodeAgentArea)); |
| | | var xframeElement = GetElement(); |
| | | var agent = xframeElement.selectSingleNode("agent/" + xfNodeAgentArea + "[1]/*"); |
| | | if (agent) |
| | | { |
| | | string s = agent.xml; |
| | | SetAgentNodeContent(anode, s); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | //ç¦ç¹æ¿æ´»å¤ç彿° |
| | | int OnSetFocus(ref TEvent evt, int param) |
| | | { |
| | | SetAgent(); |
| | | |
| | | //é置工å
·æ¡ |
| | | return 1; |
| | | } |
| | | |
| | | int OnRetrieve() |
| | | { |
| | | string query = "[MSSqlHrJob.xq]"; |
| | | xml__ x = new xml__; |
| | | x.setNativePointer(x.CreateInstance()); |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("type", m_type); |
| | | //if (xaserver__::ExecXQuery(GetServerUrl(),query,arg.GetString(),x)!=1) |
| | | if (url::post("OrganizationStruct/list.Job", arg.GetString(), x) != 1) |
| | | { |
| | | trace(x.GetXmlDoc().text); |
| | | return -1; |
| | | } |
| | | else |
| | | { |
| | | dw_list.openUrl("ç»ç»æ¶æ.vface/template/HrJob/list"); |
| | | dw_list.Retrieve(x); |
| | | dw_list.Redraw(); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int OnTreeSelChanged(ref TNotifyEvent evt, int p) { |
| | | ref NMTREEVIEW nmtv = evt.pnmh; |
| | | int hItem = nmtv.itemNew.hItem; |
| | | |
| | | int wid = tv_1.GetId(); |
| | | int hItem = treeview__::GetSelectedItem(wid); |
| | | int rootItem = treeview__::GetRootItem(wid); |
| | | if (hItem <= 0 || hItem == rootItem) |
| | | { |
| | | m_type = "all"; |
| | | } |
| | | else |
| | | { |
| | | msxml::IXMLDOMElement ele = treeview__::GetItemData(wid, hItem); |
| | | m_type = ele.SelectSingleNode("@name").text; |
| | | } |
| | | OnRetrieve(); |
| | | return 1; |
| | | } |
| | | |
| | | int OnCreateTree() |
| | | { |
| | | int wid = tv_1.GetId(); |
| | | xml__ x = new xml__; |
| | | x.setNativePointer(xml__::CreateInstance()); |
| | | x.Load("<Type code='0.0' name='all' guid='' />"); |
| | | msxml::IXMLDOMElement ele = x.GetXmlDoc().SelectSingleNode("Type"); |
| | | int hItem = tv_1.InsertChildItemEx(wid, 0, "å·¥ç§ç±»å", ele, 15, 4); |
| | | |
| | | if (url::post("/sale/data/OrganizationStruct/type.Job", "", x) != 1) |
| | | { |
| | | trace(x.GetXml()); |
| | | return -1; |
| | | } |
| | | //trace(x.GetXml()); |
| | | var list = x.GetXmlDoc().selectNodes("//Type"); |
| | | int i = 0, s = list.length; |
| | | msxml::IXMLDOMElement e; |
| | | string sname; |
| | | if (s > 0) |
| | | { |
| | | for (i = 0; i < s; i++) |
| | | { |
| | | e = list.item(i); |
| | | sname = e.SelectSingleNode("@name").text; |
| | | int curItem = tv_1.InsertChildItemEx(wid, hItem, sname, e, 15, 4); |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int OnSave() |
| | | { |
| | | xml__ x = new xml__; |
| | | x.setNativePointer(x.CreateInstance()); |
| | | dw_list.AcceptText(); |
| | | dw_list.DwUpdateAllToEx(x.GetXmlDoc()); |
| | | |
| | | string xdata = x.GetXml(); |
| | | trace(x.GetXml()); |
| | | //return 1; |
| | | |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("xdata", xdata); |
| | | |
| | | string xAction = "[MSSqlHrJobUpdate.xa]"; |
| | | //if(xaserver__::ExecXAction(GetServerUrl(),xAction,arg.GetString())!=1) |
| | | if (url::post("OrganizationStruct/update.Job", arg.GetString(), x) != 1) |
| | | { |
| | | trace(x.GetXmlDoc().documentElement.text); |
| | | alert("ä¿å失败"); |
| | | } |
| | | else { |
| | | alert("ä¿åæå"); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int OnAddRow() |
| | | { |
| | | if (m_type == "all") |
| | | { |
| | | alert("请å
鿩工ç§ç±»åï¼"); |
| | | } |
| | | else |
| | | { |
| | | int row = dw_list.InsertRow(0); |
| | | trace(row.toString()); |
| | | dw_list.SetItemString(row, "JobType", m_type); |
| | | dw_list.SetItemString(row, "Status", "Y"); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int OnInsertRow() |
| | | { |
| | | if (m_type == "all") |
| | | { |
| | | alert("请å
鿩工ç§ç±»åï¼"); |
| | | } |
| | | else |
| | | { |
| | | int crow = dw_list.GetRow(); |
| | | int row = dw_list.InsertRow(crow); |
| | | dw_list.SetItemString(row, "JobType", m_type); |
| | | dw_list.SetItemString(row, "Status", "Y"); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | int OnDeleteRow() |
| | | { |
| | | int row = dw_list.GetRow(); |
| | | msxml::IXMLDOMElement e = dw_list.GetRowElement(row); |
| | | string sguid = e.selectSingleNode("@guid").text; |
| | | string sName = e.selectSingleNode("JobName").text; |
| | | |
| | | xml__ x = new xml__; |
| | | x.setNativePointer(x.CreateInstance()); |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("guid", sguid); |
| | | if (url::post("OrganizationStruct/used.Job", arg.GetString(), x) != 1) |
| | | { |
| | | trace(x.GetXmlDoc().text); |
| | | return -1; |
| | | } |
| | | else |
| | | { |
| | | msxml::IXMLDOMElement ele = x.GetXmlDoc().documentElement; |
| | | string snums = ele.SelectSingleNode("@num").text; |
| | | int num = snums.toInt(); |
| | | if (num != 0) |
| | | { |
| | | win__::MessageBox(GetHWND(), "å·¥ç§ " + sName + " å·²å¯ç¨ï¼ç¦æ¢å é¤ï¼", "æç¤º", 0); |
| | | return -1; |
| | | } |
| | | } |
| | | dw_list.DeleteRow(row); |
| | | return 1; |
| | | } |
| | | |
| | | int OnJobType() |
| | | { |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("id", "å·¥ç§ç±»å"); |
| | | openUrl("å
Œ
±è®¾ç½®.vface/worknode/quickcode/config", arg); |
| | | return 1; |
| | | } |
| | | |
| | | //å½ä»¤åå¸å½æ° |
| | | int OnCmdDispatch(string comdid) |
| | | { |
| | | if (comdid == "Save") OnSave(); |
| | | else if (comdid == "AddRow") OnAddRow(); |
| | | else if (comdid == "InsertRow") OnInsertRow(); |
| | | else if (comdid == "DeleteRow") OnDeleteRow(); |
| | | else if (comdid == "JobType") OnJobType(); |
| | | return 0; |
| | | } |
| | | |
| | | //å½ä»¤å¤çäºä»¶ |
| | | int OnXCommand(ref TXCommandEvent evt, int param) |
| | | { |
| | | return OnCmdDispatch(evt.pStrID); |
| | | } |
| | | |
| | | int OnAttachEvent() |
| | | { |
| | | //ç»å®å·¥å
·æ¡ç¹å»äºä»¶ |
| | | AttachEvent("WM_XCOMMAND", OnXCommand); |
| | | //è·åç¦ç¹äºä»¶ï¼ç¨äºé置工å
·æ¡ |
| | | AttachEvent("WM_SETFOCUS", OnSetFocus); |
| | | //è·å¾æ çéæ©äºä»¶ |
| | | AttachEvent("tv_1", "TVN_SELCHANGED", OnTreeSelChanged); |
| | | } |
| | | |
| | | int OnInitial() |
| | | { |
| | | SetAgent(); |
| | | OnAttachEvent(); |
| | | return 1; |
| | | } |
| | | |
| | | int onload() |
| | | { |
| | | m_type = "all"; |
| | | tv_1 = new treeview__; |
| | | tv_1.setNativePointer(this.GetControl("tv_1")); |
| | | dw_list = new xdwgrid__; |
| | | dw_list.setNativePointer(this.GetControl("dw_list")); |
| | | dw_list.openUrl("ç»ç»æ¶æ.vface/template/HrJob/list"); |
| | | |
| | | OnInitial(); |
| | | OnCreateTree(); |
| | | int wid = tv_1.GetId(); |
| | | int hItem = treeview__::GetRootItem(wid); |
| | | tv_1.ExpandItem(wid, hItem); |
| | | OnRetrieve(); |
| | | |
| | | return 1; |
| | | } |
| | | ] |
| | | |
| | | ] |
| | | ] |