Ejemplo n.º 1
0
        public List <WebLogTable> QueryByReferenceGuid(WebLogTableData data)
        {
            string command = "";

            #region # sql command #
            command = " SELECT " +
                      " rm.RawMessageID AS 'ID', " +
                      " rm.GroupKey AS 'Logger', " +
                      " rm.Thread, " +
                      " rm.RawMessageData AS 'Message', " +
                      " rm.Created AS 'Date'" +
                      " FROM [Cashflow].[log].[RawMessage] AS rm " +
                      " INNER JOIN [Cashflow].[core].[ActionContext] AS ac ON rm.ActionContextID = ac.ActionContextID " +
                      " INNER JOIN [Cashflow].[core].[ActionContextGroup] AS acg ON ac.ActionContextGroupID = acg.ActionContextGroupID " +
                      " WHERE acg.ActionContextGroupID = (SELECT TOP 1 acg1.ActionContextGroupID FROM [Cashflow].[log].[RawMessage] AS rm1 " +
                      " 															    INNER JOIN [Cashflow].[core].[ActionContext] AS ac1 ON rm1.ActionContextID = ac1.ActionContextID "+
                      " 								                  INNER JOIN [Cashflow].[core].[ActionContextGroup] AS acg1 ON ac1.ActionContextGroupID = acg1.ActionContextGroupID "+
                      " 																  WHERE "+
                      "                                   rm1.Created >= '" + data.From.ToString() + "' AND rm1.Created <= '" + data.To.ToString() + "' " +
                      " 																	AND rm1.RawMessageData LIKE '%"+ data.SessionID + "%') " +
                      " ORDER BY rm.Created ASC ";
            #endregion

            this._result = new List <WebLogTable>();
            DirectContainer container = CashflowDirect.Instance.LoadContainer(command);
            this._result = container.ConvertList <WebLogTable>();
            return(this._result);
        }
Ejemplo n.º 2
0
        public List <WebLogTable> QueryByIdentificationSessionGuid(WebLogTableData data)
        {
            string command = "";

            #region # sql command #
            command = " SELECT " +
                      " rm.RawMessageID AS 'ID', " +
                      " rm.GroupKey AS 'Logger', " +
                      " rm.Thread, " +
                      " rm.RawMessageData AS 'Message', " +
                      " rm.Created AS 'Date' " +
                      " FROM Cashflow.core.IdentificationSession AS ids " +
                      " LEFT OUTER JOIN Cashflow.core.ActionContext AS ac ON ids.ActionContextID=ac.ActionContextID " +
                      " LEFT OUTER JOIN Cashflow.core.ActionContextGroup AS acg ON ac.ActionContextGroupID=acg.ActionContextGroupID " +
                      " LEFT OUTER JOIN Cashflow.core.ActionContext AS ac2 ON acg.ActionContextGroupID=ac2.ActionContextGroupID " +
                      " LEFT OUTER JOIN Cashflow.log.RawMessage AS rm ON rm.ActionContextID=ac2.ActionContextID " +
                      " WHERE " +
                      " ids.IdentificationSessionGuid='" + data.SessionID + "' AND rm.RawMessageID IS NOT NULL " +
                      " ORDER BY rm.Created ASC; ";
            #endregion

            this._result = new List <WebLogTable>();
            DirectContainer container = CashflowDirect.Instance.LoadContainer(command);
            this._result = container.ConvertList <WebLogTable>();
            return(this._result);
        }
Ejemplo n.º 3
0
        // SUMMARY: Report -> Informations about click
        public ActionResult GetInformations(WebLogTableData data)
        {
            InformationManager manager = new InformationManager();

            manager.Query(data);
            return(View("~/Views/Report/_LogTable.cshtml", new LogModel {
                Informations = manager.Result, InformationsLabel = "info"
            }));
        }
Ejemplo n.º 4
0
        // SUMMARY: Report -> Load paywall logs from Log database
        public ActionResult GetPaywallLogDatabase(WebLogTableData data)
        {
            WebLogManager manager = new WebLogManager();

            manager.QueryLogDatabase(data);
            return(View("~/Views/Report/_LogBlock.cshtml", new LogModel()
            {
                Tables = manager.Result
            }));
        }
