Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace Proyecto_Producto
- {
- public partial class Form1 : Form
- {
- int cantidad = 0;
- double ValoracionTotal = 0;
- double PrecioPromedio = 0;
- double CantAlimentos = 0;
- double CantPerfumeria = 0;
- Producto AP;
- public Form1()
- {
- InitializeComponent();
- rbtAlimentos.Checked = true;
- cmbMarca.SelectedIndex = 0;
- AP = new Producto();
- }
- private void cmdCargar_Click(object sender, EventArgs e)
- {
- Producto p;
- p = new Producto();
- p.pCodigo = Convert.ToInt32(txtCodigo.Text);
- p.pNombre = txtNombre.Text;
- if (rbtAlimentos.Checked)
- {
- p.pRubro = 0;
- CantAlimentos++;
- }
- else
- {
- p.pRubro = 1;
- CantPerfumeria++;
- }
- MessageBox.Show("Lameme Las Bolas");
- p.pPrecio = Convert.ToDouble(txtPrecio.Text);
- p.pCantidad = Convert.ToDouble(txtCantidad.Text);
- p.pMarca = Convert.ToInt32(cmbMarca.SelectedIndex+1);
- lblValor.Text = Convert.ToString(Math.Round(p.calcularValuacion(),2));
- if (p.pPrecio >= AP.pPrecio)
- {
- AP.pPrecio = p.pPrecio;
- AP.pNombre = p.pNombre;
- }
- lblAlimentos.Text = Convert.ToString(CantAlimentos);
- lblPerfumeria.Text = Convert.ToString(CantPerfumeria);
- cantidad++;
- ValoracionTotal = ValoracionTotal + p.calcularValuacion();
- lblPrecioMayor.Text = Convert.ToString(AP.pPrecio);
- MessageBox.Show(p.MostrarProducto());
- //Producto con mayor precio.
- }
- private void label8_Click(object sender, EventArgs e)
- {
- }
- private void lblCantidadTotal_Click(object sender, EventArgs e)
- {
- }
- }
- }
Add Comment
Please, Sign In to add comment