1
yhj
2024-07-24 5e5d945e91568b973faa27d8ab0bcef99fc4a6c5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#region
 
using System;
using System.Data;
using CSFrameworkV5.Common;
using CSFrameworkV5.Core;
using CSFrameworkV5.DataAccess;
using CSFrameworkV5.Interfaces;
using CSFrameworkV5.Models;
using CSFrameworkV5.WebRef.SystemModule;
 
#endregion
 
namespace CSFrameworkV5.Business.BLL_Permission
{
    /// <summary>
    ///     用户临时权限的业务逻辑层
    /// </summary>
    public class bllUserRole
    {
        private IBridge_UserRole _MyBridge;
 
        public bllUserRole()
        {
            _MyBridge = CreateBridge();
        }
 
        private IBridge_UserRole CreateBridge()
        {
            if (BridgeFactory.IsADODirect)
                return new dalUserRole(Loginer.CurrentUser);
 
            if (BridgeFactory.IsWCFBridge) return new WCF_UserRole();
 
            throw new CustomException(BridgeFactory.UNKNOW_BRIDGE_TYPE);
        }
 
        public bool DeleteUserRole(string account, string roleID)
        {
            return _MyBridge.DeleteUserRole(account, roleID);
        }
 
        /// <summary>
        ///     搜索功能
        /// </summary>
        /// <param name="account"></param>
        /// <param name="roleID"></param>
        /// <param name="expireDateFrom"></param>
        /// <param name="expireDateTo"></param>
        /// <returns></returns>
        public DataTable SearchUserRole(string account, string roleID,
            DateTime expireDateFrom, DateTime expireDateTo)
        {
            return _MyBridge.SearchUserRole(account, roleID, expireDateFrom,
                expireDateTo);
        }
 
        public bool Update(DataTable data)
        {
            var ds = new DataSet();
            ds.Tables.Add(data.Copy());
            var dd = BridgeFactory.CreateDataDictBridge(typeof(tb_MyUserRoles));
            return dd.Update(ds);
        }
    }
}