コード例 #1
0
 private void AppButtonAgregar_Click(object sender, RoutedEventArgs e)
 {
     int cantidad = int.Parse(TextBoxCantidadProductos.Text);
     ProductoCantidad pc = new ProductoCantidad() { Producto = tmpProduct, Cantidad = cantidad };
     double PrecioU = GetPrecio(pc);
     double PrecioT = PrecioU * cantidad;
     NuevoRequestProduct = new RequestProduct {PName = tmpProduct.Name, PNItems =  cantidad, PPriceU = PrecioU, PPriceT = PrecioT, PurlImage = tmpProduct.Pictures.FirstOrDefault().URL};
     Pedido.Pedidos.Add(NuevoRequestProduct);
     AppButtonAgregar.IsEnabled = false;
 }
コード例 #2
0
        private double GetPrecio(ProductoCantidad x)
        {
            double precio = 0;

            foreach (var material in x.Producto.Materials)
            {
                precio += material.UnitPrice;
            }
            return(precio);
        }
コード例 #3
0
        private void AppButtonAgregar_Click(object sender, RoutedEventArgs e)
        {
            int cantidad        = int.Parse(TextBoxCantidadProductos.Text);
            ProductoCantidad pc = new ProductoCantidad()
            {
                Producto = tmpProduct, Cantidad = cantidad
            };
            double PrecioU = GetPrecio(pc);
            double PrecioT = PrecioU * cantidad;

            NuevoRequestProduct = new RequestProduct {
                PName = tmpProduct.Name, PNItems = cantidad, PPriceU = PrecioU, PPriceT = PrecioT, PurlImage = tmpProduct.Pictures.FirstOrDefault().URL
            };
            Pedido.Pedidos.Add(NuevoRequestProduct);
            AppButtonAgregar.IsEnabled = false;
        }
コード例 #4
0
 private double GetPrecio(ProductoCantidad x)
 {
     double precio = 0;
     foreach (var material in x.Producto.Materials)
     {
         precio += material.UnitPrice;
     }
     return precio;
 }