示例#1
0
        protected void btnAuthorLast_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.getLastAuthor();
                lblAuthorID.Text      = authorData.AuthorId.ToString();
                txtAuthorName.Text    = authorData.AuthorName.ToString();
                lblAddEditStatus.Text = "Last Author";
            }
            catch
            {
                lblAddEditStatus.Text = "Could not find last Author";
            }
        }
示例#2
0
        protected void btnAuthorNext_Click(object sender, EventArgs e)
        {
            // Web Service methods are available webService.methodName() from this instance
            var webService = new BooksWebServiceProxy.BooksWebServiceSoapClient();

            // here I get the maxId value from the last author
            var getMax = webService.getLastAuthor();
            // then store it in minId to be used in the getNextAuthor method
            var maxId = getMax.AuthorId.ToString();

            // look in the Web Service for more information on the methods used
            if (long.Parse(lblAuthorID.Text) >= long.Parse(maxId))
            {
                lblAddEditStatus.Text = "This is the last Author";
            }
            else
            {
                var authorData = webService.getNextAuthor(lblAuthorID.Text, maxId);
                lblAuthorID.Text      = authorData.AuthorId.ToString();
                txtAuthorName.Text    = authorData.AuthorName.ToString();
                lblAddEditStatus.Text = "Next Author";
            }
        }