public UsageLogger(string clientName, DatabaseCore.Items.User respondent)
        {
            this.DatabaseProvider = ConfigurationManager.AppSettings["DatabaseProviderUsageLog"];
            this.ConnectionString = ConfigurationManager.AppSettings["ConnectionStringUsageLog"];

            this.ClientName = clientName;
            this.Respondent = respondent;
        }
Example #2
0
        private void BindActiveSessions()
        {
            Table table = new Table();

            table.CellSpacing = 0;
            table.CellPadding = 0;

            /*IEnumerable<SessionStateItemCollection> activeSessions = GetActiveSessions();
             *
             * foreach (SessionStateItemCollection session in activeSessions)*/
            foreach (string clientName in Global.AllSessions.Keys)
            {
                foreach (Guid idUser in Global.AllSessions[clientName].Keys)
                {
                    string username = "******";

                    if (Global.AllSessions[clientName][idUser]["Core"] != null)
                    {
                        try
                        {
                            DatabaseCore.Core core = (DatabaseCore.Core)Global.AllSessions[clientName][idUser]["Core"];

                            DatabaseCore.Items.User user = core.Users.GetSingle(idUser);

                            username = user.Name;
                        }
                        catch { }
                    }

                    TableRow tableRow = new TableRow();

                    TableCell tableCellClient = new TableCell();
                    TableCell tableCellUser   = new TableCell();
                    TableCell tableCellId     = new TableCell();

                    tableCellClient.Text = clientName;
                    tableCellUser.Text   = username;
                    tableCellId.Text     = Global.AllSessions[clientName][idUser].SessionID;

                    tableRow.Cells.Add(tableCellClient);
                    tableRow.Cells.Add(tableCellUser);
                    tableRow.Cells.Add(tableCellId);

                    table.Rows.Add(tableRow);
                }
            }

            pnlActiveSessions.Controls.Add(table);
        }