Пример #1
0
        public static bool Delete(RightFunction rightFunction)
        {
            using (var conn = new SqlConnection(Conn.getConn()))
            {
                if (conn.State != ConnectionState.Open)
                {
                    conn.Open();
                }

                using (var trans = conn.BeginTransaction())
                {
                    //1、删除功能信息
                    var result = Delete(rightFunction, conn, trans);
                    if (!result)
                    {
                        trans.Rollback();
                        return(false);
                    }
                    //2、删除当前功能对应的功能分组信息
                    RightLkFunctionGroupDal.DeleteByFunctionSysid(new RightLkFunctionGroup {
                        FunctionSysid = rightFunction.Sysid
                    }, conn, trans);

                    //3、删除当前功能对应的功能命令信息
                    RightLkFunctionCommandDal.DeleteByFunctionSysid(new RightLkFunctionCommand {
                        FunctionSysid = rightFunction.Sysid
                    }, conn, trans);

                    //4、删除当前功能对应的权限分配信息
                    RightDal.DeleteByFunctionSysid(new Right {
                        FunctionSysid = rightFunction.Sysid
                    }, conn, trans);

                    trans.Commit();
                }

                if (conn.State != ConnectionState.Closed)
                {
                    conn.Close();
                }
            }

            return(true);
        }
Пример #2
0
 public static List <RightLkFunctionCommand> QueryRightLkFunctionCommand(QueryCondition queryCondition)
 {
     return(RightLkFunctionCommandDal.QueryRightLkFunctionCommand(queryCondition));
 }
Пример #3
0
 public static bool Save(List <RightLkFunctionCommand> insertList, List <RightLkFunctionCommand> deleteList)
 {
     return(RightLkFunctionCommandDal.Save(insertList, deleteList));
 }