using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using cosicomodo.quantycaReference;

namespace cosifacile
{
    /// <summary>
    /// Logica di interazione per substituteElement.xaml
    /// </summary>
    public partial class substituteElement : UserControl
    {
        public substituteElement()
        {
            InitializeComponent();
        }

        public substituteElement(articoloOrdineType art)
        {
            InitializeComponent();
            lblnf.Text = art.descrizioneArticoloOriginale;
            lblnfq.Content = art.articoloSostituzioni.quantitaOriginaleRichiesta.ToString();
            lblnfp.Visibility = System.Windows.Visibility.Hidden;

            lblsub.Text = art.articoloEsteso.descrizioneArticolo; //art.articoloEsteso.descrizioneArticolo;
            lblsubq.Content = art.articoloBase.quantita.ToString();
            lblsubp.Content = art.articoloEsteso.importoLordoTotale.ToString();

            var image = new Image();
            var fullFilePath = art.articoloBase.note;
            try
            {
            BitmapImage bitmap = new BitmapImage();

                bitmap.BeginInit();
                bitmap.UriSource = new Uri(fullFilePath, UriKind.Absolute);
                bitmap.EndInit();
                placeholdersub.Source = bitmap;
            }
            catch (Exception ex)
            {
                
            }


        }
    }
}
