コード例 #1
0
        public ActionResult GetOLInfo(string uid)
        {
            int usid = -1;

            if (!Int32.TryParse(uid, out usid))
            {
                return(this.Content("Parse error"));
            }

            UserSession us = UserSession.CreateManager().Load(usid);

            if (us == null)
            {
                return(this.Content("User session error"));
            }

            DirectContainer olContainer = (new MobilePaywallDirect()).LoadContainer(@"SELECT c.SessionCreated, c.Msisdn, c.CountryCode, c.Pxid, c.ServiceName, c.MobileOperatorName, c.IPAddress, prs.Name AS 'PaymentRequestStatus', 
              ps.Name AS 'PaymentStatus', p.Created AS 'PaymentCreated', c.PaymentContentAccessPolicyID AS 'AccessPolicy', c.TransactionID, c.Created AS 'TransactionCreated'
         FROM MobilePaywall.core.OLCache AS c
         LEFT OUTER JOIN MobilePaywall.core.PaymentRequest AS pr ON c.PaymentRequestID=pr.PaymentRequestID
         LEFT OUTER JOIN MobilePaywall.core.PaymentRequestStatus AS prs ON pr.PaymentRequestStatusID=prs.PaymentRequestStatusID
         LEFT OUTER JOIN MobilePaywall.core.Payment AS p ON c.PaymentID=p.PaymentID
         LEFT OUTER JOIN MobilePaywall.core.PaymentStatus AS ps ON p.PaymentStatusID=ps.PaymentStatusID
         WHERE c.UserSessionID=" + uid + " AND IsSubseguent=0 ORDER BY c.OLCacheID DESC");

            if (olContainer == null)
            {
                return(this.Content("No Data"));
            }

            OLCacheModel model = olContainer.Convert <OLCacheModel>();

            return(PartialView("~/Views/Report/_OLBlock.cshtml", model));
        }