¶Ô±ÈÐÂÎļþ |
| | |
| | | use "win.vl" |
| | | use "dev:vm[xdwgrid.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" |
| | | //unit vclient.vobject tpp |
| | | unit vbusiness.xpage |
| | | [ |
| | | HrPerson is extend frame; |
| | | about HrPerson |
| | | [ |
| | | control: |
| | | |
| | | method: |
| | | [ |
| | | xdwgrid__ dw_list; |
| | | xdwgrid__ dw_HrEmployee; |
| | | string m_sTxt; |
| | | |
| | | xnode__ m_agentNode; //Agent Condition |
| | | string m_agentCond; //Agent Node |
| | | 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 p) |
| | | { |
| | | SetAgent(); |
| | | |
| | | //é置工å
·æ¡ |
| | | return 1; |
| | | } |
| | | |
| | | //xgridexåå» |
| | | int OnDoubleClicked(ref TNotifyEvent evt,int p) |
| | | { |
| | | ref DWNMHDR hdr = evt.pnmh; |
| | | int row = hdr.row; |
| | | if(row < 1 || row > dw_list.GetRowCount()) |
| | | return 1; |
| | | msxml::IXMLDOMElement e = dw_list.GetRowElement(row); |
| | | string sguid = e.SelectSingleNode("@guid").text; |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("operate","modify"); |
| | | arg.AddArg("guid",sguid); |
| | | //trace(sguid); |
| | | //xwin::OpenWindow("dev:xpage[HrPersonMaint.xpage]",arg); |
| | | openUrl("ç»ç»æ¶æ.vface/xpage/Hr/HrPersonMaint", arg); |
| | | return 1; |
| | | } |
| | | //è¡æ¹å |
| | | int OnRowFocusChanged(ref TNotifyEvent evt,int p) |
| | | { |
| | | ref DWNMHDR hdr = evt.pnmh; |
| | | int row = hdr.row; |
| | | if(row < 1 || row > dw_list.GetRowCount()) |
| | | return 1; |
| | | msxml::IXMLDOMElement e = dw_list.GetRowElement(row); |
| | | string sPersonID = e.SelectSingleNode("@guid").text; |
| | | xml__ x = new xml__; |
| | | x.setNativePointer(x.CreateInstance()); |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("guid",sPersonID); |
| | | |
| | | if (url::get("OrganizationStruct/Person.HrEmployee",arg.GetString(),x) != 1) |
| | | { |
| | | trace(x.GetXmlDoc().text); |
| | | return -1; |
| | | }else |
| | | { |
| | | dw_HrEmployee.Retrieve(x); |
| | | dw_HrEmployee.Redraw(); |
| | | } |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int OnRetrieve() |
| | | { |
| | | xml__ x = new xml__; |
| | | x.setNativePointer(x.CreateInstance()); |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | arg.AddArg("sTxt",m_sTxt); |
| | | if (url::get("OrganizationStruct/list.HrPerson",arg.GetString(),x) != 1) |
| | | { |
| | | trace(x.GetXmlDoc().text); |
| | | return -1; |
| | | } |
| | | else |
| | | { |
| | | dw_list.Retrieve(x); |
| | | dw_list.Redraw(); |
| | | } |
| | | // if (dw_list.GetRowCount() >0) |
| | | // OnRowFocusChanged(); |
| | | dw_list.SetReadOnly(true); |
| | | return 1; |
| | | } |
| | | |
| | | int OnSearch() |
| | | { |
| | | control__ xc = new control__; |
| | | xc.setNativePointer(this.GetControl("QueryTxt")); |
| | | m_sTxt= xc.GetText(); |
| | | OnRetrieve(); |
| | | return 1; |
| | | } |
| | | |
| | | int OnUpdateAssignmentView() |
| | | { |
| | | xml__ x1 = new xml__; |
| | | x1.setNativePointer(x1.CreateInstance()); |
| | | if (url::post("OrganizationStruct/update.Assignmentview","",x1) != 1) |
| | | { |
| | | string error = x1.GetXmlDoc().text; |
| | | trace(error); |
| | | return 1; |
| | | } |
| | | else |
| | | { |
| | | trace(x1.GetXml()); |
| | | win__::MessageBox(GetHWND(),"æ´æ°æåï¼","æç¤º",0); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | //å½ä»¤åå¸å½æ° |
| | | int OnCmdDispatch(string comdid) |
| | | { |
| | | xaserverarg__ arg = new xaserverarg__; |
| | | arg.setNativePointer(arg.CreateInstance()); |
| | | msxml::IXMLDOMElement e; |
| | | string sPersonID; |
| | | string sName; |
| | | if (comdid =="AddPerson") |
| | | { |
| | | arg.AddArg("operate","new0"); |
| | | arg.AddArg("guid",""); |
| | | openUrl("ç»ç»æ¶æ.vface/xpage/Hr/HrPersonMaint", arg); |
| | | } |
| | | else if(comdid=="UpdateAssignmentView") |
| | | OnUpdateAssignmentView(); |
| | | else if (comdid =="ModifyPerson") |
| | | { |
| | | int row = dw_list.GetNextSelectRow(1); |
| | | if (row < 1) |
| | | { |
| | | row = dw_list.GetRow(); |
| | | if (row < 1) |
| | | { |
| | | win__::MessageBox(GetHWND(),"请éä¸è¦ä¿®æ¹ç人åè¡ï¼","æç¤º",0); |
| | | return -1; |
| | | } |
| | | } |
| | | e = dw_list.GetRowElement(row); |
| | | sPersonID = e.SelectSingleNode("@guid").text; |
| | | arg.AddArg("operate","modify"); |
| | | arg.AddArg("guid",sPersonID); |
| | | openUrl("ç»ç»æ¶æ.vface/xpage/Hr/HrPersonMaint", arg); |
| | | } |
| | | else if (comdid =="DeletePerson") |
| | | { |
| | | int row = dw_list.GetNextSelectRow(1); |
| | | if (row < 1) |
| | | { |
| | | row = dw_list.GetRow(); |
| | | if (row < 1) |
| | | { |
| | | win__::MessageBox(GetHWND(),"请éä¸è¦å é¤ç人åè¡ï¼","æç¤º",0); |
| | | return -1; |
| | | } |
| | | } |
| | | |
| | | e = dw_list.GetRowElement(row); |
| | | sPersonID = e.SelectSingleNode("@guid").text; |
| | | sName = e.selectSingleNode("Name").text; |
| | | sName += ""; |
| | | int MB_YESNO = 0x00000004; |
| | | int IDYES = 6; |
| | | if(win__::MessageBox(GetHWND(),"确认è¦å é¤ "+sName+" çä¿¡æ¯åï¼","æç¤º",MB_YESNO)!=IDYES) return 1; |
| | | |
| | | |
| | | arg.AddArg("guid",sPersonID); |
| | | |
| | | |
| | | xml__ x1 = new xml__; |
| | | x1.setNativePointer(x1.CreateInstance()); |
| | | if (url::post("OrganizationStruct/delete.HrPerson",arg.GetString(),x1) != 1) |
| | | { |
| | | string error = x1.GetXmlDoc().text; |
| | | trace(error); |
| | | } |
| | | else |
| | | { |
| | | //win32::MessageBox(GetHWND(),"å 餿åï¼","æç¤º",0); |
| | | dw_list.DeleteRow(row); |
| | | } |
| | | } |
| | | else if (comdid =="Refresh") |
| | | { |
| | | OnRetrieve(); |
| | | } |
| | | else if (comdid =="search" || comdid=="query") |
| | | { |
| | | OnSearch(); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | //å½ä»¤å¤çäºä»¶ |
| | | int OnXCommand(ref TXCommandEvent evt,int param) |
| | | { |
| | | return OnCmdDispatch(evt.pStrID); |
| | | } |
| | | |
| | | int OnAttachEvent() |
| | | { |
| | | //ç»å®å·¥å
·æ¡ç¹å»äºä»¶ |
| | | AttachEvent("WM_XCOMMAND",OnXCommand); |
| | | //è·åç¦ç¹äºä»¶ï¼ç¨äºé置工å
·æ¡ |
| | | AttachEvent("WM_SETFOCUS",OnSetFocus); |
| | | AttachEvent("dw_list","DWV_CLICKED",OnRowFocusChanged); |
| | | AttachEvent("dw_list","DWV_DOUBLECLICKED",OnDoubleClicked); |
| | | } |
| | | |
| | | int OnInitial() |
| | | { |
| | | SetAgent(); |
| | | |
| | | OnAttachEvent(); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | int onload() |
| | | { |
| | | m_sTxt=""; |
| | | dw_list = new xdwgrid__; |
| | | dw_list.setNativePointer(this.GetControl("dw_list")); |
| | | dw_list.openUrl("ç»ç»æ¶æ.vface/template/HrPerson/list"); |
| | | dw_list.SetReadOnly(true); |
| | | dw_list.SetSelectionMode(1); |
| | | |
| | | dw_HrEmployee = new xdwgrid__; |
| | | dw_HrEmployee.setNativePointer(this.GetControl("dw_HrEmployee")); |
| | | dw_HrEmployee.openUrl("ç»ç»æ¶æ.vface/template/HrPerson/listemp"); |
| | | //dw_HrEmployee.openUrl("ç»ç»æ¶æ.vface/template/HrEmployee/list"); |
| | | OnInitial(); |
| | | |
| | | OnRetrieve(); |
| | | |
| | | return 1; |
| | | } |
| | | ] |
| | | |
| | | ] |
| | | ] |