Ejemplo n.º 5
0
        public List <WebLogTable> Query2(WebLogTableData data)
        {
            string command = "";

            #region # sql command #

            command = " SELECT  "
                      + "wl.WebLogID, "
                      + "wl.Date, "
                      + "wl.Logger, "
                      + "wl.Message, "
                      + "wl.Exception, "
                      + "wl.Method, "
                      + "wl.Line "
                      + " FROM MobilePaywallLog.log.WebLogUserSessionMap AS map "
                      + " LEFT OUTER JOIN MobilePaywallLog.log.WebLog AS wl ON map.WebLogID=wl.WebLogID "
                      + " WHERE map.UserSessionID=" + data.SessionID + " AND "
                      + " map.Created >= '" + data.From + "' AND map.Created <= '" + data.To + "' "
                      + " ORDER BY wl.WebLogID ASC; ";

            #endregion

            this._result = new List <WebLogTable>();
            MobilePaywallLogDirect database = MobilePaywallLogDirect.Instance;
            database.SetTimeout(0);
            DataTable table = database.Load(command);
            if (table == null)
            {
                return(this._result);
            }

            foreach (DataRow row in table.Rows)
            {
                WebLogTable tableRow = new WebLogTable();
                tableRow.ID     = row[(int)WebLogColumns.ID].ToString();
                tableRow.Date   = row[(int)WebLogColumns.Date].ToString();
                tableRow.Logger = row[(int)WebLogColumns.Logger].ToString();

                tableRow.Message = row[(int)WebLogColumns.Message].ToString();
                string exeption = row[(int)WebLogColumns.Exception].ToString();
                if (!string.IsNullOrEmpty(exeption))
                {
                    tableRow.Message += Environment.NewLine + Environment.NewLine + "<<<<<<<<<<<<<<<<: EXCEPTION:" + Environment.NewLine + exeption;
                }

                tableRow.Method = row[(int)WebLogColumns.Method].ToString();
                tableRow.Line   = row[(int)WebLogColumns.Line].ToString();
                this._result.Add(tableRow);
            }

            return(this._result);
        }
Ejemplo n.º 6
0
        public List <WebLogTable> Query(WebLogTableData data)
        {
            string command = "";

            #region # sql command #
            command = " SELECT  " +
                      " FrameLogID AS 'ID', " +
                      " Created AS 'Date', " +
                      " Code AS 'Code', " +
                      " Text AS 'Text',  " +
                      " Scenario, " +
                      " ConfigurationID, " +
                      " CarrierID, " +
                      " CountryID, " +
                      " TemplateID " +
                      " FROM Clickenzi.FrameLog " +
                      " WHERE Pxid=" + data.SessionID + " " +
                      " AND Created >='" + data.From + "' AND Created <= '" + data.To + "' " +
                      " ORDER BY FrameLogID DESC; ";
            #endregion

            this._result = new List <WebLogTable>();

            ClickenziDirect db    = ClickenziDirect.Instance;
            DataTable       table = db.Load(command);
            if (table == null)
            {
                return(this._result);
            }

            foreach (DataRow row in table.Rows)
            {
                WebLogTable tableRow = new WebLogTable();

                tableRow.ID      = !string.IsNullOrEmpty(row[(int)OverlayColumns.ID].ToString()) ? row[(int)OverlayColumns.ID].ToString() : (string)null;
                tableRow.Date    = !string.IsNullOrEmpty(row[(int)OverlayColumns.Created].ToString()) ? row[(int)OverlayColumns.Created].ToString() : (string)null;
                tableRow.Logger  = !string.IsNullOrEmpty(row[(int)OverlayColumns.Code].ToString()) ? row[(int)OverlayColumns.Code].ToString() : (string)null;
                tableRow.Message = "Scenario: " + (!string.IsNullOrEmpty(row[(int)OverlayColumns.Scenario].ToString()) ? row[(int)OverlayColumns.Scenario].ToString() : "") + "\r\n" +
                                   "Configuration: " + (!string.IsNullOrEmpty(row[(int)OverlayColumns.Configuration].ToString()) ? row[(int)OverlayColumns.Configuration].ToString() : "") + "\r\n" +
                                   "Carrier: " + (!string.IsNullOrEmpty(row[(int)OverlayColumns.Carrier].ToString()) ? row[(int)OverlayColumns.Carrier].ToString() : "") + "\r\n" +
                                   "Country: " + (!string.IsNullOrEmpty(row[(int)OverlayColumns.Country].ToString()) ? row[(int)OverlayColumns.Country].ToString() : "") + "\r\n" +
                                   "Template: " + (!string.IsNullOrEmpty(row[(int)OverlayColumns.Template].ToString()) ? row[(int)OverlayColumns.Template].ToString() : "") + "\r\n" +
                                   (!string.IsNullOrEmpty(row[(int)OverlayColumns.Text].ToString()) ? row[(int)OverlayColumns.Text].ToString() : "");

                this._result.Add(tableRow);
            }

            return(this._result);
        }
