(03)权限配置管理 的标准接口
2008-09-02 15:35 通用C#系统架构 阅读(2489) 评论(0) 编辑 收藏 举报
(03)权限配置管理 可参考 http://www.cnblogs.com/jirigala/archive/2008/06/23/1228424.html
当前操作员类 BaseUserInfo http://www.cnblogs.com/jirigala/archive/2008/08/26/1276666.html
(03)权限配置管理 可参考
http://www.cnblogs.com/jirigala/archive/2008/06/23/1228424.html
当前操作员类 BaseUserInfo
http://www.cnblogs.com/jirigala/archive/2008/08/26/1276666.html
Code
1//------------------------------------------------------------
2// All Rights Reserved , Copyright (C) 2008 , Jirisoft , Ltd.
3//------------------------------------------------------------
4
5using System;
6using System.Data;
7
8namespace Jirisoft.Common.IService
9{
10 using Jirisoft.Common.Model;
11 using Jirisoft.Common.Utilities;
12
13 /**//// <summary>
14 /// IPermissionAdminService
15 /// 对权限配置表的操作
16 ///
17 /// 修改纪录
18 ///
19 /// 2008.09.02 版本:1.3 JiRiGaLa 将命名修改为 IPermissionAdminService 。
20 /// 2008.06.12 版本:1.2 JiRiGaLa 传递类对象。
21 /// 2008.05.09 版本:1.1 JiRiGaLa 命名修改为IPermissionService。
22 /// 2008.03.23 版本:1.0 JiRiGaLa 添加权限。
23 ///
24 /// 版本:1.3
25 ///
26 /// <author>
27 /// <name>JiRiGaLa</name>
28 /// <date>2008.09.02</date>
29 /// </author>
30 /// </summary>
31 public interface IPermissionAdminService
32 {
33 /**//// <summary>
34 /// 加载服务层
35 /// </summary>
36 void Load();
37
38 /**//// <summary>
39 /// 获得权限列表
40 /// </summary>
41 /// <param name="userInfo">操作员信息</param>
42 /// <returns>数据表</returns>
43 DataTable GetList(BaseUserInfo userInfo);
44
45 /**//// <summary>
46 /// 获得列表
47 /// </summary>
48 /// <param name="userInfo">操作员信息</param>
49 /// <param name="parentID">父亲节点代码</param>
50 /// <returns>数据表</returns>
51 DataTable GetListByParent(BaseUserInfo userInfo, String parentID);
52
53 /**//// <summary>
54 /// 添加一个权限
55 /// </summary>
56 /// <param name="userInfo">操作员信息</param>
57 /// <param name="permissionEntity">权限实体</param>
58 /// <param name="statusCode">返回状态码</param>
59 /// <param name="statusMessage">返回状消息</param>
60 /// <returns>数据表</returns>
61 String Add(BaseUserInfo userInfo, BasePermissionEntity permissionEntity, out String statusCode, out String statusMessage);
62
63 /**//// <summary>
64 /// 按明细添加一个权限
65 /// </summary>
66 /// <param name="userInfo">操作员信息</param>
67 /// <param name="code">编号</param>
68 /// <param name="fullName">名称</param>
69 /// <param name="statusCode">返回状态码</param>
70 /// <param name="statusMessage">返回状消息</param>
71 /// <returns>代码</returns>
72 String AddByDetail(BaseUserInfo userInfo, String code, String fullName, out String statusCode, out String statusMessage);
73
74 /**//// <summary>
75 /// 获取一个权限
76 /// </summary>
77 /// <param name="userInfo">操作员信息</param>
78 /// <param name="id">代码</param>
79 /// <param name="statusCode">返回状态码</param>
80 /// <param name="statusMessage">返回状消息</param>
81 /// <returns>实体</returns>
82 BasePermissionEntity Get(BaseUserInfo userInfo, String id, out String statusCode, out String statusMessage);
83
84 /**//// <summary>
85 /// 按编码获取一个权限
86 /// </summary>
87 /// <param name="userInfo">操作员信息</param>
88 /// <param name="code">编号</param>
89 /// <param name="statusCode">返回状态码</param>
90 /// <param name="statusMessage">返回状消息</param>
91 /// <returns>实体</returns>
92 BasePermissionEntity GetByCode(BaseUserInfo userInfo, String code, out String statusCode, out String statusMessage);
93
94 /**//// <summary>
95 /// 按编号获取名称
96 /// </summary>
97 /// <param name="userInfo">操作员信息</param>
98 /// <param name="code">编号</param>
99 /// <returns>名称</returns>
100 String GetFullNameByCode(BaseUserInfo userInfo, String code);
101
102 /**//// <summary>
103 /// 更新
104 /// </summary>
105 /// <param name="userInfo">操作员信息</param>
106 /// <param name="permissionEntity">权限实体</param>
107 /// <param name="statusCode">返回状态码</param>
108 /// <param name="statusMessage">返回状消息</param>
109 /// <returns>影响行数</returns>
110 int Update(BaseUserInfo userInfo, BasePermissionEntity permissionEntity, out String statusCode, out String statusMessage);
111
112 /**//// <summary>
113 /// 移动权限数据
114 /// </summary>
115 /// <param name="userInfo">操作员信息</param>
116 /// <param name="id">代码</param>
117 /// <param name="parentID">父结点代码</param>
118 /// <returns>影响行数</returns>
119 int MoveTo(BaseUserInfo userInfo, String id, String parentID);
120
121 /**//// <summary>
122 /// 批量移动权限数据
123 /// </summary>
124 /// <param name="userInfo">操作员信息</param>
125 /// <param name="ids">代码组</param>
126 /// <param name="parentID">父结点代码</param>
127 /// <returns>影响行数</returns>
128 int BatchMoveTo(BaseUserInfo userInfo, String[] ids, String parentID);
129
130 /**//// <summary>
131 /// 删除一个权限
132 /// </summary>
133 /// <param name="userInfo">操作员信息</param>
134 /// <param name="id">代码</param>
135 /// <returns>影响行数</returns>
136 int Delete(BaseUserInfo userInfo, String id);
137
138 /**//// <summary>
139 /// 批量删除权限
140 /// </summary>
141 /// <param name="userInfo">操作员信息</param>
142 /// <param name="ids">代码数组</param>
143 /// <returns>影响行数</returns>
144 int BatchDelete(BaseUserInfo userInfo, String[] ids);
145
146 /**//// <summary>
147 /// 批量保存权限
148 /// </summary>
149 /// <param name="userInfo">操作员信息</param>
150 /// <param name="myDataTable">权限数据表</param>
151 /// <returns>数据集</returns>
152 DataTable BatchSave(BaseUserInfo userInfo, DataTable myDataTable);
153
154 /**//// <summary>
155 /// 保存权限排序顺序
156 /// </summary>
157 /// <param name="userInfo">操作员信息</param>
158 /// <param name="ids">代码数组</param>
159 /// <returns>影响行数</returns>
160 int BatchSetSortCode(BaseUserInfo userInfo, String[] ids);
161 }
162}
1//------------------------------------------------------------
2// All Rights Reserved , Copyright (C) 2008 , Jirisoft , Ltd.
3//------------------------------------------------------------
4
5using System;
6using System.Data;
7
8namespace Jirisoft.Common.IService
9{
10 using Jirisoft.Common.Model;
11 using Jirisoft.Common.Utilities;
12
13 /**//// <summary>
14 /// IPermissionAdminService
15 /// 对权限配置表的操作
16 ///
17 /// 修改纪录
18 ///
19 /// 2008.09.02 版本:1.3 JiRiGaLa 将命名修改为 IPermissionAdminService 。
20 /// 2008.06.12 版本:1.2 JiRiGaLa 传递类对象。
21 /// 2008.05.09 版本:1.1 JiRiGaLa 命名修改为IPermissionService。
22 /// 2008.03.23 版本:1.0 JiRiGaLa 添加权限。
23 ///
24 /// 版本:1.3
25 ///
26 /// <author>
27 /// <name>JiRiGaLa</name>
28 /// <date>2008.09.02</date>
29 /// </author>
30 /// </summary>
31 public interface IPermissionAdminService
32 {
33 /**//// <summary>
34 /// 加载服务层
35 /// </summary>
36 void Load();
37
38 /**//// <summary>
39 /// 获得权限列表
40 /// </summary>
41 /// <param name="userInfo">操作员信息</param>
42 /// <returns>数据表</returns>
43 DataTable GetList(BaseUserInfo userInfo);
44
45 /**//// <summary>
46 /// 获得列表
47 /// </summary>
48 /// <param name="userInfo">操作员信息</param>
49 /// <param name="parentID">父亲节点代码</param>
50 /// <returns>数据表</returns>
51 DataTable GetListByParent(BaseUserInfo userInfo, String parentID);
52
53 /**//// <summary>
54 /// 添加一个权限
55 /// </summary>
56 /// <param name="userInfo">操作员信息</param>
57 /// <param name="permissionEntity">权限实体</param>
58 /// <param name="statusCode">返回状态码</param>
59 /// <param name="statusMessage">返回状消息</param>
60 /// <returns>数据表</returns>
61 String Add(BaseUserInfo userInfo, BasePermissionEntity permissionEntity, out String statusCode, out String statusMessage);
62
63 /**//// <summary>
64 /// 按明细添加一个权限
65 /// </summary>
66 /// <param name="userInfo">操作员信息</param>
67 /// <param name="code">编号</param>
68 /// <param name="fullName">名称</param>
69 /// <param name="statusCode">返回状态码</param>
70 /// <param name="statusMessage">返回状消息</param>
71 /// <returns>代码</returns>
72 String AddByDetail(BaseUserInfo userInfo, String code, String fullName, out String statusCode, out String statusMessage);
73
74 /**//// <summary>
75 /// 获取一个权限
76 /// </summary>
77 /// <param name="userInfo">操作员信息</param>
78 /// <param name="id">代码</param>
79 /// <param name="statusCode">返回状态码</param>
80 /// <param name="statusMessage">返回状消息</param>
81 /// <returns>实体</returns>
82 BasePermissionEntity Get(BaseUserInfo userInfo, String id, out String statusCode, out String statusMessage);
83
84 /**//// <summary>
85 /// 按编码获取一个权限
86 /// </summary>
87 /// <param name="userInfo">操作员信息</param>
88 /// <param name="code">编号</param>
89 /// <param name="statusCode">返回状态码</param>
90 /// <param name="statusMessage">返回状消息</param>
91 /// <returns>实体</returns>
92 BasePermissionEntity GetByCode(BaseUserInfo userInfo, String code, out String statusCode, out String statusMessage);
93
94 /**//// <summary>
95 /// 按编号获取名称
96 /// </summary>
97 /// <param name="userInfo">操作员信息</param>
98 /// <param name="code">编号</param>
99 /// <returns>名称</returns>
100 String GetFullNameByCode(BaseUserInfo userInfo, String code);
101
102 /**//// <summary>
103 /// 更新
104 /// </summary>
105 /// <param name="userInfo">操作员信息</param>
106 /// <param name="permissionEntity">权限实体</param>
107 /// <param name="statusCode">返回状态码</param>
108 /// <param name="statusMessage">返回状消息</param>
109 /// <returns>影响行数</returns>
110 int Update(BaseUserInfo userInfo, BasePermissionEntity permissionEntity, out String statusCode, out String statusMessage);
111
112 /**//// <summary>
113 /// 移动权限数据
114 /// </summary>
115 /// <param name="userInfo">操作员信息</param>
116 /// <param name="id">代码</param>
117 /// <param name="parentID">父结点代码</param>
118 /// <returns>影响行数</returns>
119 int MoveTo(BaseUserInfo userInfo, String id, String parentID);
120
121 /**//// <summary>
122 /// 批量移动权限数据
123 /// </summary>
124 /// <param name="userInfo">操作员信息</param>
125 /// <param name="ids">代码组</param>
126 /// <param name="parentID">父结点代码</param>
127 /// <returns>影响行数</returns>
128 int BatchMoveTo(BaseUserInfo userInfo, String[] ids, String parentID);
129
130 /**//// <summary>
131 /// 删除一个权限
132 /// </summary>
133 /// <param name="userInfo">操作员信息</param>
134 /// <param name="id">代码</param>
135 /// <returns>影响行数</returns>
136 int Delete(BaseUserInfo userInfo, String id);
137
138 /**//// <summary>
139 /// 批量删除权限
140 /// </summary>
141 /// <param name="userInfo">操作员信息</param>
142 /// <param name="ids">代码数组</param>
143 /// <returns>影响行数</returns>
144 int BatchDelete(BaseUserInfo userInfo, String[] ids);
145
146 /**//// <summary>
147 /// 批量保存权限
148 /// </summary>
149 /// <param name="userInfo">操作员信息</param>
150 /// <param name="myDataTable">权限数据表</param>
151 /// <returns>数据集</returns>
152 DataTable BatchSave(BaseUserInfo userInfo, DataTable myDataTable);
153
154 /**//// <summary>
155 /// 保存权限排序顺序
156 /// </summary>
157 /// <param name="userInfo">操作员信息</param>
158 /// <param name="ids">代码数组</param>
159 /// <returns>影响行数</returns>
160 int BatchSetSortCode(BaseUserInfo userInfo, String[] ids);
161 }
162}
将权限管理、工作流管理做到我能力的极致,一个人只能做好那么很少的几件事情。