Beispiel #1
0
        private void BindOUList(long OUID)
        {
            drpChildList.Items.Clear();
            DataTable dt = new OUQuery().GetOU(OUID);

            NDHelperWebControl.LoadDropDownList(drpChildList, dt, "OUName", "OUID", new ListItem("请选择", "0"));
            BindPerson(0, 1);
        }
Beispiel #2
0
        /// <summary>
        /// 邦定父级部门
        /// </summary>
        private void BindOUList()
        {
            DataTable dt = new OUQuery().GetParentOU(0);

            NDHelperWebControl.LoadDropDownList(drpOUList, dt, "OUName", "OUID", new ListItem("请选择", "0"));

            //drpOUList.SelectedIndex = 1;
            //drpOUList.Enabled = false;
        }
        /// <summary>
        /// 邦定父级部门
        /// </summary>
        private void BindOUList()
        {
            DataTable dt = new OUQuery().GetOU();

            NDHelperWebControl.LoadDropDownList(drpOUList, dt, "OUName", "OUID", new ListItem("请选择", "0"));

            CommonHelp.BinddrpCurValue(drpOUList, this.OUID.ToString());
            drpOUList.Enabled = false;
        }
Beispiel #4
0
        /// <summary>
        /// 更新
        /// </summary>
        private void Update()
        {
            OUEntity entity = new OUEntity(this.OUID);

            entity.OUParentID  = NDConvert.ToInt64(drpOUList.SelectedValue);
            entity.OUType      = 1;
            entity.OUName      = txtOUName.Text.Trim();
            entity.Description = txtDescriptipn.Text.Trim();
            if (entity.SortIndex == 0)
            {
                entity.SortIndex = OUQuery.GetMaxSortIndex();
            }
            entity.UpdateDate = DateTime.Now;
            new OURule().Update(entity);
        }
Beispiel #5
0
        /// <summary>
        /// 保存
        /// </summary>
        private void Save()
        {
            OUEntity entity = new OUEntity();

            entity.OUName = txtOUName.Text.Trim();
            entity.OUType = 1;
            if (this.OUID != -1)
            {
                entity.OUParentID = this.OUID;
            }
            else
            {
                entity.OUParentID = 0;
            }
            entity.Description = txtDescriptipn.Text.Trim();
            entity.SortIndex   = OUQuery.GetMaxSortIndex();
            entity.AddDate     = DateTime.Now;
            entity.IsDeleted   = false;
            new OURule().Add(entity);
        }
        /// <summary>
        /// 绑定部门
        /// </summary>
        private void BindOU()
        {
            DataTable dt = new OUQuery().GetOU();

            NDHelperWebControl.LoadDropDownList(drpOU, dt, "OUName", "OUID", new ListItem("请选择", "0"));
        }
Beispiel #7
0
        /// <summary>
        /// 邦定部门列表
        /// </summary>
        private void BindTreeView()
        {
            tvOU.ClearAll();
            DataTable dt  = null;
            DataTable dt1 = null;
            DataTable dt2 = null;
            DataTable dt3 = null;

            Infragistics.WebUI.UltraWebNavigator.Node tn1;
            Infragistics.WebUI.UltraWebNavigator.Node tn2;
            Infragistics.WebUI.UltraWebNavigator.Node tn3;
            Infragistics.WebUI.UltraWebNavigator.Node tn4;

            //一层
            dt = new OUQuery().GetOU(0);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                tn1          = new Infragistics.WebUI.UltraWebNavigator.Node();
                tn1.Text     = dt.Rows[i]["OUName"].ToString();
                tn1.DataKey  = dt.Rows[i]["OUID"].ToString();
                tn1.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True;

                if (new OUQuery().IsOUParent(NDConvert.ToInt64(tn1.DataKey)) == false)
                {
                    tn1.TargetUrl = "javascript:window.parent.frames['PersonManager'].location.href = 'UserManager.aspx?OUID=" + tn1.DataKey.ToString() + "';";
                }

                //二层
                dt1 = new OUQuery().GetOU(NDConvert.ToInt64(tn1.DataKey));
                for (int j = 0; j < dt1.Rows.Count; j++)
                {
                    tn2           = new Infragistics.WebUI.UltraWebNavigator.Node();
                    tn2.Text      = dt1.Rows[j]["OUName"].ToString();
                    tn2.DataKey   = dt1.Rows[j]["OUID"].ToString();
                    tn2.CheckBox  = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True;
                    tn2.TargetUrl = "javascript:window.parent.frames['PersonManager'].location.href = 'UserManager.aspx?OUID=" + tn2.DataKey.ToString() + "';";
                    tn1.Nodes.Add(tn2);

                    //三层
                    dt2 = new OUQuery().GetOU(NDConvert.ToInt64(tn2.DataKey));
                    for (int m = 0; m < dt2.Rows.Count; m++)
                    {
                        tn3           = new Infragistics.WebUI.UltraWebNavigator.Node();
                        tn3.Text      = dt2.Rows[m]["OUName"].ToString();
                        tn3.DataKey   = dt2.Rows[m]["OUID"].ToString();
                        tn3.CheckBox  = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True;
                        tn3.TargetUrl = "javascript:window.parent.frames['PersonManager'].location.href = 'UserManager.aspx?OUID=" + tn3.DataKey.ToString() + "';";
                        tn2.Nodes.Add(tn3);

                        //四层
                        dt3 = new OUQuery().GetOU(NDConvert.ToInt64(tn3.DataKey));
                        for (int n = 0; n < dt3.Rows.Count; n++)
                        {
                            tn4           = new Infragistics.WebUI.UltraWebNavigator.Node();
                            tn4.Text      = dt3.Rows[n]["OUName"].ToString();
                            tn4.DataKey   = dt3.Rows[n]["OUID"].ToString();
                            tn4.CheckBox  = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True;
                            tn4.TargetUrl = "javascript:window.parent.frames['PersonManager'].location.href = 'UserManager.aspx?OUID=" + tn4.DataKey.ToString() + "';";
                            tn3.Nodes.Add(tn4);
                        }
                    }
                }
                tvOU.Nodes.Add(tn1);
            }
            tvOU.ExpandAll();
        }