/// <summary> /// confirms order and /// </summary> private async void confirmOrder() { clsOrder lcOrder = new clsOrder { orderDate = DateTime.Now, custPhone = txtMobileNumber.Text, custName = txtName.Text, qty = Convert.ToInt16(txtQty.Text), pricePerItem = _Book.price, FKBookID = _Book.bookID }; MessageDialog dialog = new MessageDialog(await ServiceClient.InsertOrder(lcOrder)); dialog.Commands.Add(new UICommand("OK", null)); dialog.DefaultCommandIndex = 0; var cmd = await dialog.ShowAsync(); _Book = await ServiceClient.GetCurrentBook(_Book.bookID); dispatchBookContent(_Book); if (dialog.Content != "\"Sorry but there is insufficient stock for this order, please review the stock level change.\"") { Frame.Navigate(typeof(pgConfirmed), _Book); } }
private void dispatchBookContent(clsBook prBook) { try { _BookContent[Convert.ToChar(prBook.bookType)].DynamicInvoke(prBook); } catch { } updatePage(prBook); }
public void UpdateControl(clsBook prBook) { if (prBook.hardback == true) { txtHardback.Text = "Yes"; } else { txtHardback.Text = "No"; } }
/// <summary> /// updates current page data /// </summary> /// <param name="prBook"></param> private void updatePage(clsBook prBook) { _Book = prBook; txtbTitle.Text = _Book.bookName; txtbAuthor.Text = _Book.author; txtbPrice.Text = string.Format("{0:0.00}", _Book.price); txtStock.Text = _Book.stockLevel.ToString(); txtDescription.Text = _Book.description; (ccInheritedAttribute.Content as IBookControl).UpdateControl(prBook); //convert total to text field only if txtqty is not empty updateOrderTotal(); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.Parameter != null) { clsBook lcBook = (clsBook)e.Parameter; _Book = lcBook; } else { Frame.GoBack(); } }
private void RunPhysicalBook(clsBook prBook) { ccInheritedAttribute.Content = new ucPhysicalBook(); }
private void RunEbook(clsBook prBook) { ccInheritedAttribute.Content = new ucEbook(); }
public void UpdateControl(clsBook prBook) { txtFormat.Text = prBook.ebookFormat; }