20091213

PRACTICA 11.2 VENDEDORES (Visual)


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

namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
double[,] sueldos = new double[10, 15];
double[] Precio = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
int RS, ATC, C;

public Form1()
{
InitializeComponent();
listBox1.Items.Add("Vendedor Articulo Cantidad ");


RS = ATC = C = 0;

}

private void button1_Click(object sender, EventArgs e)
{
RS = int.Parse(textBox1.Text);
textBox1.Clear();
ATC = int.Parse(textBox2.Text);
textBox2.Clear();
C = int.Parse(textBox3.Text);
textBox3.Clear();

listBox1.Items.Add(RS.ToString() + "\t" + ATC.ToString() + "\t" + C.ToString());
sueldos[RS - 1, ATC - 1] = sueldos[RS - 1, ATC - 1] + C * Precio[ATC - 1];
}

private void button2_Click_1(object sender, EventArgs e)
{
int V, P;
double SUM, salario;
for (V = 0; V < v =" V">
{

SUM = 0;


for (P = 0; P < p =" P">
{
SUM = SUM + sueldos[V, P];
}

salario = SUM * 0.05;
listBox1.Items.Add("Vendedor Sueldo");
listBox1.Items.Add("\t" +V.ToString()+"\t" + salario.ToString());

}

}

private void button3_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();


}

private void button4_Click(object sender, EventArgs e)
{
Close();
}
Publicar entrada

}
}

No hay comentarios:

Publicar un comentario