Exemple #1
0
        /// <summary>
        /// Delegated event handler method is executed when the page is loaded through the PageLoad event
        /// to collect input data as set in query string and find appropriate cache item.
        /// </summary>
        /// <param name="sender">The object that sent the event.</param>
        /// <param name="e">The event arguments.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SecurityContext.Demand(new UseCacheViewerRight(), true);
                if (!Page.IsPostBack)
                {
                    scopeDropDownList.Items.Add(new ListItem("AppDomain"));
                    scopeDropDownList.Items.Add(new ListItem("Thread"));
                }

                _cacheName = Request.QueryString["name"];
                _keyName   = Request.QueryString["ItemKey"];
                _scopeName = Request.QueryString["scope"];
                if ((_scopeName != null) && (_cacheName != null))
                {
                    IList scopeCaches = CacheFactory.GetCaches(CacheScope.AppDomain);
                    foreach (ICache scopeCache in scopeCaches)
                    {
                        if (scopeCache.Name.Equals(_cacheName))
                        {
                            _selectedCache = scopeCache;
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                _log.Error(string.Format("CacheControl: Error getting cache {0} of scope {1}: {2}",
                                         _cacheName, _scopeName, ex));
                throw ex;
            }
        }
Exemple #2
0
        /// <summary>
        /// Method reads the data from the data adapter and binds filled ArrayList to the repeater,
        /// not using caching to retrieve actual data only.
        /// </summary>
        protected void SelectRecordsByFilter()
        {
            // Has to be checked here bacuse even if some users are allowed to see specific audit trail records
            // (e.g. bank account changes if user has ViewBankAccountAuditTrailRight), they shouldn't be able to
            // select audit trail records themselves but can see only selection made by parameters from Session
            SecurityContext.Demand(new ViewAuditTrailRight(), true, false);
            bool useBinding;
            long rowID = GetLong(rowIDTextBox.Text, out useBinding);

            if (!useBinding)
            {
                BindDataSource(Enumerable.Empty <IDataRecord>());
                return;
            }

            using (IDataReader listOfRecords = GetRecords(
                       GetInt(countOfItemsTextBox.Text, 100),
                       0L,
                       fromCreatedOnControl.DateTime,
                       toCreatedOnControl.DateTime,
                       (AuditTrailEntityID)GetInt(entityDropDownList.SelectedValue, 0),
                       rowID,
                       (AuditTrailOperationType)GetInt(operationDropDownList.SelectedValue, 0),
                       GetString(reasonTextBox.Text),
                       GetString(applicationNameTextBox.Text),
                       GetString(computerNameTextBox.Text),
                       GetString(identityTextBox.Text),
                       GetString(dbUserNameTextBox.Text),
                       GetString(statePatternTextBox.Text)))
            {
                BindDataSource((IEnumerable)listOfRecords);
            }
        }
Exemple #3
0
 /// <summary>
 /// Method is executed when the page loads.
 /// Used for checking security credentials of the user.
 /// </summary>
 /// <param name="sender">The object that sent the event.</param>
 /// <param name="e">The event arguments.</param>
 protected void Page_Load(object sender, System.EventArgs e)
 {
     try
     {
         SecurityContext.Demand(new UseZipHelperRight(), true);
         if (!Page.IsPostBack)
         {
             ListItem listItem;
             bool     defaultItemSet = false;
             algorythmDropDownList.Items.Add(_plainText);
             foreach (CompressorType value in Enum.GetValues(typeof(CompressorType)))
             {
                 if ((defaultItemSet) && (value == CompressorType.Default))
                 {
                     continue;
                 }
                 listItem = new ListItem(value.ToString());
                 if (value == CompressorType.Default)
                 {
                     listItem.Selected = (value == CompressorType.Default);
                     defaultItemSet    = true;
                 }
                 algorythmDropDownList.Items.Add(listItem);
             }
             foreach (ConversionType value in Enum.GetValues(typeof(ConversionType)))
             {
                 string itemText = value.ToString();
                 itemText = itemText.Substring(0, 4) + " " + itemText.Substring(4, 2) + " " + itemText.Substring(6);
                 listItem = new ListItem(itemText, value.ToString());
                 dataTypeDropDownList.Items.Add(listItem);
             }
         }
     }
     catch (Exception ex)
     {
         _log.Error("ZipHelper: error occured!", ex);
         throw ex;
     }
 }
Exemple #4
0
 /// <summary>
 /// Delegated event handler method is executed when the page is loaded through the PageLoad event.
 /// </summary>
 /// <param name="sender">The object that sent the event.</param>
 /// <param name="e">The event arguments.</param>
 protected void Page_Load(object sender, EventArgs e)
 {
     SecurityContext.Demand(new UseCacheViewerRight(), true);
 }