当前位置: 首页>>代码示例>>C#>>正文


C# Information.BaseUserInfo类代码示例

本文整理汇总了C#中DotNet.Utilities.Information.BaseUserInfo的典型用法代码示例。如果您正苦于以下问题:C# BaseUserInfo类的具体用法?C# BaseUserInfo怎么用?C# BaseUserInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BaseUserInfo类属于DotNet.Utilities.Information命名空间,在下文中一共展示了BaseUserInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ClearRolePermission

        /// <summary>
        /// 清除角色权限
        /// 
        /// 1.清除角色的用户归属。
        /// 2.清除角色的模块权限。
        /// 3.清除角色的操作权限。
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <returns>数据表</returns>
        public int ClearRolePermission(BaseUserInfo userInfo, string id)
        {
            // 写入调试信息
            #if (DEBUG)
                int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
                LogOnService.UserIsLogOn(userInfo);
            #endif

            int returnValue = 0;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);

                    BaseUserManager userManager = new BaseUserManager(dbHelper, userInfo);
                    returnValue += userManager.ClearUser(id);

                    string tableName = BasePermissionEntity.TableName;
                    if (!string.IsNullOrEmpty(BaseSystemInfo.SystemCode))
                    {
                        tableName = BaseSystemInfo.SystemCode + "Permission";
                    }
                    BaseRolePermissionManager rolePermissionManager = new BaseRolePermissionManager(dbHelper, userInfo, tableName);
                    returnValue += rolePermissionManager.RevokeAll(id);

                    tableName = BasePermissionScopeEntity.TableName;
                    if (!string.IsNullOrEmpty(BaseSystemInfo.SystemCode))
                    {
                        tableName = BaseSystemInfo.SystemCode + "PermissionScope";
                    }
                    BaseRoleScopeManager roleScopeManager = new BaseRoleScopeManager(dbHelper, userInfo, tableName);
                    returnValue += roleScopeManager.RevokeAll(id);

                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.PermissionService_ClearRolePermission, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
                BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return returnValue;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:68,代码来源:PermissionService.Role.cs

