You are on page 1of 2

using

using
using
using
using
using
using
using

System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;

namespace consumo_de__agua_windonn_for
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.lbsubtotal.Text = "0.0";
this.lbigv.Text = "0.0";
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void rbcomercial_CheckedChanged(object sender, EventArgs e)
{
this.lbcosto.Text = "0.70";
this.txconsumo.SelectAll();
this.txconsumo.Focus();
}
private void rbdomestico_CheckedChanged(object sender, EventArgs e)
{
this.lbcosto.Text = "0.50";
this.txconsumo.SelectAll();
this.txconsumo.Focus();
}
private void lbsubtotal_Click(object sender, EventArgs e)
{
}
private void bucalcular_Click(object sender, EventArgs e)
{
//declarar variables
double consumo, domestico, comercial, subtotal, total, igv;
domestico = 0.50;
comercial = 0.70;
//ingreso de datos
consumo = Convert.ToDouble(txconsumo.Text);
//realisar calculos
if (this.rbdomestico.Checked)
{
subtotal = consumo * domestico;

this.lbsubtotal.Text = Convert.ToString(subtotal);
igv = subtotal * 0.18;
total = subtotal + igv;
this.lbigv.Text = igv.ToString();
this.txtotal.Text = Convert.ToString(total);
}
else if ( this.rbcomercial.Checked)
{
subtotal= consumo * comercial ;
this.lbsubtotal.Text=Convert.ToString(subtotal);
igv = subtotal * 0.18;
total = subtotal + igv;
this.lbigv.Text = igv.ToString();
this.txtotal.Text = Convert.ToString(total);
}
}
private void bunuevo_Click(object sender, EventArgs e)
{
this.txnombre.Text = "";
this.cbdistrito.Text = "";
this.txconsumo.Text ="";
this.lbsubtotal.Text = "0.0";
this.lbigv.Text = "0.0";
this.txtotal.Text = "";
}
private void busalir_Click(object sender, EventArgs e)
{
Close();
}
}

You might also like