protected void btnAuthorFirst_Click(object sender, EventArgs e) { // Web Service methods are available webService.methodName() from this instance var webService = new BooksWebServiceProxy.BooksWebServiceSoapClient(); // look in the Web Service for more information on the methods used try { var authorData = webService.getFirstAuthor(); lblAuthorID.Text = authorData.AuthorId.ToString(); txtAuthorName.Text = authorData.AuthorName.ToString(); lblAddEditStatus.Text = "First Author"; } catch { lblAddEditStatus.Text = "Could not find first Author"; } }
protected void btnAuthorPrevious_Click(object sender, EventArgs e) { // Web Service methods are available webService.methodName() from this instance var webService = new BooksWebServiceProxy.BooksWebServiceSoapClient(); // here I get the minId value from the first author var getMin = webService.getFirstAuthor(); // then store it in minId to be used in the getPreviousAuthor method var minId = getMin.AuthorId.ToString(); // look in the Web Service for more information on the methods used var authorData = webService.getPreviousAuthor(lblAuthorID.Text, minId); if (long.Parse(lblAuthorID.Text) <= long.Parse(minId)) { lblAddEditStatus.Text = "This is the first Author"; } else { lblAuthorID.Text = authorData.AuthorId.ToString(); txtAuthorName.Text = authorData.AuthorName.ToString(); lblAddEditStatus.Text = "Previous Author"; } }