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");
    }