Example #1
0
        /// <summary>
        /// 获取指定权限的详细信息
        /// </summary>
        /// <param name="actionid"></param>
        public ActionBLL(int actionid)
            : base()
        {
            _actionid = -1;
            ActionDAL dal = new ActionDAL(connectionString);

            RADinfo_MIS_COST.Model.Action model = dal.GetDetails(actionid);
            if (model != null)
            {
                _actionid       = model.ActionId;
                _actionname     = model.ActionName;
                _actionstr      = model.ActionStr;
                _actioncolumnid = model.ActionColumnid;
                _link           = model.Link;
            }
        }
Example #2
0
        /// <summary>
        /// 获取所有的权限
        /// </summary>
        /// <returns></returns>
        public ArrayList GetActions()
        {
            ArrayList actions = new ArrayList();

            using (SqlDataReader reader = RunProcedure("sp_GetAllAction", null))
            {
                while (reader.Read())
                {
                    RADinfo_MIS_COST.Model.Action model = new RADinfo_MIS_COST.Model.Action();
                    model.ActionId   = Convert.ToInt32(reader["actionid"]);
                    model.ActionName = Convert.ToString(reader["actionname"]);
                    actions.Add(model);
                }
            }
            return(actions);
        }
Example #3
0
        /// <summary>
        /// 获取指定权限分栏外的所有权限
        /// </summary>
        /// <param name="actioncolumnid"></param>
        /// <returns></returns>
        public ArrayList GetExcludeActions(int actioncolumnid)
        {
            ArrayList actions = new ArrayList();

            SqlParameter[] parameters =
            { new SqlParameter("@actioncolumnid", SqlDbType.Int) };
            parameters[0].Value = actioncolumnid;
            using (SqlDataReader reader =
                       RunProcedure("sp_GetExcludeAction_columnid", parameters))
            {
                while (reader.Read())
                {
                    RADinfo_MIS_COST.Model.Action model = new RADinfo_MIS_COST.Model.Action();
                    model.ActionId   = Convert.ToInt32(reader["actionid"]);
                    model.ActionName = Convert.ToString(reader["actionname"]);
                    actions.Add(model);
                }
            }
            return(actions);
        }
Example #4
0
        /// <summary>
        /// 获取指定权限的详细信息
        /// </summary>
        /// <param name="actionid"></param>
        /// <returns></returns>

        public RADinfo_MIS_COST.Model.Action GetDetails(int actionid)
        {
            RADinfo_MIS_COST.Model.Action model = new RADinfo_MIS_COST.Model.Action();
            SqlParameter[] parameters           =
            {
                new SqlParameter("@actionid", SqlDbType.Int)
            };
            parameters[0].Value = actionid;
            using (SqlDataReader reader = RunProcedure("sp_GetAction", parameters))
            {
                if (reader.Read())
                {
                    model.ActionId       = Convert.ToInt32(reader["actionid"]);
                    model.ActionName     = Convert.ToString(reader["actionname"]);
                    model.ActionStr      = Convert.ToString(reader["actionstr"]);
                    model.ActionColumnid = Convert.ToInt32(reader["actioncolumnid"]);
                    model.Link           = Convert.ToString(reader["link"]);
                }
            }
            return(model);
        }
Example #5
0
        /// <summary>
        /// 获取指定用户的所有权限
        /// </summary>
        /// <param name="masterid"></param>
        /// <returns></returns>
        public ArrayList GetAction(string masterid)
        {
            ArrayList actions = new ArrayList();

            SqlParameter[] parameters =
            {
                new SqlParameter("@masterid", SqlDbType.VarChar)
            };
            parameters[0].Value = masterid;

            using (SqlDataReader reader =
                       RunProcedure("sp_GetAction_Master", parameters))
            {
                while (reader.Read())
                {
                    RADinfo_MIS_COST.Model.Action action = new RADinfo_MIS_COST.Model.Action();
                    action.ActionId   = Convert.ToInt32(reader["actionid"]);
                    action.ActionName = Convert.ToString(reader["actionname"]);
                    action.Link       = Convert.ToString(reader["link"]);
                    actions.Add(action);
                }
            }
            return(actions);
        }