public virtual string[] GetProperties(KeyValuePair <string, object> parameter, int topLimit, string targetField)
        {
            List <KeyValuePair <string, object> > parameters = new List <KeyValuePair <string, object> >();

            parameters.Add(parameter);
            return(DbLogic.GetProperties(DbHelper, this.CurrentTableName, parameters, topLimit, targetField));
        }
 public virtual string[] GetProperties(KeyValuePair<string, object> parameter1, KeyValuePair<string, object> parameter2, string targetField)
 {
     List<KeyValuePair<string, object>> parameters = new List<KeyValuePair<string, object>>();
     parameters.Add(parameter1);
     parameters.Add(parameter2);
     return DbLogic.GetProperties(DbHelper, this.CurrentTableName, parameters, 0, targetField);
 }
        public virtual string[] GetIds(KeyValuePair <string, object> parameter)
        {
            List <KeyValuePair <string, object> > parameters = new List <KeyValuePair <string, object> >();

            parameters.Add(parameter);
            return(DbLogic.GetProperties(DbHelper, this.CurrentTableName, parameters, 0, BaseBusinessLogic.FieldId));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="userInfo"></param>
        /// <param name="resourceCategory"></param>
        /// <param name="targetId"></param>
        /// <param name="targetResourceCategory"></param>
        /// <param name="permissionItemCode"></param>
        /// <returns></returns>
        public string[] GetPermissionScopeResourceIds(BaseUserInfo userInfo, string resourceCategory, string targetId, string targetResourceCategory, string permissionItemCode)
        {
            // 写入调试信息
            #if (DEBUG)
            int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod());
            #endif

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

            string[] returnValue = null;
            using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType))
            {
                try
                {
                    dbHelper.Open(UserCenterDbConnection);
                    string tableName = BasePermissionItemEntity.TableName;
                    if (!string.IsNullOrEmpty(BaseSystemInfo.SystemCode))
                    {
                        tableName = BaseSystemInfo.SystemCode + "PermissionItem";
                    }
                    BasePermissionItemManager permissionItemManager = new BasePermissionItemManager(dbHelper, userInfo, tableName);
                    string permissionItemId = permissionItemManager.GetId(new KeyValuePair <string, object>(BasePermissionItemEntity.FieldCode, permissionItemCode));

                    List <KeyValuePair <string, object> > parameters = new List <KeyValuePair <string, object> >();
                    parameters.Add(new KeyValuePair <string, object>(BasePermissionScopeEntity.FieldTargetId, targetId));
                    parameters.Add(new KeyValuePair <string, object>(BasePermissionScopeEntity.FieldResourceCategory, resourceCategory));
                    parameters.Add(new KeyValuePair <string, object>(BasePermissionScopeEntity.FieldPermissionItemId, permissionItemId));
                    parameters.Add(new KeyValuePair <string, object>(BasePermissionScopeEntity.FieldTargetCategory, targetResourceCategory));
                    parameters.Add(new KeyValuePair <string, object>(BasePermissionScopeEntity.FieldEnabled, 1));
                    parameters.Add(new KeyValuePair <string, object>(BasePermissionScopeEntity.FieldDeletionStateCode, 0));

                    tableName = BasePermissionScopeEntity.TableName;
                    if (!string.IsNullOrEmpty(BaseSystemInfo.SystemCode))
                    {
                        tableName = BaseSystemInfo.SystemCode + "PermissionScope";
                    }
                    returnValue = DbLogic.GetProperties(dbHelper, tableName, parameters, 0, BasePermissionScopeEntity.FieldResourceId);
                    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);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="result"></param>
        /// <param name="resourceCategory"></param>
        /// <param name="targetId"></param>
        /// <param name="targetResourceCategory"></param>
        /// <param name="permissionCode"></param>
        /// <returns></returns>
        public string[] GetPermissionScopeResourceIds(BaseUserInfo userInfo, string resourceCategory, string targetId, string targetResourceCategory, string permissionCode)
        {
            string[] result = null;

            var parameter = ServiceInfo.Create(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessUserCenterReadDb(userInfo, parameter, (dbHelper) =>
            {
                string permissionId = BaseModuleManager.GetIdByCodeByCache(userInfo.SystemCode, permissionCode);

                List <KeyValuePair <string, object> > parameters = new List <KeyValuePair <string, object> >();
                parameters.Add(new KeyValuePair <string, object>(BasePermissionScopeEntity.FieldTargetId, targetId));
                parameters.Add(new KeyValuePair <string, object>(BasePermissionScopeEntity.FieldResourceCategory, resourceCategory));
                parameters.Add(new KeyValuePair <string, object>(BasePermissionScopeEntity.FieldPermissionId, permissionId));
                parameters.Add(new KeyValuePair <string, object>(BasePermissionScopeEntity.FieldTargetCategory, targetResourceCategory));
                parameters.Add(new KeyValuePair <string, object>(BasePermissionScopeEntity.FieldEnabled, 1));
                parameters.Add(new KeyValuePair <string, object>(BasePermissionScopeEntity.FieldDeletionStateCode, 0));

                string tableName = userInfo.SystemCode + "PermissionScope";
                result           = DbLogic.GetProperties(dbHelper, tableName, parameters, 0, BasePermissionScopeEntity.FieldResourceId);
            });
            return(result);
        }
 public virtual string[] GetProperties(int topLimit, string targetField)
 {
     return DbLogic.GetProperties(DbHelper, this.CurrentTableName, null, topLimit, targetField);
 }
 public virtual string[] GetIds(List<KeyValuePair<string, object>> parameters)
 {
     return DbLogic.GetProperties(DbHelper, this.CurrentTableName, parameters, 0, BaseBusinessLogic.FieldId);
 }
 public virtual string[] GetIds(string name, Object[] values)
 {
     return DbLogic.GetProperties(DbHelper, this.CurrentTableName, name, values, BaseBusinessLogic.FieldId);
 }
        //
        // 获得主键列表
        //

        public virtual string[] GetIds()
        {
            return DbLogic.GetProperties(DbHelper, this.CurrentTableName, null, 0, BaseBusinessLogic.FieldId);
        }
 public virtual string[] GetProperties(List<KeyValuePair<string, object>> parameters, int topLimit = 0, string targetField = null)
 {
     return DbLogic.GetProperties(DbHelper, this.CurrentTableName, parameters, topLimit, targetField);
 }
 public virtual string[] GetProperties(string name, Object[] values, string targetField)
 {
     return DbLogic.GetProperties(DbHelper, this.CurrentTableName, name, values, targetField);
 }
 public virtual string[] GetProperties(string targetField)
 {
     return(DbLogic.GetProperties(DbHelper, this.CurrentTableName, null, 0, targetField));
 }
 public virtual string[] GetProperties(List <KeyValuePair <string, object> > parameters, string targetField)
 {
     return(DbLogic.GetProperties(DbHelper, this.CurrentTableName, parameters, 0, targetField));
 }