Esempio n. 1
0
        /// <summary>
        /// 验证数据
        /// </summary>
        private bool CheckData()
        {
            if (!string.IsNullOrEmpty(txtFName.Text))
            {
                if (CommonHelp.CheckString(txtFName.Text.Trim()))
                {
                    hidInfo.Value = "功能名称中不能包含特殊字符!";
                    txtFName.Focus();
                    return(false);
                }
            }
            else
            {
                hidInfo.Value = "功能名称不能为空!";
                txtFName.Focus();
                return(false);
            }
            if (MenuFunctionQuery.IsExisitName(this.MenuID, txtFName.Text.Trim()))
            {
                hidInfo.Value = "此功能名称已经存在!";
                txtFName.Focus();
                return(false);
            }

            if (!string.IsNullOrEmpty(txtFCode.Text))
            {
                if (CommonHelp.CheckString(txtFCode.Text.Trim()))
                {
                    hidInfo.Value = "代码名称中不能包含特殊字符!";
                    txtFCode.Focus();
                    return(false);
                }
            }
            else
            {
                hidInfo.Value = "代码名称不能为空!";
                txtFCode.Focus();
                return(false);
            }


            if (MenuFunctionQuery.IsExisitCode(this.MenuID, txtFCode.Text.Trim()))
            {
                hidInfo.Value = "此代码名称已经存在!";
                txtFCode.Focus();
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        /// <summary>
        /// 新增
        /// </summary>
        private void Save()
        {
            MenuFunctionEntity entity = new MenuFunctionEntity();

            entity.FCode     = txtFCode.Text.Trim();
            entity.FName     = txtFName.Text.Trim();
            entity.IsDeleted = false;
            entity.MenuID    = this.MenuID;
            if (rdoIsShow.SelectedValue == "0")
            {
                entity.IsShow = false;
            }
            else
            {
                entity.IsShow = true;
            }
            entity.SortIndex = MenuFunctionQuery.MaxSortIndex(this.MenuID);
            new MenuFunctionRule().Add(entity);
        }
Esempio n. 3
0
        /// <summary>
        /// 获取数据
        /// </summary>
        private DataTable GetData()
        {
            DataTable dt = new MenuFunctionQuery().GetMenuFunctionNow(this.MenuID);

            return(dt);
        }
Esempio n. 4
0
        /// <summary>
        /// 邦定列表
        /// </summary>
        private void BindTreeView()
        {
            //if (drpOUList.SelectedIndex == 0)
            //{
            //    return;
            //}

            DataTable dt1 = null;
            DataTable dt2 = null;
            DataTable dt3 = null;
            DataTable dt4 = null;

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


            tvRight.ClearAll();

            //dt1 = new MenuQuery().GetMenuAll2(0);
            dt1 = new MenuQuery().GetMenuAll(0, CommonEnum.MenuType.Inner);
            for (int i = 0; i < dt1.Rows.Count; i++)
            {
                tn1          = new Infragistics.WebUI.UltraWebNavigator.Node();
                tn1.Text     = dt1.Rows[i]["MenuName"].ToString();
                tn1.DataKey  = dt1.Rows[i]["MenuID"].ToString();
                tn1.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True;

                //dt2 = new MenuQuery().GetMenuAll2(NDConvert.ToInt64(tn1.DataKey.ToString()));
                dt2 = new MenuQuery().GetMenuAll(NDConvert.ToInt64(tn1.DataKey.ToString()), CommonEnum.MenuType.Inner);
                for (int j = 0; j < dt2.Rows.Count; j++)
                {
                    tn2          = new Infragistics.WebUI.UltraWebNavigator.Node();
                    tn2.Text     = dt2.Rows[j]["MenuName"].ToString();
                    tn2.DataKey  = dt2.Rows[j]["MenuID"].ToString();
                    tn2.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True;
                    tn1.Nodes.Add(tn2);

                    //dt3 = new MenuQuery().GetMenuAll2(NDConvert.ToInt64(tn2.DataKey.ToString()));
                    dt3 = new MenuQuery().GetMenuAll(NDConvert.ToInt64(tn2.DataKey.ToString()), CommonEnum.MenuType.Inner);
                    if (dt3.Rows.Count > 0)
                    {
                        for (int k = 0; k < dt3.Rows.Count; k++)
                        {
                            tn3          = new Infragistics.WebUI.UltraWebNavigator.Node();
                            tn3.Text     = dt3.Rows[k]["MenuName"].ToString();
                            tn3.DataKey  = dt3.Rows[k]["MenuID"].ToString();
                            tn3.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True;
                            tn2.Nodes.Add(tn3);

                            dt4 = new MenuFunctionQuery().GetMenuFunction(NDConvert.ToInt64(tn3.DataKey.ToString()));
                            for (int m = 0; m < dt4.Rows.Count; m++)
                            {
                                tn4          = new Infragistics.WebUI.UltraWebNavigator.Node();
                                tn4.Text     = dt4.Rows[m]["FName"].ToString();
                                tn4.DataKey  = dt4.Rows[m]["FID"].ToString();
                                tn4.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True;
                                tn3.Nodes.Add(tn4);
                            }
                        }
                    }
                    else
                    {
                        dt4 = new MenuFunctionQuery().GetMenuFunction(NDConvert.ToInt64(tn2.DataKey.ToString()));
                        for (int m = 0; m < dt4.Rows.Count; m++)
                        {
                            tn4          = new Infragistics.WebUI.UltraWebNavigator.Node();
                            tn4.Text     = dt4.Rows[m]["FName"].ToString();
                            tn4.DataKey  = dt4.Rows[m]["FID"].ToString();
                            tn4.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True;
                            tn2.Nodes.Add(tn4);
                        }
                    }
                }
                tvRight.Nodes.Add(tn1);
            }
            tvRight.ExpandAll();
        }