Classes/MsUpCatResponse.Class.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class MsUpCatResponse {
    [HtmlAgilityPack.HtmlNodeCollection] $Rows
    [string] $EventArgument
    [string] $EventValidation
    [string] $ViewState
    [string] $ViewStateGenerator
    [string] $NextPage

    MsUpCatResponse($HtmlDoc) {
        $Table = $HtmlDoc.GetElementbyId("ctl00_catalogBody_updateMatches")
        $this.Rows = $Table.SelectNodes("tr")
        $this.EventArgument = $HtmlDoc.GetElementbyId("__EVENTARGUMENT")[0].Attributes["value"].Value
        $this.EventValidation = $HtmlDoc.GetElementbyId("__EVENTVALIDATION")[0].Attributes["value"].Value
        $this.ViewState = $HtmlDoc.GetElementbyId("__VIEWSTATE")[0].Attributes["value"].Value
        $this.ViewStateGenerator = $HtmlDoc.GetElementbyId("__VIEWSTATEGENERATOR")[0].Attributes["value"].Value
        $this.NextPage = $HtmlDoc.GetElementbyId("ctl00_catalogBody_nextPage")
    }
}