You are on page 1of 6

Primer Parcial:

Raymer Rodriguez Moreno/ 20-EISN-6-021


namespace Raymer
{
public partial class Form1 : Form
{
string articulo;
int cantidad;
int categoria;
double subtotal;
double descuento;
double itbis;
double total;
double precio;

public Form1()
{
InitializeComponent();
}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)


{
if (comboBox1.SelectedIndex < 0)
{
comboBox1.Text = "Por favor, seleccione cualquier valor";
}
else
{
comboBox1.Text = comboBox1.SelectedText;
}

private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)


{
if (comboBox1.SelectedIndex < 0)
{
comboBox1.Text = "Please, select any value";
}
else
{
comboBox1.Text = comboBox1.SelectedText;
}
}

private void button1_Click(object sender, EventArgs e)


{
articulo = Convert.ToString(comboBox1.Text);
categoria = int.Parse(textBox3.Text);
cantidad = Convert.ToInt32(textBox2.Text);
precio = Convert.ToDouble(textBox1.Text);
subtotal = cantidad * precio;

if (categoria == 1) { descuento = subtotal * 0.20; }


else if (categoria==2) { descuento = subtotal * 0.15; }
else if (categoria==3) { descuento = subtotal * 0.10; }
else if(categoria==4) { descuento = subtotal * 0.5; }
else { MessageBox.Show("Opcion invalida"); }

itbis = (subtotal - descuento) * 0.16


;
total = (subtotal - descuento) + itbis;

label15.Text = Convert.ToString(articulo);
label17.Text = Convert.ToString(cantidad);
label19.Text = Convert.ToString(categoria);
label21.Text = Convert.ToString(precio);
label6.Text = Convert.ToString(subtotal);
label8.Text = Convert.ToString(descuento);
label10.Text = Convert.ToString(itbis);
label12.Text = Convert.ToString(total);

Enlace de YouTube:
https://youtu.be/BnWp9sFXjyo

You might also like