Ejemplo n.º 7
0
        // SUMMARY: Sql for getting all records for the click
        public List <WebLogTable> Query(WebLogTableData data, string UseRefence)
        {
            string command = "";

            #region # sql command #
            if (UseRefence.Equals("true"))
            {
                command = " SELECT " +
                          " rm.RawMessageID AS 'ID', " +
                          " rm.GroupKey AS 'Logger', " +
                          " rm.Thread, " +
                          " rm.RawMessageData AS 'Message', " +
                          " rm.Created AS 'Date'" +
                          " FROM [Cashflow].[log].[RawMessage] AS rm " +
                          " INNER JOIN [Cashflow].[core].[ActionContext] AS ac ON rm.ActionContextID = ac.ActionContextID " +
                          " INNER JOIN [Cashflow].[core].[ActionContextGroup] AS acg ON ac.ActionContextGroupID = acg.ActionContextGroupID " +
                          " WHERE acg.ActionContextGroupID = (SELECT TOP 1 acg1.ActionContextGroupID FROM [Cashflow].[log].[RawMessage] AS rm1 " +
                          " 															    INNER JOIN [Cashflow].[core].[ActionContext] AS ac1 ON rm1.ActionContextID = ac1.ActionContextID "+
                          " 								                  INNER JOIN [Cashflow].[core].[ActionContextGroup] AS acg1 ON ac1.ActionContextGroupID = acg1.ActionContextGroupID "+
                          " 																  WHERE "+
                          "                                   rm1.Created >= '" + data.From.ToString() + "' AND rm1.Created <= '" + data.To.ToString() + "' " +
                          " 																	AND rm1.RawMessageData LIKE '%"+ data.SessionGuid + "%') " +
                          " ORDER BY rm.Created ASC ";
            }
            else
            {
                command = " SELECT " +
                          " rm.RawMessageID AS 'ID', " +
                          " rm.GroupKey AS 'Logger', " +
                          " rm.Thread, " +
                          " rm.RawMessageData AS 'Message', " +
                          " rm.Created AS 'Date' " +
                          " FROM Cashflow.core.IdentificationSession AS ids " +
                          " LEFT OUTER JOIN Cashflow.core.ActionContext AS ac ON ids.ActionContextID=ac.ActionContextID " +
                          " LEFT OUTER JOIN Cashflow.core.ActionContextGroup AS acg ON ac.ActionContextGroupID=acg.ActionContextGroupID " +
                          " LEFT OUTER JOIN Cashflow.core.ActionContext AS ac2 ON acg.ActionContextGroupID=ac2.ActionContextGroupID " +
                          " LEFT OUTER JOIN Cashflow.log.RawMessage AS rm ON rm.ActionContextID=ac2.ActionContextID " +
                          " WHERE " +
                          " ids.IdentificationSessionGuid='" + data.SessionGuid + "' " +
                          " AND rm.Created >= '" + data.From.ToString() + "' AND rm.Created <= '" + data.To.ToString() + "' " +
                          " ORDER BY rm.Created ASC; ";
            }
            #endregion

            this._result = new List <WebLogTable>();
            DirectContainer container = CashflowDirect.Instance.LoadContainer(command);
            this._result = container.ConvertList <WebLogTable>();
            return(this._result);
        }
Ejemplo n.º 8
0
        public List <WebLogTable> QueryByReferenceIntID(WebLogTableData data)
        {
            string command = "";

            #region # sql command #
            command = @"SELECT rm.RawMessageID AS 'ID',  rm.GroupKey AS 'Logger',  rm.Thread,  rm.RawMessageData AS 'Message',  rm.Created AS 'Date'  
        FROM Cashflow.core.ActionContextGroupReferenceMap AS map 
        LEFT OUTER JOIN Cashflow.core.ActionContext AS c ON map.ActionContextGroupID=c.ActionContextGroupID
        LEFT OUTER JOIN Cashflow.log.RawMessage AS rm ON rm.ActionContextID=c.ActionContextID
        WHERE map.ReferenceIntID=" + data.SessionID + "  AND rm.RawMessageID IS NOT NULL ;";
            #endregion

            this._result = new List <WebLogTable>();
            DirectContainer container = CashflowDirect.Instance.LoadContainer(command);
            this._result = container.ConvertList <WebLogTable>();
            return(this._result);
        }
