/// <summary> /// /// </summary> /// <param name="customerInformation"></param> private void UpdateCustomer(Customer customerInformation) { Information.CustomerId = customerInformation.Id; Information.CustomerName = customerInformation.Name; customerEmail.Text = customerInformation.Email; customerLocation.Text = customerInformation.Location; customerGuid.Text = LibrettoCommon.FormatGuid(customerInformation.Id); }
/// <summary> /// /// </summary> /// <param name="bookInformation"></param> private void UpdateBook(Book bookInformation) { _bookInformation = bookInformation; bookGuid.Text = LibrettoCommon.FormatGuid(bookInformation.Id); bookStock.Text = Convert.ToString(bookInformation.Stock); bookPrice.Text = LibrettoCommon.FormatDecimal(bookInformation.Price); Information.BookTitle = bookInformation.Title; Information.BookId = bookInformation.Id; UpdateStock(orderQuantity.Value); }
/// <summary> /// /// </summary> /// <param name="bookInformation"></param> private void UpdateBook(Book bookInformation) { _bookInformation = bookInformation; purchaseQuantity.Minimum = 1; purchaseQuantity.Maximum = bookInformation.Stock; Information.BookId = bookInformation.Id; Information.BookTitle = bookInformation.Title; bookStock.Text = Convert.ToString(bookInformation.Stock); bookGuid.Text = LibrettoCommon.FormatGuid(bookInformation.Id); bookPrice.Text = LibrettoCommon.FormatDecimal(bookInformation.Price); UpdateQuantity(purchaseQuantity.Value); }
/// <summary> /// /// </summary> /// <param name="bookInformation"></param> /// <returns></returns> private static ListViewItem ParseBook(Book bookInformation) { return(new ListViewItem(LibrettoCommon.FormatGuid(bookInformation.Id)) { Tag = bookInformation, SubItems = { bookInformation.Title, LibrettoCommon.FormatCurrency(bookInformation.Price), Convert.ToString(bookInformation.Stock) } }); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void CustomerForm_Load(object sender, EventArgs args) { buttonConfirm.Enabled = ValidateForm(); guidField.Text = LibrettoCommon.FormatGuid(Information.Id); }