private void SetUpEditQuotePopup() { editQuotePopup = new EditQuotePopup(); editQuotePopup.SetEditQuotePopupChange(""); salesDocumentPageGrid.Children.Add(editQuotePopup, 0, 0); editQuotePopup.OnCancelButtonClicked += OnCancelButtonClickedEvent; editQuotePopup.OnRemoveButtonClicked += OnRemoveButtonClickedEvent; editQuotePopup.OnConfirmButtonClicked += OnConfirmButtonClickedEvent; }
private void SetUpEditQuotePopup() { editQuotePopup = new EditQuotePopup(); boxBackground = new BoxView { Color = Color.Black, Opacity = 0, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, IsVisible = false, }; editQuotePopup.SetEditQuotePopupChange(""); salesDocumentPageGrid.Children.Add(boxBackground, 0, 0); salesDocumentPageGrid.Children.Add(editQuotePopup, 0, 0); editQuotePopup.OnCancelButtonClicked += OnCancelButtonClickedEvent; editQuotePopup.OnRemoveButtonClicked += OnRemoveButtonClickedEvent; editQuotePopup.OnConfirmButtonClicked += OnConfirmButtonClickedEvent; }
/// <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); } }