; ; @Temp = ShowSearchBox("DepartmentSearch","INFOMATION",tbNo.CValue); if(@Temp != StringEmpty()) { tbNo.CValue = @Temp; UpdateForm(false, ""); if(Search("SearchDepartmentWithNo", tbNo.CValue)) { ChangeMode("View"); } } UpdateForm(false, "cbSubjection"); Search("SearchAllDepartment"); UpdateForm(true, "cbSubjection"); if(Search("SearchDepartmentFirst", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchDepartmentPrevious", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchDepartmentNext", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchDepartmentLast", tbNo.CValue)) { ChangeMode("View"); } ; ChangeMode("Search"); ChangeMode("Modify"); if(Search("SearchSubDepartment", tbNo.CValue)) { if(MessageBox("该部门有下属部门,若删除此部门资料其所有下属部门的资料均会被删除,确定要删除此部门资料吗?",@Title,MB_YESNO)==DialogResult("YES")) { Delete(); ChangeMode("Search"); } } else { Delete(); ChangeMode("Search"); } PrintReport(); ; ; ; ; ; if(toolBar.ExpandForm==true) { pnRight.Visible=true; } else { pnRight.Visible=false; } if( !Equals(DepartTree.SelectNodeNo, tbNo.CValue) ) { ChangeMode("Search"); tbNo.CValue = DepartTree.SelectNodeNo; ActiveControlEvent("tbNo", "Enter"); } if(DepartTree.MenuItemText == "新增下属部门") { ChangeMode("Search"); } else if(DepartTree.MenuItemText == "删除") { ShowMessageBox("确定要删除当前记录?","YesNo","Question"); if(Search("SearchSubDepartment", DepartTree.SelectNodeNo)) { if(MessageBox("该部门有下属部门,若删除此部门资料其所有下属部门的资料均会被删除,确定要删除此部门资料吗?",@Title,MB_YESNO)==DialogResult("YES")) { Delete(); ChangeMode("Search"); } } else { Delete(); ChangeMode("Search"); } } else if(DepartTree.MenuItemText == "查看资料") { ChangeMode("Search"); tbNo.CValue = DepartTree.SelectNodeNo; ActiveControlEvent("tbNo", "Enter"); } ;
Empty(); NewInstance(); tbNo.ReadOnly=false; txtName.ReadOnly=true; txtComment.ReadOnly=true; cbSubjection.Enabled=false; toolBar.EnableSubmit=false; toolBar.EnableModify=false; toolBar.EnableDelete=false; #Department.CreateDate_Department=DBNull(); #Department.LastModDate_Department=DBNull(); #Department.LastModUser_Department=DBNull(); Search("SearchTree"); UpdateForm(true, ""); tbNo.Focus(); @Status=0; Empty(); NewInstance(); tbNo.ReadOnly=true; txtName.ReadOnly=false; txtComment.ReadOnly=false; cbSubjection.Enabled=true; toolBar.EnableSubmit=GetRight(@Title,"新增"); toolBar.EnableModify=false; toolBar.EnableDelete=false; #Department.No_Department = tbNo.CValue; #Department.SubjectionID_Department=DBNull(); #Department.ID_Department=NewGuid(); #Department.CreateName=GetCurrentUser(); #Department.ID_Creator=GetLoginUserID(); #Department.CreateDate_Department=DateTimeNow(); #Department.LastModDate_Department=DBNull(); #Department.LastModUser_Department=DBNull(); #Department.SuspendDate_Department=DBNull(); Search("SearchTree"); UpdateForm(true, ""); DepartTree.SetCurrentNode("("+tbNo.CValue+")"+txtName.CValue); txtName.Focus(); @Status=1; tbNo.ReadOnly=false; txtName.ReadOnly=true; txtComment.ReadOnly=true; cbSubjection.Enabled=false; toolBar.EnableSubmit=false; toolBar.EnableModify=GetRight(@Title,"修改"); toolBar.EnableDelete=GetRight(@Title,"删除"); Search("SearchTree"); UpdateForm(true, ""); DepartTree.SetCurrentNode("("+tbNo.CValue+")"+txtName.CValue); @Status=2; tbNo.ReadOnly=true; txtName.ReadOnly=false; txtComment.ReadOnly=false; cbSubjection.Enabled=false; toolBar.EnableSubmit=GetRight(@Title,"新增"); toolBar.EnableModify=false; toolBar.EnableDelete=GetRight(@Title,"删除"); #Department.LastModUser_DepartmentName=GetCurrentUser(); #Department.LastModDate_Department=DateTimeNow(); #Department.LastModUser_Department=GetLoginUserID(); Search("SearchTree"); UpdateForm(true, ""); DepartTree.SetCurrentNode("("+tbNo.CValue+")"+txtName.CValue); txtName.Focus(); @Status=3;