Exemple #1
0
 private void ShowProductPreview(IBoodProduct prod)
 {
     if (previewForm == null || previewForm.IsDisposed)
     {
         previewForm = new ProductPreview();
     }
     previewForm.LoadIboodProduct(prod);
     previewForm.Show();
 }
 public void LoadIboodProduct(IBoodProduct prod)
 {
     IBoodProduct = prod;
     lblProductName.Text = prod.Name;
     lblRegularPrice.Text = prod.RegularPrice.ToString("c");
     lblOurPrice.Text = prod.OurPrice.ToString("c");
     lblShippingCost.Text = prod.ShippingCost.ToString("c");
     pictureBox1.LoadAsync(prod.ImageUri.ToString());
     btnAction.Enabled = prod.Status == ProductStatus.NotSoldOut;
     //btnAction.Text = prod.Status.ToString();
 }
Exemple #3
0
        void webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            tmrCheckIbood.Enabled = true;
            txtOutput.Text += "Done!" + Environment.NewLine;

            if (webBrowser.Document.Title == "Navigation Canceled")
            {
                txtOutput.Text += webBrowser.Document.Title + Environment.NewLine;
            }
            else
            {
                var prod = IBoodProduct.Create(webBrowser.Document);

                if (prod == null)
                    return;

                //txtOutput.Text += prod.ToString() + Environment.NewLine;

                if (lastProduct == null || lastProduct.Name != prod.Name)
                {
                    lastProduct = prod;

                    ShowProductPreview(prod);
                }
            }
        }