Example #1
0
        private void btnUsername_Click(object sender, EventArgs e)
        {
            LastMethodInvoked = new LastDelegate(btnUsername_Click);
            LastSender        = sender;
            LastEvent         = e;

            var usersCached = RedisClient.GetAllUsernames()
                              .OrderByDescending(o => o.TimeStamp)
                              .ThenByDescending(o => o.Username)
                              .ToList();

            if (usersCached.Count == 0)
            {
                dgv.DataSource = DataProvider.Transform(DataProvider.GetAllUsernames())
                                 .OrderByDescending(o => o.TimeStamp)
                                 .ThenByDescending(o => o.Password)
                                 .ToList();
            }
            else
            {
                dgv.DataSource = usersCached;
            }
            SetColumnsUsername();
            var users = DataProvider.Transform(DataProvider.GetAllUsernames());

            RedisClient.PublishMore(users.Cast <BasicLogger>().ToList());
        }
Example #2
0
        private void btnTime_Click(object sender, EventArgs e)
        {
            LastMethodInvoked = new LastDelegate(btnTime_Click);
            LastSender        = sender;
            LastEvent         = e;

            if (rBtnMail.Checked)
            {
                var mails = DataProvider.Transform(DataProvider.GetMails(dtpFrom.Value, dtpTo.Value))
                            .OrderByDescending(o => o.TimeStamp)
                            .ThenByDescending(o => o.Password)
                            .ToList();

                if (mails.Count == 0)
                {
                    ShowMessageBox("Traženi upit nije pronašao nijednu vrednost sa zadatim kriterijumima.");
                    return;
                }
                dgv.DataSource = mails;
                SetColumnsMail();
            }
            if (rBtnMobile.Checked)
            {
                var mobiles = DataProvider.Transform(DataProvider.GetMobiles(dtpFrom.Value, dtpTo.Value))
                              .OrderByDescending(o => o.TimeStamp)
                              .ThenByDescending(o => o.Password)
                              .ToList();

                if (mobiles.Count == 0)
                {
                    ShowMessageBox("Traženi upit nije pronašao nijednu vrednost sa zadatim kriterijumima.");
                    return;
                }
                dgv.DataSource = mobiles;
                SetColumnsMobile();
            }
            if (rBtnUsername.Checked)
            {
                var users = DataProvider.Transform(DataProvider.GetUsernames(dtpFrom.Value, dtpTo.Value))
                            .OrderByDescending(o => o.TimeStamp)
                            .ThenByDescending(o => o.Password)
                            .ToList();

                if (users.Count == 0)
                {
                    ShowMessageBox("Traženi upit nije pronašao nijednu vrednost sa zadatim kriterijumima.");
                    return;
                }
                dgv.DataSource = users;
                SetColumnsUsername();
            }
        }