public static void LoadValues(VerPizza form, Pizza Pizza)
        {
            form.nombrePizza.Text = Pizza.Nombre;
            try
            {
                form.fotoPizza.Image = Image.FromFile(Pizza.Foto);
            }
            catch (Exception)
            {
                MessageBox.Show("Imagen no encontrada");
            }
            form.precioPizza.Text     = Pizza.Precio.ToString();
            form.ingredientsText.Text = Pizza.Ingredientes;

            form.lastComment.Text            = GetLastPizzaComent.GetComment(Pizza.Id).Texto;
            form.fechaText.Text              = GetLastPizzaComent.GetComment(Pizza.Id).Fecha.ToString();
            form.textoUsuarioComentario.Text = GetLastPizzaComent.GetComment(Pizza.Id).Usuario.ToString();
        }
Exemple #2
0
        public static void LoadValues(PizzaDetail form, Pizza Pizza)
        {
            //TODO Reformar metodo para que no llame 3 veces a a getlastpizzacomment.getcomment
            form.nombrePizza.Content = Pizza.Nombre;
            try
            {
                BitmapImage bp = new BitmapImage();
                bp.UriSource      = new Uri(Pizza.Foto);
                form.image.Source = bp;
            }
            catch (Exception)
            {
                MessageBox.Show("Imagen no encontrada");
            }
            form.precioPizza.Content         = Pizza.Precio.ToString();
            form.ingredientsText.ItemsSource = Pizza.Ingredientes;

            form.lastComment.Text = GetLastPizzaComent.GetComment(Pizza.Id).Texto;
            form.fechaText.Text   = GetLastPizzaComent.GetComment(Pizza.Id).Fecha.ToString();
            form.nombreUser.Text  = GetLastPizzaComent.GetComment(Pizza.Id).Usuario.ToString();
        }