Esempio n. 1
0
        /// <summary>
        /// 功能节点焦点改变事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tlFunc_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
        {
            if (e.Node != null)
            {
                #region 功能管理
                TreeListNode node = e.Node;
                object       Id   = e.Node.GetValue("Id");
                model = funcManage.GetOneFuncionById((Guid)Id);
                if (model == null)
                {
                    return;
                }
                txtID.EditValue    = model.Id;
                txtSortCode.Text   = model.SortCode;
                txtName.Text       = model.FuncName;
                txtFuncHandle.Text = funcManage.GetFuncHandleText(model.FuncHandle);
                txtFuncHandle.Tag  = model.FuncHandle;
                tlPID.EditValue    = model.ParentId;
                if (model.ParentId == Guid.Empty || model.ParentId == null)
                {
                    sbtnSave.Enabled = false;
                }
                else
                {
                    sbtnSave.Enabled = true;
                }
                #endregion

                #region 功能角色
                gcDataRole.DataSource = funcManage.GetRoleListByFuncId(clsPublic.GetObjGUID(Id));
                #endregion
            }
        }
        public bool AddNew(Models.ACL_Function model)
        {
            string sqlText = @"INSERT INTO [dbo].[ACL_Function]
                           ([Id]
                           ,[FuncName]
                           ,[FuncHandle]
                           ,[SystemId]
                           ,[SortCode]
                           ,[ParentId]
                           ,[CreateTime]
                           ,[IsRemoved])
                        values
                           (@Id
                           ,@FuncName
                           ,@FuncHandle
                           ,@SystemId
                           ,@SortCode
                           ,@ParentId
                           ,@CreateTime
                           ,@IsRemoved)";

            SqlParameter s1 = new SqlParameter("@Id", model.Id);
            SqlParameter s2 = new SqlParameter("@FuncName", model.FuncName);
            SqlParameter s3 = new SqlParameter("@FuncHandle", model.FuncHandle);
            SqlParameter s4 = new SqlParameter("@SystemId", model.SystemId);
            SqlParameter s5 = new SqlParameter("@SortCode", model.SortCode);
            SqlParameter s6 = new SqlParameter("@ParentId", model.ParentId);
            SqlParameter s7 = new SqlParameter("@CreateTime", model.CreateTime);
            SqlParameter s8 = new SqlParameter("@IsRemoved", model.IsRemoved);

            SqlParameter[] cmdPara = new SqlParameter[] { s1, s2, s3, s4, s5, s6, s7, s8 };
            return(Models.SqlHelper.ExecuteNoQuery(sqlText, cmdPara) > 0 ? true : false);
        }
Esempio n. 3
0
 /// <summary>
 /// 新增功能
 /// </summary>
 public override void AddNew()
 {
     txtID.Text         = "新ID";
     txtSortCode.Text   = "";
     txtName.Text       = "";
     txtFuncHandle.Text = "";
     txtFuncHandle.Tag  = 0;
     tlPID.EditValue    = null;
     sbtnSave.Enabled   = true;
     model = new Models.ACL_Function();
 }
        public bool Modify(Models.ACL_Function model)
        {
            string sqlText = @"UPDATE [dbo].[ACL_Function]
                               SET [FuncName] = @FuncName
                                  ,[FuncHandle] = @FuncHandle
                                  ,[SystemId] = @SystemId
                                  ,[SortCode] = @SortCode
                                  ,[ParentId] = @ParentId
                                  ,[CreateTime] = @CreateTime
                                  ,[IsRemoved] = @IsRemoved
                             WHERE [Id] = @Id";

            SqlParameter s1 = new SqlParameter("@Id", model.Id);
            SqlParameter s2 = new SqlParameter("@FuncName", model.FuncName);
            SqlParameter s3 = new SqlParameter("@FuncHandle", model.FuncHandle);
            SqlParameter s4 = new SqlParameter("@SystemId", model.SystemId);
            SqlParameter s5 = new SqlParameter("@SortCode", model.SortCode);
            SqlParameter s6 = new SqlParameter("@ParentId", model.ParentId);
            SqlParameter s7 = new SqlParameter("@CreateTime", model.CreateTime);
            SqlParameter s8 = new SqlParameter("@IsRemoved", model.IsRemoved);

            SqlParameter[] cmdPara = new SqlParameter[] { s1, s2, s3, s4, s5, s6, s7, s8 };
            return(Models.SqlHelper.ExecuteNoQuery(sqlText, cmdPara) > 0 ? true : false);
        }
 /// <summary>
 /// 功能修改方法
 /// </summary>
 /// <param name="model">实体</param>
 /// <returns></returns>
 public bool Modify(Models.ACL_Function model)
 {
     return(Sev.Modify(model));
 }
 /// <summary>
 /// 功能新增方法
 /// </summary>
 /// <param name="model">实体</param>
 /// <returns></returns>
 public bool AddNew(Models.ACL_Function model)
 {
     return(Sev.AddNew(model));
 }