示例2: Add

        /// <summary>
        /// 添加操作权限项
        /// </summary>
        /// <param name="userInfo">当前用户</param>
        /// <param name="permissionEntity">权限定义实体</param>
        /// <param name="statusCode">状态码</param>
        /// <param name="statusMessage">状态信息</param>
        /// <returns>主键</returns>
        public string Add(BaseUserInfo userInfo, BasePermissionItemEntity permissionItemEntity, out string statusCode, out string statusMessage)
        {
            // 写入调试信息
            #if (DEBUG)
                int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
                LogOnService.UserIsLogOn(userInfo);
            #endif

            statusCode = string.Empty;
            statusMessage = string.Empty;
            string returnValue = string.Empty;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    // 数据库事务开始
                    // dbHelper.BeginTransaction();
                    string tableName = BasePermissionItemEntity.TableName;
                    if (!string.IsNullOrEmpty(BaseSystemInfo.SystemCode))
                    {
                        tableName = BaseSystemInfo.SystemCode + "PermissionItem";
                    }
                    BasePermissionItemManager permissionItemManager = new BasePermissionItemManager(dbHelper, userInfo, tableName);
                    returnValue = permissionItemManager.Add(permissionItemEntity, out statusCode);
                    // 获得状态消息
                    statusMessage = permissionItemManager.GetStateMessage(statusCode);
                    // 写入日志信息
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.PermissionItemService_Add, MethodBase.GetCurrentMethod());
                    // 数据库事务提交
                    // dbHelper.CommitTransaction();
                }
                catch (Exception ex)
                {
                    // 数据库事务回滚
                    // dbHelper.RollbackTransaction();
                    // 记录异常信息
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
                BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return returnValue;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:65,代码来源:PermissionItemService.cs

示例3: Add

        /// <summary>
        /// 添加工作流
        /// </summary>
        /// <param name="userInfo">当前用户</param>
        /// <param name="workFlowProcessEntity">工作流定义实体</param>
        /// <param name="statusCode">状态码</param>
        /// <param name="statusMessage">状态信息</param>
        /// <returns>主键</returns>
        public string Add(BaseUserInfo userInfo, BaseWorkFlowProcessEntity workFlowProcessEntity, out string statusCode, out string statusMessage)
        {
            // 写入调试信息
            #if (DEBUG)
                int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
                LogOnService.UserIsLogOn(userInfo);
            #endif

            statusCode = string.Empty;
            statusMessage = string.Empty;
            string returnValue = string.Empty;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.WorkFlowDbType))
            {
                try
                {
                    dbHelper.Open(WorkFlowDbConnection);
                    // 数据库事务开始
                    // dbHelper.BeginTransaction();
                    BaseWorkFlowProcessManager workFlowManager = new BaseWorkFlowProcessManager(dbHelper, userInfo);
                    returnValue = workFlowManager.Add(workFlowProcessEntity, out statusCode);
                    // 获得状态消息
                    statusMessage = workFlowManager.GetStateMessage(statusCode);
                    // 写入日志信息
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, MethodBase.GetCurrentMethod());
                    // 数据库事务提交
                    // dbHelper.CommitTransaction();
                }
                catch (Exception ex)
                {
                    // 数据库事务回滚
                    // dbHelper.RollbackTransaction();
                    // 记录异常信息
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
                BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return returnValue;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:60,代码来源:WorkFlowProcessAdminService.cs

示例4: Add

        /// <summary>
        /// 添加实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="itemsEntity">实体</param>
        /// <param name="statusCode">返回状态码</param>
        /// <param name="statusMessage">返回状态信息</param>
        /// <returns>数据表</returns>
        public string Add(BaseUserInfo userInfo, BaseItemsEntity itemsEntity, out string statusCode, out string statusMessage)
        {
            // 写入调试信息
            #if (DEBUG)
                int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
                LogOnService.UserIsLogOn(userInfo);
            #endif

            string returnValue = string.Empty;
            statusCode = string.Empty;
            statusMessage = string.Empty;

            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    string tableName = BaseItemsEntity.TableName;
                    if (!string.IsNullOrEmpty(BaseSystemInfo.SystemCode))
                    {
                        tableName = BaseSystemInfo.SystemCode + "Items";
                    }
                    BaseItemsManager itemsManager = new BaseItemsManager(dbHelper, userInfo, tableName);
                    // 调用方法,并且返回运行结果
                    returnValue = itemsManager.Add(itemsEntity, out statusCode);
                    statusMessage = itemsManager.GetStateMessage(statusCode);
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.ItemsService_Add, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
                BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return returnValue;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:58,代码来源:ItemsService.cs

示例5: AddUserToRole

        /// <summary>
        /// 用户添加到角色
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="roleId">角色主键</param>
        /// <param name="addUserIds">用户主键</param>
        /// <returns>影响行数</returns>
        public int AddUserToRole(BaseUserInfo userInfo, string roleId, string[] addUserIds)
        {
            // 写入调试信息
            #if (DEBUG)
                int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
                LogOnService.UserIsLogOn(userInfo);
            #endif

            int returnValue = 0;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    string tableName = BaseUserRoleEntity.TableName;
                    if (!string.IsNullOrEmpty(BaseSystemInfo.SystemCode))
                    {
                        tableName = BaseSystemInfo.SystemCode + "UserRole";
                    }
                    BaseUserManager userManager = new BaseUserManager(dbHelper, userInfo, tableName);
                    // 小心异常,检查一下参数的有效性
                    if (addUserIds != null)
                    {
                        returnValue += userManager.AddToRole(addUserIds, roleId);
                    }
                    BaseLogManager.Instance.Add(dbHelper, userInfo, serviceName, AppMessage.RoleService_AddUserToRole, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
                BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return returnValue;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:56,代码来源:RoleService.User.cs

示例6: AuditComplete

        /// <summary>
        /// 最终审核通过
        /// </summary>
        /// <param name="userInfo">当前用户</param>
        /// <param name="id">主键</param>
        /// <param name="auditIdea">审核意见</param>
        /// <returns>影响行数</returns>
        public int AuditComplete(BaseUserInfo userInfo, string[] ids, string auditIdea)
        {
            // 写入调试信息
            #if (DEBUG)
                int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
                LogOnService.UserIsLogOn(userInfo);
            #endif

            int returnValue = 0;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.WorkFlowDbType))
            {
                try
                {
                    dbHelper.Open(WorkFlowDbConnection);
                    //IWorkFlowManager userReportManager = new UserReportManager(userInfo);
                    BaseWorkFlowCurrentManager workFlowCurrentManager = new BaseWorkFlowCurrentManager(dbHelper, userInfo);
                    dbHelper.BeginTransaction();
                    returnValue += workFlowCurrentManager.AuditComplete(ids, auditIdea);
                    dbHelper.CommitTransaction();
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    dbHelper.RollbackTransaction();
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
                BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return returnValue;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:51,代码来源:WorkFlowCurrentService.cs

示例7: Add

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="folderId">文件夹主键</param>
        /// <param name="fileName">文件名</param>
        /// <param name="file"></param>
        /// <param name="description"></param>
        /// <param name="enabled"></param>
        /// <param name="statusCode"></param>
        /// <param name="statusMessage"></param>
        /// <returns></returns>
        public string Add(BaseUserInfo userInfo, string folderId, string fileName, byte[] file, string description, bool enabled, out string statusCode, out string statusMessage)
        {
            // 写入调试信息
            #if (DEBUG)
                int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
                LogOnService.UserIsLogOn(userInfo);
            #endif

            statusCode = string.Empty;
            statusMessage = string.Empty;

            string returnValue = string.Empty;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    BaseFileManager fileManager = new BaseFileManager(dbHelper, userInfo);
                    returnValue = fileManager.Add(folderId, fileName, file, description, enabled, out statusCode);
                    statusMessage = fileManager.GetStateMessage(statusCode);
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
                BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return returnValue;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:56,代码来源:FileService.cs

示例8: BatchDelete

        /// <summary>
        /// 批量删除参数
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="ids">主键数组</param>
        /// <returns>影响行数</returns>
        public int BatchDelete(BaseUserInfo userInfo, string[] ids)
        {
            // 写入调试信息
            #if (DEBUG)
                int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
                LogOnService.UserIsLogOn(userInfo);
            #endif

            int returnValue = 0;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    BaseParameterManager parameterManager = new BaseParameterManager(dbHelper, userInfo);
                    for (int i = 0; i < ids.Length; i++)
                    {
                        returnValue += parameterManager.Delete(ids[i]);
                    }
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.ParameterService_BatchDelete, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
                BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return returnValue;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:49,代码来源:ParameterService.cs

示例9: AddUser

        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="dbHelper">数据库连接</param>
        /// <param name="userInfo">用户信息</param>
        /// <param name="userEntity">用户实体</param>
        /// <param name="statusCode">状态码</param>
        /// <param name="statusMessage">状态信息</param>
        /// <returns>主键</returns>
        public string AddUser(IDbHelper dbHelper, BaseUserInfo userInfo, BaseUserEntity userEntity, out string statusCode, out string statusMessage)
        {
            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
                BaseSystemInfo.IsAuthorized(userInfo);
            #endif

            string returnValue = string.Empty;
            BaseUserManager userManager = new BaseUserManager(dbHelper, userInfo);
            // 若是系统需要用加密的密码,这里需要加密密码。
            if (BaseSystemInfo.ServerEncryptPassword)
            {
                userEntity.UserPassword = userManager.EncryptUserPassword(userEntity.UserPassword);
                // 安全通讯密码、交易密码也生成好
                userEntity.CommunicationPassword = userManager.EncryptUserPassword(userEntity.CommunicationPassword);
            }
            returnValue = userManager.Add(userEntity, out statusCode);
            statusMessage = userManager.GetStateMessage(statusCode);
            // 自己不用给自己发提示信息,这个提示信息是为了提高工作效率的,还是需要审核通过的,否则垃圾信息太多了
            if (userEntity.Enabled == 0 && statusCode.Equals(StatusCode.OKAdd.ToString()))
            {
                // 不是系统管理员添加
                if (!userInfo.IsAdministrator)
                {
                    // 给超级管理员群组发信息
                    BaseRoleManager roleManager = new BaseRoleManager(dbHelper, userInfo);
                    string[] roleIds = roleManager.GetIds(new KeyValuePair<string, object>(BaseRoleEntity.FieldCode, "Administrators"));
                    string[] userIds = userManager.GetIds(new KeyValuePair<string, object>(BaseUserEntity.FieldCode, "Administrator"));
                    // 发送请求审核的信息
                    BaseMessageEntity messageEntity = new BaseMessageEntity();
                    messageEntity.FunctionCode = MessageFunction.WaitForAudit.ToString();

                    // Pcsky 2012.05.04 显示申请的用户名
                    messageEntity.Contents = userInfo.RealName + "(" + userInfo.IPAddress + ")" + AppMessage.UserService_Application + userEntity.UserName + AppMessage.UserService_Check;
                    //messageEntity.Contents = userInfo.RealName + "(" + userInfo.IPAddress + ")" + AppMessage.UserService_Application + userEntity.RealName + AppMessage.UserService_Check;

                    BaseMessageManager messageManager = new BaseMessageManager(dbHelper, userInfo);
                    messageManager.BatchSend(userIds, null, roleIds, messageEntity, false);
                }
            }
            return returnValue;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:51,代码来源:UserService.cs

示例10: AddStaff

        /// <summary>
        /// 添加员工
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="staffEntity">实体</param>
        /// <param name="statusCode">返回状态码</param>
        /// <param name="statusMessage">返回状消息</param>
        /// <returns>主键</returns>
        public string AddStaff(BaseUserInfo userInfo, BaseStaffEntity staffEntity, out string statusCode, out string statusMessage)
        {
            // 写入调试信息
            #if (DEBUG)
                int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
                LogOnService.UserIsLogOn(userInfo);
            #endif

            string returnValue = string.Empty;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    // 1.若添加用户成功,添加员工。
                    BaseStaffManager staffManager = new BaseStaffManager(dbHelper, userInfo);
                    returnValue = staffManager.Add(staffEntity, out statusCode);
                    statusMessage = staffManager.GetStateMessage(statusCode);
                    // 2.自己不用给自己发提示信息,这个提示信息是为了提高工作效率的
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.StaffService_AddStaff, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
                BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif
            return returnValue;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:50,代码来源:StaffService.cs

示例11: GetModuleDTByPermissionScope

        /// <summary>
        /// 按某个权限域获取模块列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户主键</param>
        /// <param name="permissionItemCode">权限域编号</param>
        /// <returns>数据表</returns>
        public DataTable GetModuleDTByPermissionScope(BaseUserInfo userInfo, string userId, string permissionItemCode)
        {
            // 写入调试信息
            #if (DEBUG)
                int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
                LogOnService.UserIsLogOn(userInfo);
            #endif

            DataTable dataTable = new DataTable(BaseModuleEntity.TableName);
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    BaseModuleManager moduleManager = new BaseModuleManager(dbHelper, userInfo);
                    dataTable = moduleManager.GetDataTableByPermission(userId, permissionItemCode);
                    dataTable.TableName = BaseModuleEntity.TableName;
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.PermissionService_GetModuleDTByPermission, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
                BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return dataTable;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:48,代码来源:PermissionService.Scope.cs

示例12: BatchDeleteConstraint

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="ids">主键数组</param>
        /// <returns>影响行数</returns>
        public int BatchDeleteConstraint(BaseUserInfo userInfo, string[] ids)
        {
            // 写入调试信息
            #if (DEBUG)
                int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
                LogOnService.UserIsLogOn(userInfo);
            #endif

            int returnValue = 0;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    BasePermissionScopeManager manager = new BasePermissionScopeManager(dbHelper, userInfo);
                    returnValue = manager.SetDeleted(ids);
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.TableColumnsService_BatchDeleteConstraint, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
                BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return returnValue;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:46,代码来源:TableColumnsService.cs

示例13: BatchSend

        /// <summary>
        /// 批量发送站内信息
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="receiverIds">接受者主键数组</param>
        /// <param name="organizeIds">组织机构主键数组</param>
        /// <param name="roleIds">角色主键数组</param>
        /// <param name="messageEntity">消息内容</param>
        /// <returns>影响行数</returns>
        public int BatchSend(BaseUserInfo userInfo, string[] receiverIds, string[] organizeIds, string[] roleIds, BaseMessageEntity messageEntity)
        {
            // 写入调试信息
            #if (DEBUG)
                int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

            // 加强安全验证防止未授权匿名调用
            #if (!DEBUG)
                LogOnService.UserIsLogOn(userInfo);
            #endif

            int returnValue = 0;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    BaseMessageManager messageManager = new BaseMessageManager(dbHelper, userInfo);
                    returnValue = messageManager.BatchSend(receiverIds, organizeIds, roleIds, messageEntity, true);
                    BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.MessageService_BatchSend, MethodBase.GetCurrentMethod());
                }
                catch (Exception ex)
                {
                    BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                    throw ex;
                }
                finally
                {
                    dbHelper.Close();
                }
            }

            // 写入调试信息
            #if (DEBUG)
                BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif

            return returnValue;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:49,代码来源:MessageService.cs

示例14: PrepareParameter

        /// <summary>
        /// 解析替换约束表达式标准函数
        /// </summary>
        /// <param name="userInfo">当前用户</param>
        /// <param name="constraint">约束表达式</param>
        /// <returns>约束表达式</returns>
        public static string PrepareParameter(BaseUserInfo userInfo, string constraint)
        {
            constraint = constraint.Replace("用户主键", userInfo.Id);
            constraint = constraint.Replace("CurrentUserId", userInfo.Id);
            constraint = constraint.Replace("用户编号", userInfo.Code);
            constraint = constraint.Replace("CurrentUserCode", userInfo.Code);
            constraint = constraint.Replace("用户名", userInfo.UserName);
            constraint = constraint.Replace("CurrentUserName", userInfo.UserName);
            constraint = constraint.Replace("用户姓名", userInfo.RealName);
            constraint = constraint.Replace("CurrentRealName", userInfo.RealName);

            constraint = constraint.Replace("公司主键", userInfo.CompanyId);
            constraint = constraint.Replace("CurrentCompanyId", userInfo.CompanyId);

            constraint = constraint.Replace("部门主键", userInfo.DepartmentId);
            constraint = constraint.Replace("CurrentDepartmentId", userInfo.DepartmentId);

            constraint = constraint.Replace("工作组主键", userInfo.WorkgroupId);
            constraint = constraint.Replace("CurrentWorkgroupId", userInfo.WorkgroupId);

            return constraint;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:28,代码来源:ConstraintUtil.cs

示例15: Add

        /// <summary>
        /// 工作日志添加
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="dataTable">数据表</param>
        /// <param name="statusCode">返回状态码</param>
        /// <param name="statusMessage">返回状态信息</param>
        /// <returns>主键</returns>
        public string Add(BaseUserInfo userInfo, DataTable dataTable, out string statusCode, out string statusMessage)
        {
            // 写入调试信息
            #if (DEBUG)
                int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif
            statusCode = string.Empty;
            statusMessage = string.Empty;

            string returnValue = string.Empty;
            IDbHelper dbHelper = DbHelperFactory.GetHelper();
            try
            {
                dbHelper.Open(UserCenterDbConnection);
                BaseWorkReportEntity WorkReportEntity = new BaseWorkReportEntity(dataTable);
                BaseWorkReportManager workReportManager = new BaseWorkReportManager(dbHelper, userInfo);
                returnValue = workReportManager.Add(WorkReportEntity, out statusCode);
                // 获得状态消息
                statusMessage = workReportManager.GetStateMessage(statusCode);
                // 写入日志
                BaseLogManager.Instance.Add(dbHelper, userInfo, MethodBase.GetCurrentMethod());
            }
            catch (Exception ex)
            {
                BaseExceptionManager.LogException(dbHelper, userInfo, ex);
                throw ex;
            }
            finally
            {
                dbHelper.Close();
            }

            // 写入调试信息
            #if (DEBUG)
                BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart);
            #endif
            return returnValue;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:46,代码来源:WorkReportService.cs


注:本文中的DotNet.Utilities.Information.BaseUserInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。