Está en la página 1de 3

Esteban André Vivar López

5to Bach C
Clave 41

Trabajo de clase

Clase: Programacion
public partial class frmPlanilla : Form
{
int Categoria_A = 3000;
int Categoria_B = 2500;
float TotalSueldo;
int anios;
public frmPlanilla()
{
InitializeComponent();
}

private void btnCalcular_Click(object sender,


EventArgs e)
{
if (txtEmpleados.Text == String.Empty |
txtanios.Text==String.Empty)
{
MessageBox.Show("Tiene Campos Vacios");
}
else if (cbxCategoria.Text=="A")
{
anios = Int32.Parse(txtanios.Text);
TotalSueldo = (Categoria_A + (anios * 30));

txtNoempleado.Text = txtEmpleados.Text;
txtaniosempleados.Text = txtanios.Text;
txtCatempleados.Text = cbxCategoria.Text;

txtSueldototal.Text="Q"+TotalSueldo.ToString();
}
else if (cbxCategoria.Text=="B")
{
anios = Int32.Parse(txtanios.Text);
TotalSueldo= (Categoria_B + (anios * 30));

txtNoempleado.Text=txtEmpleados.Text;
txtaniosempleados.Text=txtanios.Text;
txtCatempleados.Text=cbxCategoria.Text;
txtSueldototal.Text = "Q" +
TotalSueldo.ToString();
}
}

private void btnNuevo_Click(object sender,


EventArgs e)
{
txtEmpleados.Clear();
txtanios.Clear();
txtNoempleado.Clear();
txtSueldototal.Clear();
txtCatempleados.Clear();
txtaniosempleados.Clear();

}
}
}

También podría gustarte