コード例 #1
0
ファイル: frmEditBook.cs プロジェクト: PamyEd/BookWorld
        public async void UpdateDisplay(string prBookId)
        {
            _Book = await ServiceClient.GetBooksDetailsAsync(prBookId);

            txtBookId.Text       = _Book.BookId.ToString();
            tbBookName.Text      = _Book.BookName;
            txtAuthor.Text       = _Book.AuthorName;
            txtISBN.Text         = _Book.ISBN.ToString();
            rtbDesc.Text         = _Book.BookDesc;
            tbPrice.Text         = _Book.Price.ToString();
            tbItemLeft.Text      = _Book.BooksLeft.ToString();
            ddlType.SelectedItem = _Book.Condition;

            ddlGenre.DataSource = null;
            ddlGenre.DataSource = await ServiceClient.GetGenreNamesAsync();

            string genre = await ServiceClient.GetGenreNameAsync(_Book.GenreId.ToString());

            ddlGenre.Text = genre;

            cbAntique.Checked = bool.Parse(_Book.Antique.ToString());
            if (_Book.Package == "Paperback")
            {
                ddlPackage.SelectedIndex = 0;
            }
            else
            {
                ddlPackage.SelectedIndex = 1;
            }
            txtWeight.Text = _Book.Weight.ToString();
        }
コード例 #2
0
ファイル: ServiceClient.cs プロジェクト: PamyEd/BookWorld
 internal async static Task <string> UpdateBookAsync(clsBook prBook)
 {
     return(await InsertOrUpdateAsync(prBook, "http://localhost:60064/api/book/UpdateBook", "POST"));
 }