﻿Imports System.Net
Imports System.IO

Partial Class dillners_add_new_license
    Inherits System.Web.UI.Page

    Protected Sub CreateLicenseBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateLicenseBtn.Click
        Dim ws As WebWS = New WebWS()

        ws.InsertDillnerLicense(licenseNumberTxt.Value, clientNameTxt.Value + "")

        Dim httpUtil As com.racadtech.Framework.Util.Http.HttpUtil = New com.racadtech.Framework.Util.Http.HttpUtil()

        Dim URL As String = "http://services.racadtech.com/RacadService/DilnerVOAPI.aspx?key=432haz8-3jz82zdklxk-42-zm032k3&dKey=" & licenseNumberTxt.Value

        'Response.Write("URL = " & URL )
        Dim _request As HttpWebRequest = HttpWebRequest.Create(URL)
        _request.Method = WebRequestMethods.Http.Post
        _request.ContentLength = 0
        Dim _response As HttpWebResponse = _request.GetResponse()
        Dim _reader As New StreamReader(_response.GetResponseStream())
        Dim _tmp As String = _reader.ReadToEnd()
        _response.Close()
        'Response.Write(_tmp)

        stylized.Visible = False

        workingDiv.Visible = True

        Response.AddHeader("REFRESH", "90;URL=admin.aspx")
    End Sub
End Class
