Advertisement
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 WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- int index = 0;
- public Form1()
- {
- InitializeComponent();
- }
- private void btnAumento_Click(object sender, EventArgs e)
- {
- }
- private void btnNeto_Click(object sender, EventArgs e)
- {
- if (lstSueldos1.Items.Count > 0)
- {
- //for(index = 0; index <= lstEmpleados1.Items.Count-1; index++)
- while (index <= lstEmpleados1.Items.Count-1)
- {
- lstNeto.Items.Add(lstEmpleados1.Items[index].ToString() + " " +Convert.ToString(Convert.ToDouble(lstSueldos1.Items[index])+Convert.ToDouble(lstSueldos1.Items[index]) * Convert.ToDouble(txtAumento.Text)/100));
- index++;
- }
- }
- else
- {
- MessageBox.Show("La lista de sueldos se encuentra vacìa");
- }
- }
- private void btnCargar_Click(object sender, EventArgs e)
- {
- if (txtEmpleado.Text != "" && Convert.ToDouble(txtSueldo.Text) != 0)
- {
- lstEmpleados1.Items.Add(txtEmpleado.Text);
- lstSueldos1.Items.Add(txtSueldo.Text);
- txtEmpleado.Clear();
- txtSueldo.Clear();
- txtEmpleado.Select();
- }
- else
- {
- MessageBox.Show("Cargue datos en los controladores");
- txtEmpleado.Select();
- }
- }
- private void btnTotal_Click(object sender, EventArgs e)
- {
- double total = 0;
- for (int i = 0; i < lstNeto.Items.Count; i++)
- {
- total += Convert.ToDouble(lstSueldos1.Items[i] + Convert.ToDouble(lstSueldos1.Items[i]) * Convert.ToDouble(txtAumento.Text) / 100); //Aca hay un error por la concatenaciòn con texto
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement