Ejemplo n.º 1
0
        public string DeleteRole(int id, bool isDel)
        {
            Material_Role role = _roleBll.Find(id);

            role.Del_Flag = isDel;
            return(_roleBll.UpdateEntities(new List <Material_Role>()
            {
                role
            }) ? "OK" : "Error");
        }
Ejemplo n.º 2
0
        public string AddRole(Material_Role materialRole, List <int> actions)
        {
            Material_Role updateRole = _roleBll.Find(materialRole.Id);

            if (updateRole == null)
            {
                return(_roleBll.AddEntities(new List <Material_Role> {
                    materialRole
                }) &&
                       _roleActionBll.SetActionByRole(actions, materialRole.Id) ? "添加成功" : "添加失败");
            }
            else
            {
                AssmblyHelper.ClassEvaluate(materialRole, updateRole);
                return(_roleBll.UpdateEntities(new List <Material_Role> {
                    updateRole
                }) && _roleActionBll.SetActionByRole(actions, updateRole.Id) ? "更新成功" : "更新失败");
            }
        }