public ActionResult GetCashflowNewLog(WebLogTableData data)
        {
            MobilePaywallDirect db      = MobilePaywallDirect.Instance;
            CashflowLogManager  manager = new CashflowLogManager();

            manager.QueryByReferenceIntID(data);
            return(View("~/Views/Report/_LogBlock.cshtml", new LogModel()
            {
                Tables = manager.Result
            }));
        }
        public ActionResult Cashflow(EntranceTableData data)
        {
            if (data.Validation())
            {
                return(Content(string.Format("<b class=\"message_error\">Internal error. '{0}'</b>", data.ErrorMessage)));
            }

            CashflowLogManager     manager = new CashflowLogManager();
            CashflowStatisticModel model   = new CashflowStatisticModel(manager.Query(data, true));

            return(View("~/Views/Statistic/CashflowReport.cshtml", model));
        }
        // SUMMARY: Report -> Get cashflow logs for specific log
        public ActionResult GetCashflowLog(WebLogTableData data)
        {
            MobilePaywallDirect db      = MobilePaywallDirect.Instance;
            CashflowLogManager  manager = new CashflowLogManager();

            Guid?subscriptionRequestGuid = db.LoadGuid("SELECT ExternalPaymentRequestGuid FROM MobilePaywall.core.PaymentRequest WHERE ExternalPaymentRequestGuid IS NOT NULL AND UserSessionID=" + data.SessionID);

            if (subscriptionRequestGuid.HasValue)
            {
                data.SessionID = subscriptionRequestGuid.Value.ToString();
                manager.QueryBySubscriptionRequestGuid(data);
                return(View("~/Views/Report/_LogBlock.cshtml", new LogModel()
                {
                    Tables = manager.Result
                }));
            }

            Guid?identificationSession = db.LoadGuid("SELECT IdentificationSessionGuid FROM MobilePaywall.core.LookupSession WHERE IdentificationSessionGuid IS NOT NULL AND UserSessionID=" + data.SessionID);

            if (identificationSession.HasValue)
            {
                data.SessionID = identificationSession.Value.ToString();
                manager.QueryByIdentificationSessionGuid(data);
                return(View("~/Views/Report/_LogBlock.cshtml", new LogModel()
                {
                    Tables = manager.Result
                }));
            }

            Guid?referenceGuid = db.LoadGuid("SELECT UserSessionGuid FROM MobilePaywall.core.UserSession WHERE UserSessionID=" + data.SessionID);

            if (referenceGuid.HasValue)
            {
                data.SessionID = referenceGuid.ToString();
                manager.QueryByReferenceGuid(data);
                return(View("~/Views/Report/_LogBlock.cshtml", new LogModel()
                {
                    Tables = manager.Result
                }));
            }

            return(this.Content("Could not find referenceID"));
        }