In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Business requirements: select enterprise personnel in batch, fill them into the grid parts, and achieve the check effect of the personnel list, and automatically synchronize the selected personnel list items.
First, we need to build a list of selected people and a list of enterprise personnel choices.
The construction of this form is quite simple, we will not explain it in detail, here is how to achieve the check effect of the personnel selection list and synchronize the people.
The idea to achieve the check effect is to obtain the datatable of the grid parts, transfer the datatable into the personnel selection form, cycle to judge the datatable and the selection list, and (personnel ID) set the check mark when the condition is established.
The realization idea of synchronization personnel is to get the identification personnel of the selection list, then return the display form, cycle to display the form personnel, judge whether the returned list collection already exists according to the select query method of datatable, and do not use the Delete method of datatable to delete rows.
'Open the smart form Form location: project form\ team building\ education and training\ * learner selection list * dim form1 = create form ("8f03a0cb-db62-4965-81e4-b995e4e4b1d5")'if Me.Input1= "EDIT" then 'get selected personnel list dim dt_YXRY= grid part 1.DataTable form1.Input1= "modify" pass in selection list form1.Input2=dt_YXRY Form1.Input3= "other" 'end ifform1.ShowDialog ()' to determine whether to get "Y" if form1.Output1= "Y" thendim index = grid component 1.DataTable.Rows.CountDim dt= grid component 1.DataTabledim drxdim rows=form1.Output2' to determine whether the personnel check is empty dim dt_drif rows.Count 0 then for each dr in rows'to determine whether the selected person is in the grid cstr drx = dt.Select (" PEIXUNRENYUANID=' "+ cstr (dr [" ID "]) +" 'and QUERENRENGANGWEIID =' "+ cstr (dr [" Job ID "]) +"')'is not in the grid. Drx.Length > 0 indicates that if drx.Length exists
< 1 then 'msgbox(dr["ID"]&" "&dr["姓名"]) dt_dr=dt.NewRow() dt_dr["ID"]=Guid() dt_dr["PEIXUNRENYUANID"]=dr["ID"] dt_dr["PEIXUNRENMINGCHENG"]=dr["姓名"] dt_dr["SHIFOUCANJIAXUEXI"]=true dt_dr["QUERENRENGANGWEIID"]=dr["岗位ID"] dt_dr["GANGWEI"]=dr["岗位"] dt.Rows.Add(dt_dr) index=index+1 end if nextend if'定义变量获取传回的list集合dim dtt=form1.Output4'定义变量获取网格部件的dtdim dtt1=网格部件1.DataTabledim dtt_drif dtt.Rows.Count>0 and dtt1.Rows.Count > 0 then' loop dt for each dr1 in dtt1.Copy (). Rows' determines whether the line status is marked deleted if dr1.RowState8 then' uses select method to determine whether there is rows=dtt.Select ("personnel ID='" + cstr (dr1 ["PEIXUNRENYUANID") + "'") if rows.Length = 0 then' msgbox (dr1 ["PEIXUNRENYUANID"] & "not found Remove ") dtt1.Select (" PEIXUNRENYUANID=' "+ Cstr (dr1 [" PEIXUNRENYUANID "]) +"'") [0] .Delete () end ifend if next end ifend if
Personnel selection list Code:
Dim dt_RYdim xmdim jsy' sets the security personnel selection status Cycle to set the selected personnel dim adim bdim dt_a= grid component 1.DataTable for each dr1 in RY.Rows if dr1.RowState8 then 'personnel ID a=dr1 ["PEIXUNRENYUANID"]' post ID b=dr1 ["QUERENRENGANGWEIID"] for each dr4 in dt_a.Rows If Cstr (dr4 ["ID"]) = Cstr (a) and Cstr (dr4 ["post ID"]) = Cstr (b) then grid component 1.MarkRowsByFilter ("ID=" & Cstr (dr4 ["ID"]) & "and post ID='" & Cstr (dr4 ["post ID"]) & "'" True) end if next end if next
Original address: http://bbs.delit.cn/thread-975-1-1.html
Please indicate the source of the reprint:
Written by: measurement Technology http://www.delit.cn
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.