Ejemplo n.º 1
0
    protected void btnUnSubscription_OnClick(object sender, EventArgs e)
    {
        SendService sendService = new SendService();
        string      endUserId   = string.Empty;



        try
        {
            endUserId = Request.QueryString["endUserId"].ToString();
        }
        catch (Exception exception)
        {
            endUserId = "";
        }
        string query = @"SELECT subscriptionId
  FROM[DPDP].[dbo].[tblBase]
  where ServiceId = '13' and MSISDN = '" + endUserId + "' and RegStatus = 1";

        object subscriptionId = new CDA().getSingleValue(query, "DPDP");

        string json = new JavaScriptSerializer().Serialize(new
        {
            Id             = "",
            servicekey     = "afef69c7cbbe4b55bb10d47dd5969677",
            endUserId      = endUserId,
            subscriptionId = subscriptionId.ToString(),
            accesschannel  = "WAP"
        });

        sendService.Send("http://192.168.14.16/DPDPClient/api/Unsubscribe", json);
        Thread.Sleep(5000);
        Response.Redirect("~/Default.aspx");
    }
Ejemplo n.º 2
0
        public async Task <ActionResult> Post([FromBody] EMailMessage emailMessage)
        {
            try
            {
                await _sendService.Send(emailMessage);
            }
            catch (Exception e)
            {
                return(BadRequest("Some problem occured at our side"));
            }

            return(Ok(new { message = "Message Sent Successfully" }));
        }
Ejemplo n.º 3
0
    //===================================ADDED=====================================
    protected void btnSubscription_OnClick(object sender, EventArgs e)
    {
        //============ORIGINAL
        string ip = oUAProfile.GetUserIP();
        //string ip = "119.30.39.251";
        //ORIGINAL==============================



        //string ip = "119.30.39.251";
        WebClient client         = new WebClient();
        string    downloadString = client.DownloadString("http://192.168.14.16/dpdpclient/api/RecognizeGPSubscribes?Ip=" + ip);

        if (!downloadString.Contains("True"))
        {
            //Response.Redirect("~/Nomsisdn1.aspx?sid=57");
            Response.Redirect("~/ErrorMessage.aspx");
        }

        //else
        //{
        //    Response.Redirect("~/Nomsisdn1.aspx?sid=57");
        //}


        string referenceCode = string.Empty;

        try
        {
            referenceCode = referenceCode = DateTime.Now.ToString("yyyyMMddHHmmssffffff"); //Request.QueryString["referenceCode"].ToString();
        }
        catch (Exception exception)
        {
            referenceCode = "";
        }

        SendService sendService = new SendService();

        string json = new JavaScriptSerializer().Serialize(new
        {
            code = "SUB00035204569183201251"
            ,
            amount = "2"
            ,
            taxAmount = "0.55"
            ,
            description = "Joss Body"
            ,
            servicekey = "afef69c7cbbe4b55bb10d47dd5969677"
            ,
            productId = "6610"
            ,
            type = "WAP"
            ,
            title = "Subscription"
            ,
            thumbnailUrl = "http://www.jossbody.com"
            ,
            successUrl = "http://182.160.119.238/jbtest",
            failureUrl = "http://www.jossbody.com",
            cancelUrl  = "http://www.jossbody.com"
            ,
            notifyUrl = "http://funkhobor.com/NotifyUrl.aspx"
            ,
            downloadUrl = "http://www.jossbody.com"
            ,
            referenceCode = referenceCode
        });


        ApiResult apiResult = sendService.Send("http://192.168.14.16/DPDPClient/api/GetChargingURL", json);

        string res = apiResult.Result.Replace("\"", "");

        if (!string.IsNullOrWhiteSpace(res))
        {
            Response.Redirect(res);
        }
    }
Ejemplo n.º 4
0
    private void CheckGPUser()
    {
        string serviceName    = string.Empty;
        string SOURCE_URL     = System.Web.HttpContext.Current.Request.Url.AbsoluteUri;
        string PORTAL_N_SHORT = "JossVideo/JV";
        string ContentCate    = string.Empty;

        try
        {
            string contcat = Request.QueryString["cat"].ToString();
            if (contcat == "more")
            {
                ContentCate = "&cat=more";
            }
        }
        catch { }

        try
        {
            string GPBC = Request.QueryString["source"].ToString();
            if (GPBC == "GP")
            {
                SOURCE_URL = "GP";
            }
        }
        catch { }

        //STEP1:Check Subscriber Status: Y or N. Y= LIVE & N=NOT LIVE
        subscriberLive = SubscriberStatus(sMsisdn);
        if (subscriberLive == "N" || subscriberLive == "")
        {
            //string ip = "119.30.39.250";
            string ip = oUAProfile.GetUserIP();
            //ip = "37.111.233.51";
            WebClient client         = new WebClient();
            string    downloadString = client.DownloadString("http://192.168.14.16/dpdpclient/api/RecognizeGPSubscribes?Ip=" + ip);

            if (!downloadString.Contains("True"))
            {
                Response.Redirect("~/ErrorMessage.aspx");
            }



            //Response.Redirect("~/Default.aspx");

            string referenceCode = string.Empty;
            try
            {
                referenceCode = DateTime.Now.ToString("yyyyMMddHHmmssffffff");
                //      Session["referenceCode"].ToString();
            }
            catch (Exception exception)
            {
                referenceCode = "";
            }

            SendService sendService = new SendService();

            string json = new JavaScriptSerializer().Serialize(new
            {
                code = "SUB00035204569183201251"
                ,
                amount = "2"
                ,
                taxAmount = "0.55"
                ,
                description = "Joss Body"
                ,
                servicekey = "afef69c7cbbe4b55bb10d47dd5969677"
                ,
                productId = "6610"
                ,
                type = "WAP"
                ,
                title = "Subscription"
                ,
                thumbnailUrl = "http://www.jossbody.com"
                ,
                successUrl = "http://www.jossbody.com",
                failureUrl = "http://www.jossbody.com",
                cancelUrl  = "http://www.jossbody.com"
                ,
                notifyUrl = "http://funkhobor.com/NotifyUrl.aspx"
                ,
                downloadUrl = "http://www.jossbody.com"
                ,
                referenceCode = referenceCode
            });


            ApiResult apiResult = sendService.Send("http://192.168.14.16/DPDPClient/api/GetChargingURL", json);

            string res = apiResult.Result.Replace("\"", "");

            if (!string.IsNullOrWhiteSpace(res))
            {
                Response.Redirect(res);
            }
        }
    }