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); }
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); }
// 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); }
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); }
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); }
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); }
public List <WebLogTable> Query(string sessionID) { DirectDatabaseMsSql database = MobilePaywallLogDirect.Instance; // first we check if data is stored in log database int?check = database.LoadInt(string.Format(@" SELECT COUNT(*) FROM MobilePaywall.log.CallbackLog AS log LEFT OUTER JOIN MobilePaywall.log.CallbackLogUserSessionMap AS map ON map.CallbackLogID=log.CallbackLogID WHERE map.UserSessionID={0}", sessionID)); if (!check.HasValue || check.Value == 0) { database = MobilePaywallBackupDirect.Instance; } DirectContainer container = database.LoadContainer(@"SELECT c.CallbackLogID AS 'ID', c.Date, c.Logger, c.Message, c.Method, c.Line FROM MobilePaywall.log.CallbackLogUserSessionMap AS map LEFT OUTER JOIN MobilePaywall.log.CallbackLog AS c ON map.CallbackLogID=c.CallbackLogID WHERE map.UserSessionID=" + sessionID + ";"); return(container.ConvertList <WebLogTable>()); }