コード例 #1
0
        private clsAllBook BuildBook(int prQuantity)
        {
            clsAllBook lcBook = new clsAllBook();

            lcBook.ISBN     = _Book.ISBN;
            lcBook.Quantity = prQuantity;
            return(lcBook);
        }
コード例 #2
0
        internal async static Task <string> DeleteBookAsync(clsAllBook prBook)
        {
            using (HttpClient lcHttpClient = new HttpClient())
            {
                HttpResponseMessage lcRespMessage = await lcHttpClient.DeleteAsync
                                                        ($"http://localhost:60064/api/bookstore/DeleteBook?prName=" + prBook.Name);

                return(await lcRespMessage.Content.ReadAsStringAsync());
            }
            throw new NotImplementedException();
        }
コード例 #3
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            if (e.Parameter != null)
            {
                string lcBookName = e.Parameter.ToString();
                _Book = await ServiceClient.GetBookAsync(lcBookName);

                dispatchBookContent(_Book);
                updateDisplay();
            }
        }
コード例 #4
0
 private void btnSelect_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         clsAllBook lcBook = (clsAllBook)lstGenreBooks.SelectedItem;
         string     lcName = lcBook.Name;
         this.Frame.Navigate(typeof(pgBook), lcName);
     }
     catch (Exception)
     {
     }
 }
コード例 #5
0
        private async void sendOrder()
        {
            try
            {
                setOrder();
                clsAllBook lcBook = BuildBook(Convert.ToInt32(tbxQuantity.Text));
                await ServiceClient.UpdateBookQuantityAsync(lcBook);

                await ServiceClient.InsertOrderAsync(_Order);

                var dialogOrderComplete = new MessageDialog("Order Completed successfully, Confirmation email sent to: " + tbxCustEmailAddress.Text);
                await dialogOrderComplete.ShowAsync();

                this.Frame.Navigate(typeof(pgMain));
            }
            catch (Exception)
            {
            }
        }
コード例 #6
0
 private void dispatchBookContent(clsAllBook prBook)
 {
     _BooksContent[prBook.BookFormat].DynamicInvoke(prBook);
     updatePage(prBook);
 }
コード例 #7
0
 private void updatePage(clsAllBook prBook)
 {
     (ctcBookSpecs.Content as IBookControl).UpdateControl(prBook);
 }
コード例 #8
0
 private void RunPhysical(clsAllBook prBook)
 {
     ctcBookSpecs.Content = new ucPhysical();
 }
コード例 #9
0
 private void RunDigital(clsAllBook prBook)
 {
     ctcBookSpecs.Content = new ucDigital();
 }
コード例 #10
0
 public void UpdateControl(clsAllBook prBook)
 {
     txtQuantity.Text  = "Quantity: " + prBook.Quantity.ToString();
     txtCoverType.Text = "Cover Type: " + prBook.CoverType;
 }
コード例 #11
0
 internal async static Task <string> InsertBookAsync(clsAllBook _Book)
 {
     return(await InsertOrUpdateAsync(_Book, "http://localhost:60064/api/bookstore/PostBook", "POST"));
 }
コード例 #12
0
 internal async static Task <string> UpdateBookQuantityAsync(clsAllBook _Book)
 {
     return(await InsertOrUpdateAsync(_Book, "http://localhost:60064/api/bookstore/PutBookQuantity", "PUT"));
 }
コード例 #13
0
 public void UpdateControl(clsAllBook prBook)
 {
     txtDownloadURL.Text = "Download URL: " + prBook.DownloadURL;
 }