; ; @Temp = ShowSearchBox("AttendanceRuleSearch","INFOMATION",tbNo.CValue); if(@Temp != StringEmpty()) { tbNo.CValue = @Temp; UpdateForm(false, ""); if(Search("SearchAttendanceRuleWithNo",tbNo.CValue)) { ChangeMode("View"); } } @SetFlag=1; ShowSearchBox("EmployeeSearch","INFOMATION",#AttendanceRuleEmployee.No_Employee); @SetFlag=0; if(Search("SearchAttendanceRuleFirst")) { ChangeMode("View"); } if(Search("SearchAttendanceRulePrevious", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchAttendanceRuleNext", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchAttendanceRuleLast")) { ChangeMode("View"); } ; ChangeMode("Search"); ChangeMode("Modify"); Delete(); ChangeMode("Search"); PrintReport(); ; ; ; ; ; ; if(@SetFlag==0) { return; } if(Search("GetEmployeeNameByNo",#AttendanceRuleEmployee.No_Employee)) { #AttendanceRuleEmployee.Name_Employee=#Employee.Name_Employee; #AttendanceRuleEmployee.ID_Employee=#Employee.ID_Employee; if(!Equals(#Employee.SuspendDate_Employee,DBNull())) MessageBox("该员工已停用!",@Title); } else { MessageBox("该员工不存在!",@Title); #AttendanceRuleEmployee.Name_Employee=""; #AttendanceRuleEmployee.ID_Employee=GuidEmpty(); @temp = ShowSearchBox("InputEmployeeSearch","INFOMATION",#AttendanceRuleEmployee.No_Employee); if(@temp != "") { ResumeColumnEvent("#AttendanceRuleEmployee.No_Employee"); #AttendanceRuleEmployee.No_Employee = @temp; ClearColumnEvent(); } }
Empty(); NewInstance(); tbNo.ReadOnly=false; txtName.ReadOnly=true; dtpOnStuffOne.Enabled=false; dtpOffStuffOne.Enabled=false; dtpOnStuffTwo.Enabled=false; dtpOffStuffTwo.Enabled=false; itbArriveLate.ReadOnly=true; itbLeaveEarly.ReadOnly=true; txtComment.ReadOnly=true; dgEmployee.ReadOnly=true; toolBar.EnableSubmit=false; toolBar.EnableModify=false; toolBar.EnableDelete=false; #AttendanceRule.ID_Creator=DBNull(); #AttendanceRule.Name_Creator=DBNull(); #AttendanceRule.CreateDate_AttendanceRule=DBNull(); #AttendanceRule.LastModUser_AttendanceRule=DBNull(); #AttendanceRule.LastModUser=DBNull(); #AttendanceRule.LastModDate_AttendanceRule=DBNull(); UpdateForm(true, ""); tbNo.Focus(); @Status=0; Empty(); NewInstance(); tbNo.ReadOnly=true; txtName.ReadOnly=false; dtpOnStuffOne.Enabled=true; dtpOffStuffOne.Enabled=true; dtpOnStuffTwo.Enabled=true; dtpOffStuffTwo.Enabled=true; itbArriveLate.ReadOnly=false; itbLeaveEarly.ReadOnly=false; txtComment.ReadOnly=false; dgEmployee.ReadOnly=false; toolBar.EnableSubmit=true; toolBar.EnableModify=false; toolBar.EnableDelete=false; #AttendanceRule.ID_AttendanceRule = NewGuid(); #AttendanceRule.No_AttendanceRule = tbNo.CValue; #AttendanceRule.ID_Creator=GetLoginUserID(); #AttendanceRule.CreateDate_AttendanceRule=DateTimeNow(); #AttendanceRule.Name_Creator=GetCurrentUser(); #AttendanceRule.LastModUser_AttendanceRule=DBNull(); #AttendanceRule.LastModUser=DBNull(); #AttendanceRule.LastModDate_AttendanceRule=DBNull(); UpdateForm(true, ""); tbNo.Focus(); @Status=1; tbNo.ReadOnly=false; txtName.ReadOnly=true; dtpOnStuffOne.Enabled=false; dtpOffStuffOne.Enabled=false; dtpOnStuffTwo.Enabled=false; dtpOffStuffTwo.Enabled=false; itbArriveLate.ReadOnly=true; itbLeaveEarly.ReadOnly=true; txtComment.ReadOnly=true; dgEmployee.ReadOnly=true; toolBar.EnableSubmit=false; toolBar.EnableModify = GetRight(@Title,"修改"); toolBar.EnableDelete = GetRight(@Title,"删除"); UpdateForm(true, ""); tbNo.Focus(); @Status=2; tbNo.ReadOnly=true; txtName.ReadOnly=false; dtpOnStuffOne.Enabled=true; dtpOffStuffOne.Enabled=true; dtpOnStuffTwo.Enabled=true; dtpOffStuffTwo.Enabled=true; itbArriveLate.ReadOnly=false; itbLeaveEarly.ReadOnly=false; txtComment.ReadOnly=false; dgEmployee.ReadOnly=false; toolBar.EnableSubmit=true; toolBar.EnableModify=false; toolBar.EnableDelete=false; #AttendanceRule.LastModUser_AttendanceRule = GetLoginUserID(); #AttendanceRule.LastModUser = GetCurrentUser(); #AttendanceRule.LastModDate_AttendanceRule = DateTimeNow(); UpdateForm(true, ""); tbNo.Focus(); @Status=3; =0;@i=@i-1) { SetPosition("#AttendanceRuleEmployee", @i); if(Equals(#AttendanceRuleEmployee.ID_AttendanceRuleEmployee,GuidEmpty())) #AttendanceRuleEmployee.ID_AttendanceRuleEmployee = NewGuid(); #AttendanceRuleEmployee.ID_AttendanceRule = #AttendanceRule.ID_AttendanceRule; if(Equals(#AttendanceRuleEmployee.ID_Employee, GuidEmpty())) { dgEmployee.CurrentRowIndex=@i; MessageBox("该员工不存在!",@Title); ResumeLayout(); return; } Register_Set("1",#AttendanceRuleEmployee.ID_Employee); for(@j=@i+1;@j<=RowCount("#AttendanceRuleEmployee")-1;@j=@j+1) { SetPosition("#AttendanceRuleEmployee",@j); if(Equals(Register_Get("1"),#AttendanceRuleEmployee.ID_Employee)) { dgEmployee.CurrentRowIndex=@j; MessageBox("员工列表中已存在该员工!",@Title); Register_Remove("1"); ResumeLayout(); return; } } } Register_Remove("1"); ResumeLayout(); if(@Status==1) { New(); } if(@Status == 3) { #AttendanceRule.LastModDate_AttendanceRule=DateTimeNow(); Update(); } ChangeMode("View"); ]]>