/// <summary> /// 邦定部门列表 /// </summary> private void BindTreeView() { tvOU.ClearAll(); DataTable dt = null; Infragistics.WebUI.UltraWebNavigator.Node tn1; Infragistics.WebUI.UltraWebNavigator.Node tn2; //一层 dt = new CodeGroupQuery().GetAllCodeGroup(); tn1 = new Infragistics.WebUI.UltraWebNavigator.Node(); tn1.Text = "系统代码组"; tn1.DataKey = "0"; tn1.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.False; for (int i = 0; i < dt.Rows.Count; i++) { tn2 = new Infragistics.WebUI.UltraWebNavigator.Node(); tn2.Text = dt.Rows[i]["CodeGroupName"].ToString(); tn2.DataKey = dt.Rows[i]["CodeGroupID"].ToString(); tn2.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True; tn2.TargetUrl = "javascript:window.parent.frames['Code'].location.href = 'Code.aspx?ID=" + tn2.DataKey.ToString() + "';"; tn1.Nodes.Add(tn2); } tvOU.Nodes.Add(tn1); tvOU.ExpandAll(); }
/// <summary> /// 检测数据 /// </summary> /// <returns></returns> private bool CheckData() { if (string.IsNullOrEmpty(txtCodeGroupName.Text.Trim())) { hidInfo.Value = "请输入代码组名称!"; return(false); } if (string.IsNullOrEmpty(txtCodeGroupKey.Text.Trim())) { hidInfo.Value = "请输入代码!"; return(false); } if (CodeGroupQuery.CheckCodeGroupName(txtCodeGroupName.Text.Trim(), this.CodeGroupID, this.CurOperation)) { hidInfo.Value = "代码组名称已经存在,请重新输入名称!"; return(false); } if (CodeGroupQuery.CheckCodeGroupKey(txtCodeGroupKey.Text.Trim(), this.CodeGroupID, this.CurOperation)) { hidInfo.Value = "代码已经存在,请重新输入代码!"; return(false); } return(true); }