private static async Task <Object> getContactPersonPage(HtmlDocument htmlDocument) { ContactPerson profile = new ContactPerson(); profile.Name = htmlDocument.DocumentNode.SelectSingleNode("//input[@name='VenContactPerson']").Attributes["value"].Value; profile.TelephoneNo = htmlDocument.DocumentNode.SelectSingleNode("//input[@name='VenTelNo']").Attributes["value"].Value; profile.FaxNo = htmlDocument.DocumentNode.SelectSingleNode("//input[@name='VenFaxNo']").Attributes["value"].Value; profile.EmailAddress = htmlDocument.DocumentNode.SelectSingleNode("//input[@name='VenEmail']").Attributes["value"].Value; return(profile); }
public editContactPerson() { BindingContext = this; InitializeComponent(); //Sending HTTP request to obtain the company profile data Task <string> httpTask = Task.Run <string>(() => HttpRequestHandler.GetRequest("http://www2.sesco.com.my/etender/vendor/vendor_contact_edit.jsp", true)); var httpResult = httpTask.Result.ToString(); //Extract company profile data from the response //var profileData = DataExtraction.getWebData(httpResult, "userContactPerson"); var profileData = Task.Run <Object>(() => DataExtraction.getWebData(httpResult, "userContactPerson")); ContactPerson profile = (ContactPerson)profileData.Result; name.Text = profile.Name; telephoneNo.Text = profile.TelephoneNo; faxNo.Text = profile.FaxNo; emailAddress.Text = profile.EmailAddress; }