Example #1
0
 /// <summary>
 /// Edits the AddToQuote popup to have the correct labels, entry and button statess
 /// corresponding to the product and the user's new quote
 /// </summary>
 /// <param name="btnAddToQuote"></param>
 private void PrepareEditQuotePopup()
 {
     selectedProduct = Data.GetProductFromId(btnAddToQuote.ClassId);
     editQuotePopup.SetLabelProductName(selectedProduct.Description);
     editQuotePopup.SetBtnConfirmClassId(btnAddToQuote.ClassId);
     if (btnAddToQuote.Text == addToQuoteText)       // if this product hasn't been added to the quote yet and the "add to quote popup"
     {                                               // isn't in a fresh state, refresh the popup's state
         if (!popupIsNew)
         {
             editQuotePopup.newProduct = true;
             popupIsNew = true;
             editQuotePopup.SetEditQuotePopupNew();      // otherwise if the popup is in a fresh state but the user has this product added to quote already
         }
         editQuotePopup.EntryQuantityText = "";
     }                                               // change the popup to its editor state
     else if (popupIsNew)
     {
         string productQuantity = Data.newQuote.Products[selectedProduct].ToString();
         popupIsNew = false;
         editQuotePopup.newProduct = false;
         editQuotePopup.SetEditQuotePopupChange(productQuantity);
     }
 }
Example #2
0
 private void PrepareEditQuotePopup(Product product)
 {
     editQuotePopup.SetLabelProductName(product.Description);
     editQuotePopup.SetBtnConfirmClassId(product.Id.ToString());
     editQuotePopup.EntryQuantityText = Data.newQuote.Products[product].ToString();
 }