基于平台开发人事档案管理功能
基于平台开发人事档案管理功能
此功能主要是人事模块的员工档案维护功能;功能点如下:
- 员工基础资料
- 教育经历
- 工作经历
- 家庭背景
- 紧急联络人
- 担保人
- 合同历史(不能在员工资料界面维护;需要在合同模块维护)
- 奖罚记录(不能在员工资料界面维护;需要在奖罚模块维护)
- 调岗记录(不能在员工资料界面维护;需要在调岗模块维护)
- 薪酬调整记录(不能在员工资料界面维护;需要在薪酬调整记录模块维护)
- 员工资料的文件管理;如身份证、学历证、驾驶证等扫描件管理
界面重要的字段;便于人事系统统计分析模块提供数据基础;
如:分析人事人员学历分布、婚姻分布、年龄分布等等统计。字段如下
便于人事系统其他模块及时提示到期数据;
如:合同到期列表、身份证到期列表、生日列表等等人事业务处理提供数据的功能。
- 性别
- 出身年月
- 民族
- 学历
- 婚姻
- 状态
- 政治面貌
- 社会保险
- 编制类型
- 电脑水平
- 英语语种
- 外语水平
- 健康状况
- 应聘途径
- 交通工具
- 住宿
- 竞业协议
运行界面如下:
平台设计的界面和代码如下:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 import clr 2 clr.AddReference("System") 3 clr.AddReference("System.Drawing") 4 clr.AddReference("System.Windows.Forms") 5 clr.AddReference("System.Data") 6 clr.AddReferenceToFileAndPath(Path+"\Infragistics2.Win.UltraWinGrid.v10.1.dll") 7 clr.AddReferenceToFileAndPath(Path+"\Infragistics2.Excel.v10.1.dll") 8 clr.AddReferenceToFileAndPath(Path+"\Infragistics2.Shared.v10.1.dll") 9 clr.AddReferenceToFileAndPath(Path+"\Infragistics2.Win.v10.1.dll") 10 clr.AddReferenceToFileAndPath(Path+"\Infragistics2.Win.UltraWinDock.v10.1.dll") 11 clr.AddReferenceToFileAndPath(Path+"\Infragistics2.Win.UltraWinToolbars.v10.1.dll") 12 clr.AddReferenceToFileAndPath(Path+"\Utility.dll") 13 14 from Utility import * 15 from System.Windows.Forms import * 16 from System.Drawing import * 17 from System import * 18 from System.ComponentModel import * 19 from System.Data.OleDb import * 20 from System.Data.SqlClient import * 21 from System.Data import * 22 from Infragistics.Shared import * 23 from Infragistics.Win import * 24 from Infragistics.Win.UltraWinGrid import * 25 from Infragistics.Win.UltraWinToolbars import * 26 27 import Infragistics.Win.UltraWinGrid 28 import System 29 import Utility 30 31 Tool=UltraToolbarsManager() 32 Tool=Object_Tool 33 TableName="员工资料维护" 34 this.Text="员工资料维护" 35 SQL_Code=UGrid.InitDataSQL(FormName,UserID,Folder,TableName) 36 FindSQL="" 37 TableCol=UGrid.InitDataCol(FormName,UserID,Folder,TableName) 38 39 Bind = BindingSource() 40 SQLL="" 41 Stat="" 42 Ds=System.Data.DataSet() 43 DataParm=appcs.Arraylist() 44 UGrid.InitGrid(UltraGrid1,True) 45 UGrid.InitGrid(UltraGrid2,True) 46 UGrid.InitGrid(UltraGrid3,True) 47 UGrid.InitGrid(UltraGrid4,True) 48 UGrid.InitGrid(UltraGrid5,True) 49 UGrid.InitGrid(UltraGrid6,True) 50 UGrid.GridKeyDown(UltraGrid1,True) 51 #UGrid.GridAfterRowActivate(UltraGrid1) 52 UGrid.GridRowFile(UltraGrid2,"All") 53 UGrid.GridRowFile(UltraGrid3,"All") 54 UGrid.GridRowFile(UltraGrid4,"All") 55 UGrid.GridRowFile(UltraGrid5,"All") 56 UGrid.GridRowFile(UltraGrid6,"All") 57 UGrid.GridRowFile(UltraGrid7,"All") 58 UGrid.GridRowFile(UltraGrid8,"All") 59 UGrid.GridRowFile(UltraGrid9,"All") 60 UGrid.GridRowFile(UltraGrid10,"All") 61 UGrid.Layout(FormName,UserID,Folder,UltraGrid1) 62 UGrid.Layout(FormName,UserID,Folder,UltraGrid2) 63 UGrid.Layout(FormName,UserID,Folder,UltraGrid3) 64 UGrid.Layout(FormName,UserID,Folder,UltraGrid4) 65 UGrid.Layout(FormName,UserID,Folder,UltraGrid5) 66 UGrid.Layout(FormName,UserID,Folder,UltraGrid6) 67 UGrid.Layout(FormName,UserID,Folder,UltraGrid7) 68 UGrid.Layout(FormName,UserID,Folder,UltraGrid8) 69 UGrid.Layout(FormName,UserID,Folder,UltraGrid9) 70 UGrid.Layout(FormName,UserID,Folder,UltraGrid10) 71 72 UltraGrid1.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.CellSelect 73 UltraGrid1.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.No 74 UltraGrid1.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False 75 76 UltraGrid7.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.CellSelect 77 UltraGrid7.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.No 78 UltraGrid7.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False 79 80 UltraGrid8.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.CellSelect 81 UltraGrid8.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.No 82 UltraGrid8.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False 83 84 UltraGrid9.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.CellSelect 85 UltraGrid9.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.No 86 UltraGrid9.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False 87 88 UltraGrid10.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.CellSelect 89 UltraGrid10.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.No 90 UltraGrid10.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False 91 92 def Sx(): 93 Tool.Toolbars[0].Tools["取消"].SharedProps.Enabled=False 94 Tool.Toolbars[0].Tools["保存"].SharedProps.Enabled=False 95 Tool.Toolbars[0].Tools["查找(F)"].SharedProps.Enabled=True 96 Tool.Toolbars[0].Tools["添加"].SharedProps.Enabled=True 97 Tool.Toolbars[0].Tools["修改"].SharedProps.Enabled=True 98 Tool.Toolbars[0].Tools["删除"].SharedProps.Enabled=True 99 Tool.Toolbars[0].Tools["第一个"].SharedProps.Enabled=True 100 Tool.Toolbars[0].Tools["下一个"].SharedProps.Enabled=True 101 Tool.Toolbars[0].Tools["上一个"].SharedProps.Enabled=True 102 Tool.Toolbars[0].Tools["最后一个"].SharedProps.Enabled=True 103 Tool.Toolbars[0].Tools["附件"].SharedProps.Enabled=True 104 Tool.Toolbars[0].Tools["报表"].SharedProps.Enabled=True 105 UGrid.ControlReadOnly(UltraGroupBox1,"ReadOnly",True) 106 UltraGrid2.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.CellSelect 107 UltraGrid2.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.Yes 108 UltraGrid2.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False 109 UltraGrid3.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.CellSelect 110 UltraGrid3.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.No 111 UltraGrid3.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False 112 UltraGrid4.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.CellSelect 113 UltraGrid4.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.No 114 UltraGrid4.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False 115 UltraGrid5.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.CellSelect 116 UltraGrid5.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.No 117 UltraGrid5.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False 118 UltraGrid6.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.CellSelect 119 UltraGrid6.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.No 120 UltraGrid6.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False 121 def SxCancel(): 122 Tool.Toolbars[0].Tools["取消"].SharedProps.Enabled=True 123 Tool.Toolbars[0].Tools["保存"].SharedProps.Enabled=True 124 Tool.Toolbars[0].Tools["查找(F)"].SharedProps.Enabled=False 125 Tool.Toolbars[0].Tools["添加"].SharedProps.Enabled=False 126 Tool.Toolbars[0].Tools["修改"].SharedProps.Enabled=False 127 Tool.Toolbars[0].Tools["删除"].SharedProps.Enabled=False 128 Tool.Toolbars[0].Tools["第一个"].SharedProps.Enabled=False 129 Tool.Toolbars[0].Tools["下一个"].SharedProps.Enabled=False 130 Tool.Toolbars[0].Tools["上一个"].SharedProps.Enabled=False 131 Tool.Toolbars[0].Tools["最后一个"].SharedProps.Enabled=False 132 Tool.Toolbars[0].Tools["附件"].SharedProps.Enabled=False 133 Tool.Toolbars[0].Tools["报表"].SharedProps.Enabled=False 134 UGrid.ControlReadOnly(UltraGroupBox1,"ReadOnly",False) 135 UltraGrid2.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.Edit 136 UltraGrid2.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.TemplateOnBottom 137 UltraGrid2.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.True 138 UltraGrid3.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.Edit 139 UltraGrid3.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.TemplateOnBottom 140 UltraGrid3.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.True 141 UltraGrid4.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.Edit 142 UltraGrid4.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.TemplateOnBottom 143 UltraGrid4.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.True 144 UltraGrid5.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.Edit 145 UltraGrid5.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.TemplateOnBottom 146 UltraGrid5.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.True 147 UltraGrid6.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.Edit 148 UltraGrid6.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.TemplateOnBottom 149 UltraGrid6.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.True 150 UltraGrid2.DisplayLayout.Bands[0].Columns["Stat_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DateTime 151 UltraGrid2.DisplayLayout.Bands[0].Columns["End_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DateTime 152 UltraGrid3.DisplayLayout.Bands[0].Columns["Stat_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DateTime 153 UltraGrid3.DisplayLayout.Bands[0].Columns["End_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DateTime 154 UltraGrid2.DisplayLayout.Bands[0].Columns["Stat_Date"].MaskInput="{LOC}yyyy/mm/dd" 155 UltraGrid2.DisplayLayout.Bands[0].Columns["End_Date"].MaskInput="{LOC}yyyy/mm/dd" 156 UltraGrid3.DisplayLayout.Bands[0].Columns["Stat_Date"].MaskInput="{LOC}yyyy/mm/dd" 157 UltraGrid3.DisplayLayout.Bands[0].Columns["End_Date"].MaskInput="{LOC}yyyy/mm/dd" 158 def SxBind(): 159 Tool.Toolbars[0].Tools["下一个"].SharedProps.Enabled=True 160 Tool.Toolbars[0].Tools["上一个"].SharedProps.Enabled=True 161 Tool.Toolbars[0].Tools["最后一个"].SharedProps.Enabled=True 162 Tool.Toolbars[0].Tools["第一个"].SharedProps.Enabled=True 163 if Bind.Count==0: 164 Tool.Toolbars[0].Tools["下一个"].SharedProps.Enabled=False 165 Tool.Toolbars[0].Tools["上一个"].SharedProps.Enabled=False 166 Tool.Toolbars[0].Tools["最后一个"].SharedProps.Enabled=False 167 Tool.Toolbars[0].Tools["第一个"].SharedProps.Enabled=False 168 if Bind.Count==1: 169 Tool.Toolbars[0].Tools["下一个"].SharedProps.Enabled=False 170 Tool.Toolbars[0].Tools["上一个"].SharedProps.Enabled=False 171 Tool.Toolbars[0].Tools["最后一个"].SharedProps.Enabled=False 172 Tool.Toolbars[0].Tools["第一个"].SharedProps.Enabled=False 173 if Bind.Position==0 and Bind.Count>1: 174 Tool.Toolbars[0].Tools["上一个"].SharedProps.Enabled=False 175 if Bind.Position+1==Bind.Count and Bind.Count>1: 176 Tool.Toolbars[0].Tools["下一个"].SharedProps.Enabled=False 177 UltraGrid2.DataSource=dataserver.Db_CreateDataSet("select * from Hr_Education where Emp_ID='"+TxtEmp_ID.Text.Replace("'","")+"'",TableName) 178 UltraGrid3.DataSource=dataserver.Db_CreateDataSet("select * from Hr_Work_experience where Emp_ID='"+TxtEmp_ID.Text.Replace("'","")+"'",TableName) 179 UltraGrid4.DataSource=dataserver.Db_CreateDataSet("select * from Hr_Family_relations where Emp_ID='"+TxtEmp_ID.Text.Replace("'","")+"'",TableName) 180 UltraGrid5.DataSource=dataserver.Db_CreateDataSet("select * from Hr_by where Emp_ID='"+TxtEmp_ID.Text.Replace("'","")+"'",TableName) 181 UltraGrid6.DataSource=dataserver.Db_CreateDataSet("select * from Hr_Emergency_contact where Emp_ID='"+TxtEmp_ID.Text.Replace("'","")+"'",TableName) 182 UltraGrid7.DataSource=dataserver.Db_CreateDataSet("select * from Hr_contract where Emp_ID='"+TxtEmp_ID.Text.Replace("'","")+"'",TableName) 183 UltraGrid8.DataSource=dataserver.Db_CreateDataSet("select * from Hr_award where Emp_ID='"+TxtEmp_ID.Text.Replace("'","")+"'",TableName) 184 UltraGrid9.DataSource=dataserver.Db_CreateDataSet("select * from Hr_Adjustable_hillock where Emp_ID='"+TxtEmp_ID.Text.Replace("'","")+"'",TableName) 185 UltraGrid10.DataSource=dataserver.Db_CreateDataSet("select * from Hr_salary where Emp_ID='"+TxtEmp_ID.Text.Replace("'","")+"'",TableName) 186 UltraGrid2.DataSource.Tables[0].Columns["Emp_ID"].DefaultValue=TxtEmp_ID.Text.Replace("'","") 187 UltraGrid3.DataSource.Tables[0].Columns["Emp_ID"].DefaultValue=TxtEmp_ID.Text.Replace("'","") 188 UltraGrid4.DataSource.Tables[0].Columns["Emp_ID"].DefaultValue=TxtEmp_ID.Text.Replace("'","") 189 UltraGrid5.DataSource.Tables[0].Columns["Emp_ID"].DefaultValue=TxtEmp_ID.Text.Replace("'","") 190 UltraGrid6.DataSource.Tables[0].Columns["Emp_ID"].DefaultValue=TxtEmp_ID.Text.Replace("'","") 191 192 Lay=UGrid.InitDataCol(FormName,UserID,Folder,"教育背景") 193 UGrid.LoadDataCol(UltraGrid2.DataSource,Lay) 194 UGrid.LoadGridCol(UltraGrid2.DisplayLayout.Bands[0],Lay) 195 196 Lay=UGrid.InitDataCol(FormName,UserID,Folder,"工作经历") 197 UGrid.LoadDataCol(UltraGrid3.DataSource,Lay) 198 UGrid.LoadGridCol(UltraGrid3.DisplayLayout.Bands[0],Lay) 199 200 UltraGrid2.DisplayLayout.Bands[0].Columns["Stat_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit 201 UltraGrid2.DisplayLayout.Bands[0].Columns["End_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit 202 UltraGrid3.DisplayLayout.Bands[0].Columns["Stat_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit 203 UltraGrid3.DisplayLayout.Bands[0].Columns["End_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit 204 UltraGrid2.DisplayLayout.Bands[0].Columns["Stat_Date"].MaskInput="yyyy/mm/dd" 205 UltraGrid2.DisplayLayout.Bands[0].Columns["End_Date"].MaskInput="yyyy/mm/dd" 206 UltraGrid3.DisplayLayout.Bands[0].Columns["Stat_Date"].MaskInput="yyyy/mm/dd" 207 UltraGrid3.DisplayLayout.Bands[0].Columns["End_Date"].MaskInput="yyyy/mm/dd" 208 209 Lay=UGrid.InitDataCol(FormName,UserID,Folder,"家庭关系") 210 UGrid.LoadDataCol(UltraGrid4.DataSource,Lay) 211 UGrid.LoadGridCol(UltraGrid4.DisplayLayout.Bands[0],Lay) 212 213 Lay=UGrid.InitDataCol(FormName,UserID,Folder,"承担人") 214 UGrid.LoadDataCol(UltraGrid5.DataSource,Lay) 215 UGrid.LoadGridCol(UltraGrid5.DisplayLayout.Bands[0],Lay) 216 217 Lay=UGrid.InitDataCol(FormName,UserID,Folder,"紧急联系人") 218 UGrid.LoadDataCol(UltraGrid6.DataSource,Lay) 219 UGrid.LoadGridCol(UltraGrid6.DisplayLayout.Bands[0],Lay) 220 221 Lay=UGrid.InitDataCol(FormName,UserID,Folder,"合同信息") 222 UGrid.LoadDataCol(UltraGrid7.DataSource,Lay) 223 UGrid.LoadGridCol(UltraGrid7.DisplayLayout.Bands[0],Lay) 224 225 Lay=UGrid.InitDataCol(FormName,UserID,Folder,"奖罚信息") 226 UGrid.LoadDataCol(UltraGrid8.DataSource,Lay) 227 UGrid.LoadGridCol(UltraGrid8.DisplayLayout.Bands[0],Lay) 228 229 Lay=UGrid.InitDataCol(FormName,UserID,Folder,"调岗信息") 230 UGrid.LoadDataCol(UltraGrid9.DataSource,Lay) 231 UGrid.LoadGridCol(UltraGrid9.DisplayLayout.Bands[0],Lay) 232 233 Lay=UGrid.InitDataCol(FormName,UserID,Folder,"薪资信息") 234 UGrid.LoadDataCol(UltraGrid10.DataSource,Lay) 235 UGrid.LoadGridCol(UltraGrid10.DisplayLayout.Bands[0],Lay) 236 Txtdqs.Text=dataserver.Db_Cell("select top 1 Description from E_City where City='"+Txtjg.Text.Replace("'","")+"'",False) 237 def Bind_PositionChanged(sender,e): 238 SxBind() 239 240 Bind.PositionChanged +=Bind_PositionChanged 241 242 def Load(): 243 global Ds 244 global SQL_Code,SQLL 245 global TableName 246 Ds.Clear() 247 Ds=dataserver.Db_CreateDataSet_SchemaType("select "+appcs.Find("Combox Count")+" * from ( "+SQL_Code +" ) as a",TableName) 248 UGrid.LoadDataCol(Ds,TableCol) 249 # gg=UGrid() 250 # gg.LoadEvent(Ds.Tables[0],TableCol.Tables[0]) 251 Bind.DataSource=Ds.Tables[0] 252 UltraGrid1.DataSource=Bind 253 UGrid.LoadGridCol(UltraGrid1.DisplayLayout.Bands[0],TableCol) 254 UltraGrid1.DisplayLayout.Bands[0].Columns["csny"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit 255 UltraGrid1.DisplayLayout.Bands[0].Columns["dzsj"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit 256 UltraGrid1.DisplayLayout.Bands[0].Columns["csny"].MaskInput="yyyy/mm/dd" 257 UltraGrid1.DisplayLayout.Bands[0].Columns["dzsj"].MaskInput="yyyy/mm/dd" 258 cl=UltraGroupBox1 259 UGrid.BindTableClear(cl) 260 UGrid.BindTableBind(cl,Bind,"Value") 261 Sx() 262 SxBind() 263 Load() 264 265 def Tool_ToolClick(sender,e): 266 global Ds 267 global SQL_Code,Stat,SQLL 268 global FindSQL 269 global TableName 270 global Bind 271 if e.Tool.Key.ToString()=="查找(F)" and Tool.Toolbars[0].Tools["保存"].SharedProps.Enabled==False: 272 find=FindSearch() 273 find.SQLTable=Ds.Tables[0] 274 find.FormName=FormName 275 find.UserID=UserID 276 find.Folder=Folder 277 find.Icon=this.Icon 278 find.ShowDialog() 279 if find.DialogResult != DialogResult.OK:return 280 FindSQL = find.SQLDialogResult 281 SQL= SQL_Code 282 if FindSQL<>"": 283 SQL= "select "+appcs.Find("Combox Count")+" * from ( " + SQL + " ) " + TableName +" " + FindSQL 284 SQLL=FindSQL 285 Ds.Clear() 286 Ds=dataserver.Db_CreateDataSet(SQL,TableName) 287 UGrid.LoadDataCol(Ds,TableCol) 288 # gg=UGrid() 289 # gg.LoadEvent(Ds.Tables[0],TableCol.Tables[0]) 290 Bind.DataSource=Ds.Tables[0] 291 UltraGrid1.DataSource=Bind 292 UGrid.LoadGridCol(UltraGrid1.DisplayLayout.Bands[0],TableCol) 293 cl=UltraGroupBox1 294 Sx() 295 SxBind() 296 elif e.Tool.Key.ToString()=="添加": 297 Bind.AddNew() 298 # UGrid.UpdateRow(UGrid.RowBind(Bind)[0],TableCol.Tables[0]) 299 UGrid.RowBind(Bind)[0]["CreateID"]=appcs.Find("UserID") 300 UGrid.RowBind(Bind)[0]["RecordID"]=appcs.Find("UserID") 301 UGrid.RowBind(Bind)[0]["CreateDate"]=System.DateTime.Now 302 UGrid.RowBind(Bind)[0]["RecordDate"]=System.DateTime.Now 303 UGrid.RowBind(Bind)[0]["RowPointer"]=System.Guid.NewGuid() 304 SxCancel() 305 UltraGrid1.Enabled=False 306 elif e.Tool.Key.ToString()=="修改": 307 SxCancel() 308 UltraGrid1.Enabled=False 309 elif e.Tool.Key.ToString()=="取消": 310 Bind.CancelEdit() 311 SxBind() 312 Sx() 313 UltraGrid1.Enabled=True 314 UltraGrid2.DisplayLayout.Bands[0].Columns["Stat_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit 315 UltraGrid2.DisplayLayout.Bands[0].Columns["End_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit 316 UltraGrid3.DisplayLayout.Bands[0].Columns["Stat_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit 317 UltraGrid3.DisplayLayout.Bands[0].Columns["End_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit 318 UltraGrid2.DisplayLayout.Bands[0].Columns["Stat_Date"].MaskInput="yyyy/mm/dd" 319 UltraGrid2.DisplayLayout.Bands[0].Columns["End_Date"].MaskInput="yyyy/mm/dd" 320 UltraGrid3.DisplayLayout.Bands[0].Columns["Stat_Date"].MaskInput="yyyy/mm/dd" 321 UltraGrid3.DisplayLayout.Bands[0].Columns["End_Date"].MaskInput="yyyy/mm/dd" 322 elif e.Tool.Key.ToString()=="删除": 323 SxCancel() 324 UltraGrid1.Enabled=False 325 elif e.Tool.Key.ToString()=="保存": 326 if Ds.Tables.Count<1:return 327 if Stat<>"删除": 328 if TxtEmp_ID.Text=="":appcs.Msg("请输入工号,再保存数据!","提示");return 329 if TxtEmp_Name.Text=="":appcs.Msg("请输入姓名,再保存数据!","提示");return 330 if Txtshbx.Text=="":appcs.Msg("请输选择社会保险,再保存数据!","提示");return 331 if Txtlx.Text=="":appcs.Msg("请选择编制类型,再保存数据!","提示");return 332 if Txtlx.Text=="":appcs.Msg("请选择编制类型,再保存数据!","提示");return 333 if Txtsfz.Text=="":appcs.Msg("请输入身份证,再保存数据!","提示");return 334 if Txtcsny.Value==null:appcs.Msg("请输入出身年月,再保存数据!","提示");return 335 if Txtdqr.Value==null:appcs.Msg("请输入证件到期日期,再保存数据!","提示");return 336 if Txtdzsj.Value==null:appcs.Msg("请输入到职日期,再保存数据!","提示");return 337 if Txtjtgj.Text=="":appcs.Msg("请选择交通工具,再保存数据!","提示");return 338 if Txtyptj.Text=="":appcs.Msg("请选择应聘途径,再保存数据!","提示");return 339 if Txtlrsj.Value==null:appcs.Msg("请输入录入日期,再保存数据!","提示");return 340 if Txtzgxl.Text=="":appcs.Msg("请选择最高学历,再保存数据!","提示");return 341 if dataserver.Db_Cell("SELECT professional AS 专业,description AS 说明 FROM Hr_professional WHERE professional ='"+Txtzy.Text.Replace("'","")+"'",False)=="": 342 appcs.Msg("请选择正确的专业,再保存数据!","提示");return 343 if dataserver.Db_Cell("SELECT E_City.City AS 城市,E_City.Description AS 名称,E_State.Description AS 省 FROM dbo.E_City LEFT JOIN dbo.E_State ON dbo.E_City.State = dbo.E_State.State WHERE E_City.City ='"+Txtjg.Text.Replace("'","")+"'",False)=="": 344 appcs.Msg("请选择正确的籍贯,再保存数据!","提示");return 345 for row in UltraGrid2.Rows: 346 row.Cells["Emp_ID"].Value=TxtEmp_ID.Text.Replace("'","") 347 for row in UltraGrid3.Rows: 348 row.Cells["Emp_ID"].Value=TxtEmp_ID.Text.Replace("'","") 349 for row in UltraGrid4.Rows: 350 row.Cells["Emp_ID"].Value=TxtEmp_ID.Text.Replace("'","") 351 for row in UltraGrid5.Rows: 352 row.Cells["Emp_ID"].Value=TxtEmp_ID.Text.Replace("'","") 353 for row in UltraGrid6.Rows: 354 row.Cells["Emp_ID"].Value=TxtEmp_ID.Text.Replace("'","") 355 ID=TxtEmp_ID.Text 356 if Stat=="删除": 357 Bind.RemoveCurrent() 358 SQQ="delete from Hr_Emergency_contact where Emp_ID='"+ID.Replace("'","")+"' \r\n " 359 SQQ=SQQ+"delete from Hr_by where Emp_ID='"+ID.Replace("'","")+"' \r\n " 360 SQQ=SQQ+"delete from Hr_Family_relations where Emp_ID='"+ID.Replace("'","")+"' \r\n " 361 SQQ=SQQ+"delete from Hr_Work_experience where Emp_ID='"+ID.Replace("'","")+"' \r\n " 362 SQQ=SQQ+"delete from Hr_Education where Emp_ID='"+ID.Replace("'","")+"' \r\n " 363 SQQ=SQQ+"delete from Hr_employees where Emp_ID='"+ID.Replace("'","")+"' \r\n " 364 if dataserver.Db_ExecuteNonquery(SQQ,True) == False : 365 appcs.Msg("处理失败","提示") 366 return 367 appcs.Msg("保存数据成功[员工资料维护]!","信息") 368 Sx() 369 SxBind() 370 UltraGrid1.Enabled=True 371 return 372 Bind.EndEdit() 373 UGrid.ProcessGrid(UltraGrid2) 374 UGrid.ProcessGrid(UltraGrid3) 375 UGrid.ProcessGrid(UltraGrid4) 376 UGrid.ProcessGrid(UltraGrid5) 377 UGrid.ProcessGrid(UltraGrid6) 378 UGrid.UpdateBind(Bind,TableCol.Tables[0]) 379 SQL= SQL_Code 380 Adpt = SqlDataAdapter(SQL +" where Emp_ID='"+ID.Replace("'","")+"'"+ "", dataserver.Conn) 381 Adpt.SelectCommand.CommandTimeout = 120 382 Adpt.SelectCommand.CommandType = CommandType.Text 383 try: 384 custCBr = SqlCommandBuilder(Adpt) 385 if Bind.Count>0:drow=UGrid.RowBind(Bind) 386 if Stat=="删除":Adpt.Update(Bind.DataSource) 387 else:Adpt.Update(drow) 388 Bind.DataSource.AcceptChanges() 389 Adpt.SelectCommand.Parameters.Clear() 390 # dataserver.close() 391 except: 392 Stat="" 393 Adpt.SelectCommand.Parameters.Clear() 394 appcs.Msg("保存数据失败[员工资料维护]!","信息") 395 Bind.DataSource.RejectChanges() 396 return 397 Adpt = SqlDataAdapter("select * from Hr_Education where Emp_ID='"+ID.Replace("'","")+"'", dataserver.Conn) 398 Adpt.SelectCommand.CommandTimeout = 120 399 Adpt.SelectCommand.CommandType = CommandType.Text 400 try: 401 custCBr = SqlCommandBuilder(Adpt) 402 Adpt.FillSchema(UltraGrid2.DataSource, SchemaType.Mapped, TableName) 403 Adpt.Update(UltraGrid2.DataSource, TableName) 404 UltraGrid2.DataSource.AcceptChanges() 405 Adpt.SelectCommand.Parameters.Clear() 406 # dataserver.close() 407 except: 408 Stat="" 409 Adpt.SelectCommand.Parameters.Clear() 410 appcs.Msg("保存数据失败[教育背景]!","信息") 411 return 412 Adpt = SqlDataAdapter("select * from Hr_Work_experience where Emp_ID='"+ID.Replace("'","")+"'", dataserver.Conn) 413 Adpt.SelectCommand.CommandTimeout = 120 414 Adpt.SelectCommand.CommandType = CommandType.Text 415 try: 416 custCBr = SqlCommandBuilder(Adpt) 417 Adpt.FillSchema(UltraGrid3.DataSource, SchemaType.Mapped, TableName) 418 Adpt.Update(UltraGrid3.DataSource, TableName) 419 UltraGrid3.DataSource.AcceptChanges() 420 Adpt.SelectCommand.Parameters.Clear() 421 # dataserver.close() 422 except: 423 Stat="" 424 Adpt.SelectCommand.Parameters.Clear() 425 appcs.Msg("保存数据失败[工作经历]!","信息") 426 return 427 Adpt = SqlDataAdapter("select * from Hr_Family_relations where Emp_ID='"+ID.Replace("'","")+"'", dataserver.Conn) 428 Adpt.SelectCommand.CommandTimeout = 120 429 Adpt.SelectCommand.CommandType = CommandType.Text 430 try: 431 custCBr = SqlCommandBuilder(Adpt) 432 Adpt.FillSchema(UltraGrid4.DataSource, SchemaType.Mapped, TableName) 433 Adpt.Update(UltraGrid4.DataSource, TableName) 434 UltraGrid4.DataSource.AcceptChanges() 435 Adpt.SelectCommand.Parameters.Clear() 436 # dataserver.close() 437 except: 438 Stat="" 439 Adpt.SelectCommand.Parameters.Clear() 440 appcs.Msg("保存数据失败[家庭关系]!","信息") 441 return 442 Adpt = SqlDataAdapter("select * from Hr_by where Emp_ID='"+ID.Replace("'","")+"'", dataserver.Conn) 443 Adpt.SelectCommand.CommandTimeout = 120 444 Adpt.SelectCommand.CommandType = CommandType.Text 445 try: 446 custCBr = SqlCommandBuilder(Adpt) 447 Adpt.FillSchema(UltraGrid5.DataSource, SchemaType.Mapped, TableName) 448 Adpt.Update(UltraGrid5.DataSource, TableName) 449 UltraGrid5.DataSource.AcceptChanges() 450 Adpt.SelectCommand.Parameters.Clear() 451 # dataserver.close() 452 except: 453 Stat="" 454 Adpt.SelectCommand.Parameters.Clear() 455 appcs.Msg("保存数据失败[承担人]!","信息") 456 return 457 Adpt = SqlDataAdapter("select * from Hr_Emergency_contact where Emp_ID='"+ID.Replace("'","")+"'", dataserver.Conn) 458 Adpt.SelectCommand.CommandTimeout = 120 459 Adpt.SelectCommand.CommandType = CommandType.Text 460 try: 461 custCBr = SqlCommandBuilder(Adpt) 462 Adpt.FillSchema(UltraGrid6.DataSource, SchemaType.Mapped, TableName) 463 Adpt.Update(UltraGrid6.DataSource, TableName) 464 UltraGrid6.DataSource.AcceptChanges() 465 Adpt.SelectCommand.Parameters.Clear() 466 dataserver.close() 467 except: 468 Stat="" 469 Adpt.SelectCommand.Parameters.Clear() 470 appcs.Msg("保存数据失败[紧急联系人]!","信息") 471 return 472 Stat="" 473 UltraGrid2.DisplayLayout.Bands[0].Columns["Stat_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit 474 UltraGrid2.DisplayLayout.Bands[0].Columns["End_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit 475 UltraGrid3.DisplayLayout.Bands[0].Columns["Stat_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit 476 UltraGrid3.DisplayLayout.Bands[0].Columns["End_Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit 477 UltraGrid2.DisplayLayout.Bands[0].Columns["Stat_Date"].MaskInput="yyyy/mm/dd" 478 UltraGrid2.DisplayLayout.Bands[0].Columns["End_Date"].MaskInput="yyyy/mm/dd" 479 UltraGrid3.DisplayLayout.Bands[0].Columns["Stat_Date"].MaskInput="yyyy/mm/dd" 480 UltraGrid3.DisplayLayout.Bands[0].Columns["End_Date"].MaskInput="yyyy/mm/dd" 481 appcs.Msg("保存数据成功[员工资料维护]!","信息") 482 Sx() 483 SxBind() 484 UltraGrid1.Enabled=True 485 elif e.Tool.Key.ToString()=="返回": 486 this.Close() 487 elif e.Tool.Key.ToString()=="第一个": 488 Bind.MoveFirst() 489 elif e.Tool.Key.ToString()=="上一个": 490 if Bind.Position>0: 491 Bind.MovePrevious() 492 elif e.Tool.Key.ToString()=="下一个": 493 if Bind.Position + 1 < Bind.Count: 494 Bind.MoveNext() 495 elif e.Tool.Key.ToString()=="最后一个": 496 Bind.MoveLast() 497 elif e.Tool.Key.ToString()=="附件": 498 if Bind.Count<1:return 499 rpter=Ds.Tables[0].Rows[Bind.Position]["RowPointer"].ToString() 500 if rpter=="":return 501 appcs.FileManage("\\RowFile\\" + rpter.ToString(), "\\RowFile\\" + rpter.ToString(), True, False) 502 elif e.Tool.Key.ToString()=="报表": 503 UltraGrid1.Text="员 工 资 料 信 息" 504 Rpt=appcs.GridReport(UltraGrid1,"员工资料信息") 505 Rpt.MdiParent=this.MdiParent 506 Rpt.Show() 507 UltraGrid1.Text="" 508 Stat=e.Tool.Key.ToString() 509 Tool.ToolClick+=Tool_ToolClick 510 511 #SQL=UltraGrid1.DisplayLayout.Bands[0].Columns[TxtStat.AccessibleDescription].Header.Tag.ToString() 512 #TxtStat.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'" + TxtStat.Text.Replace("'", "").Replace("*", "%") + "%'"),"数据") 513 514 SQL=Ds.Tables[0].Columns[Txtmz.AccessibleDescription].Namespace.ToString() 515 Txtmz.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 516 517 SQL=Ds.Tables[0].Columns[Txthkb.AccessibleDescription].Namespace.ToString() 518 Txthkb.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 519 520 SQL=Ds.Tables[0].Columns[Txtjy.AccessibleDescription].Namespace.ToString() 521 Txtjy.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 522 523 SQL=Ds.Tables[0].Columns[Txtxb.AccessibleDescription].Namespace.ToString() 524 Txtxb.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 525 526 SQL=Ds.Tables[0].Columns[TxtStat.AccessibleDescription].Namespace.ToString() 527 TxtStat.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 528 529 SQL=Ds.Tables[0].Columns[Txthyzz.AccessibleDescription].Namespace.ToString() 530 Txthyzz.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 531 532 SQL=Ds.Tables[0].Columns[Txtzzmm.AccessibleDescription].Namespace.ToString() 533 Txtzzmm.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 534 535 SQL=Ds.Tables[0].Columns[Txtzgxl.AccessibleDescription].Namespace.ToString() 536 Txtzgxl.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 537 538 SQL=Ds.Tables[0].Columns[Txtshbx.AccessibleDescription].Namespace.ToString() 539 Txtshbx.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 540 541 SQL=Ds.Tables[0].Columns[Txtlx.AccessibleDescription].Namespace.ToString() 542 Txtlx.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 543 544 SQL=Ds.Tables[0].Columns[Txtjtgj.AccessibleDescription].Namespace.ToString() 545 Txtjtgj.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 546 547 SQL=Ds.Tables[0].Columns[Txtyptj.AccessibleDescription].Namespace.ToString() 548 Txtyptj.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 549 550 SQL=Ds.Tables[0].Columns[Txtjkzk.AccessibleDescription].Namespace.ToString() 551 Txtjkzk.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 552 553 SQL=Ds.Tables[0].Columns[Txtzs.AccessibleDescription].Namespace.ToString() 554 Txtzs.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 555 556 SQL=Ds.Tables[0].Columns[Txtjg.AccessibleDescription].Namespace.ToString() 557 Txtjg.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 558 559 SQL=Ds.Tables[0].Columns[Txtbm.AccessibleDescription].Namespace.ToString() 560 Txtbm.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 561 562 SQL=Ds.Tables[0].Columns[Txtzw.AccessibleDescription].Namespace.ToString() 563 Txtzw.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 564 565 SQL=Ds.Tables[0].Columns[Txtxx.AccessibleDescription].Namespace.ToString() 566 Txtxx.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 567 568 SQL=Ds.Tables[0].Columns[Txtdnsp.AccessibleDescription].Namespace.ToString() 569 Txtdnsp.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 570 571 SQL=Ds.Tables[0].Columns[Txtwyyz.AccessibleDescription].Namespace.ToString() 572 Txtwyyz.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 573 574 SQL=Ds.Tables[0].Columns[Txtwysp.AccessibleDescription].Namespace.ToString() 575 Txtwysp.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 576 577 SQL=Ds.Tables[0].Columns[Txtzc.AccessibleDescription].Namespace.ToString() 578 Txtzc.DataSource = dataserver.Db_CreateDataSet(SQL.Replace("@Parameter", "'%'"),"数据") 579 580 def Txtjg_BeforeDropDown(sender,e): 581 SQL=Ds.Tables[0].Columns[Txtjg.AccessibleDescription].Namespace.ToString() 582 SQL=SQL.Replace("@Parameter", "'" + Txtjg.Text.Replace("'", "").Replace("*", "%") + "%'") 583 DD = dataserver.Db_CreateDataSet(SQL,"数据") 584 Txtjg.DataSource=DD 585 Txtjg.BeforeDropDown+=Txtjg_BeforeDropDown 586 587 def Txtzy_BeforeDropDown(sender,e): 588 SQL=Ds.Tables[0].Columns[Txtzy.AccessibleDescription].Namespace.ToString() 589 SQL=SQL.Replace("@Parameter", "'" + Txtzy.Text.Replace("'", "").Replace("*", "%") + "%'") 590 DD = dataserver.Db_CreateDataSet(SQL,"数据") 591 Txtzy.DataSource=DD 592 Txtzy.BeforeDropDown+=Txtzy_BeforeDropDown 593 594 def Txtbm_BeforeDropDown(sender,e): 595 SQL=Ds.Tables[0].Columns[Txtbm.AccessibleDescription].Namespace.ToString() 596 SQL=SQL.Replace("@Parameter", "'" + Txtbm.Text.Replace("'", "").Replace("*", "%") + "%'") 597 DD = dataserver.Db_CreateDataSet(SQL,"数据") 598 Txtbm.DataSource=DD 599 Txtbm.BeforeDropDown+=Txtbm_BeforeDropDown 600 601 def Txtzw_BeforeDropDown(sender,e): 602 SQL=Ds.Tables[0].Columns[Txtzw.AccessibleDescription].Namespace.ToString() 603 SQL=SQL.Replace("@Parameter", "'" + Txtzw.Text.Replace("'", "").Replace("*", "%") + "%'") 604 DD = dataserver.Db_CreateDataSet(SQL,"数据") 605 Txtzw.DataSource=DD 606 Txtzw.BeforeDropDown+=Txtzw_BeforeDropDown 607 608 def TxtEmp_ID_EditorButtonClick(sender,e): 609 if e.Button.Key.ToString()=="?": 610 if TxtEmp_ID.ReadOnly==False: 611 TxtEmp_ID.Value=dataserver.Db_Cell("exec AutoSN N'员工编号','%Y%M%D%03X','SN','SN','','0',' Stat=''员工编号'''",True) 612 TxtEmp_ID.EditorButtonClick+=TxtEmp_ID_EditorButtonClick 613 614 def Txtjg_Changed(sender,e): 615 Txtdqs.Text=dataserver.Db_Cell("select top 1 Description from E_City where City='"+Txtjg.Text.Replace("'","")+"'",False) 616 Txtjg.TextChanged+=Txtjg_Changed
人事业务提示信息如下:
人事数据分析(维护和度量值为根据人事系统重要字段提供的分析依据)如下:
IvanDesign-快速开发平台
下载地址:www.cnblogs.com/DesignIvan/archive/2012/06/12/DesignSetup.html