// SUMMARY: Report data from app that premium sms request is executed
        public ActionResult ReportPremiumSms()
        {
            string psmsRequestID = Request["psmsRequestID"] != null ? Request["psmsRequestID"].ToString() : string.Empty;

            if (string.IsNullOrEmpty(psmsRequestID))
            {
                Log.Error("ReportPremiumSms:: psmsRequestID is missing");
                return(this.Json(new { status = false, message = "Missing arguments" }, JsonRequestBehavior.AllowGet));
            }

            Log.Debug("ReportPremiumSms:: input:" + psmsRequestID);
            int _psmsr = -1;

            if (!Int32.TryParse(psmsRequestID, out _psmsr))
            {
                Log.Error("ReportPremiumSms:: psmsRequestID could not be parsed.. origina: " + psmsRequestID);
                return(this.Json(new { status = false, message = "Missing arguments" }, JsonRequestBehavior.AllowGet));
            }

            AndroidPremiumSmsRequest request = AndroidPremiumSmsRequest.CreateManager().Load(_psmsr);

            if (request == null)
            {
                Log.Error("ReportPremiumSms:: AndroidPremiumSmsRequest could not be loaded by ID: " + psmsRequestID);
                return(this.Json(new { status = false, message = "Missing arguments" }, JsonRequestBehavior.AllowGet));
            }

            request.IsProcessed = true;
            request.Update();

            return(this.Json(new { status = true }, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        private void ConstructPsmsCommand()
        {
            AndroidPremiumSmsRequest request = new AndroidPremiumSmsRequest(-1, this.AndroidClientSession, this._suitableService.ServiceData, false, false, DateTime.Now, DateTime.Now);

            request.Insert();

            string textMessage = string.Format("{0},{1} /s={1}", this._suitableService.Shortcode, this._suitableService.Keyword, request.ID);

            this._commandToExecute = string.Format("psms::{0}::{1}", textMessage, request.ID);
        }