Ejemplo n.º 9
0
        public List <UserRequestTable> Query(WebLogTableData data)
        {
            string command = "";

            #region # command #
            command = " SELECT " +
                      " 	uhr.RequestedUrl, "+
                      "   uhr.Created " +
                      " FROM  " +
                      " MobilePaywall.core.UserHttpRequest AS uhr " +
                      " LEFT OUTER JOIN MobilePaywall.core.UserSession AS us ON uhr.UserSessionID=us.UserSessionID " +
                      " WHERE us.UserSessionID='" + data.SessionID + "' " +
                      " ORDER BY uhr.Created DESC; ";
            #endregion

            DirectContainer container = MobilePaywallDirect.Instance.LoadContainer(command);
            this._result = container.ConvertList <UserRequestTable>();
            return(this._result);
        }
Ejemplo n.º 10
0
        public List <WebLogTable> QueryBySubscriptionRequestGuid(WebLogTableData data)
        {
            string command = "";

            #region # sql command #
            command = @"SELECT  rm.RawMessageID AS 'ID',  rm.GroupKey AS 'Logger',  rm.Thread,  rm.RawMessageData AS 'Message',  rm.Created AS 'Date'  
       FROM Cashflow.core.SubscriptionRequest AS sr
       LEFT OUTER JOIN Cashflow.core.ActionContext AS ac ON sr.ActionContextID=ac.ActionContextID  
       LEFT OUTER JOIN Cashflow.core.ActionContextGroup AS acg ON ac.ActionContextGroupID=acg.ActionContextGroupID  
       LEFT OUTER JOIN Cashflow.core.ActionContext AS ac2 ON acg.ActionContextGroupID=ac2.ActionContextGroupID  
       LEFT OUTER JOIN Cashflow.log.RawMessage AS rm ON rm.ActionContextID=ac2.ActionContextID  
       WHERE  sr.SubscriptionRequestGuid='" + data.SessionID + "' AND rm.RawMessageID IS NOT NULL ORDER BY rm.Created ASC;";
            #endregion

            this._result = new List <WebLogTable>();
            DirectContainer container = CashflowDirect.Instance.LoadContainer(command);
            this._result = container.ConvertList <WebLogTable>();
            return(this._result);
        }
Ejemplo n.º 11
0
        public List <WebLogTable> QueryLogDatabase(WebLogTableData data)
        {
            DirectDatabaseMsSql database = MobilePaywallLogDirect.Instance;

            // first we check if data is stored in log database
            int?check = database.LoadInt(string.Format(@"
        SELECT COUNT(*) FROM MobilePaywallLog.log.WebLog AS log
        LEFT OUTER JOIN MobilePaywallLog.log.WebLogUserSessionMap AS map ON map.WebLogID=log.WebLogID
        WHERE map.UserSessionID={0}", data.SessionID));

            if (!check.HasValue || check.Value == 0)
            {
                database = MobilePaywallBackupDirect.Instance;
            }


            string command = "";

            #region # sql command #

            command = " SELECT  "
                      + "wl.WebLogID, "
                      + "wl.Date, "
                      + "wl.Logger, "
                      + "wl.Message, "
                      + "wl.Exception, "
                      + "wl.Method, "
                      + "wl.Line "
                      + " FROM MobilePaywall.log.WebLogUserSessionMap AS map "
                      + " LEFT OUTER JOIN MobilePaywall.log.WebLog AS wl ON map.WebLogID=wl.WebLogID "
                      + " WHERE map.UserSessionID=" + data.SessionID + " AND "
                      + " map.Created >= '" + data.From + "' AND map.Created <= '" + data.To + "' "
                      + " ORDER BY wl.WebLogID ASC; ";

            #endregion

            this._result = new List <WebLogTable>();
            database.SetTimeout(0);
            DataTable table = database.Load(command);
            if (table == null)
            {
                return(this._result);
            }

            foreach (DataRow row in table.Rows)
            {
                WebLogTable tableRow = new WebLogTable();
                tableRow.ID     = row[(int)WebLogColumns.ID].ToString();
                tableRow.Date   = row[(int)WebLogColumns.Date].ToString();
                tableRow.Logger = row[(int)WebLogColumns.Logger].ToString();

                tableRow.Message = row[(int)WebLogColumns.Message].ToString();
                string exeption = row[(int)WebLogColumns.Exception].ToString();
                if (!string.IsNullOrEmpty(exeption))
                {
                    tableRow.Message += Environment.NewLine + Environment.NewLine + "<<<<<<<<<<<<<<<<: EXCEPTION:" + Environment.NewLine + exeption;
                }

                tableRow.Method = row[(int)WebLogColumns.Method].ToString();
                tableRow.Line   = row[(int)WebLogColumns.Line].ToString();
                this._result.Add(tableRow);
            }

            return(this._result);
        }