コード例 #1
0
        private void buttonApply_Click(object sender, EventArgs e)
        {
            var date = dateTimePicker.Checked ? dateTimePicker.Value : DateTime.MinValue;

            UserLockouts.BuildDynamicLinqFilter(textBoxUser.Text, date, textBoxUnlocker.Text,
                                                out string filter, out object[] param);
            DataCollectionManager.CreateFilteredData(filter, param);
            _viewer.SetCurrentCollection(DataCollectionManager.FilteredData);
            _viewer.MoveFirst();
            _viewer.ShowFilterIndicator();
        }
コード例 #2
0
        public void LogUnlockAction(string adName, string unlocker)
        {
            // Open database (or create if doesn't exist)

            var db = GetCurrentOpeningDB();
            // Get a collection (or create, if doesn't exist)
            var col = db.GetCollection <UserLockouts>(ColName);
            // Create your new customer instance
            var unlock = new UserLockouts
            {
                ADName     = adName,
                UnlockTime = DateTime.Now,
                Unlocker   = unlocker
            };

            // Insert new customer document (Id will be auto-incremented)
            col.Insert(unlock);
            // Index document using document Name property
            col.EnsureIndex(x => x.ADName);
            _logger.Log($"unlocked: {adName} by {unlocker} is logged");
        }