Dia Mejor

Practica 9.2

Author: Moises

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 A_Bid_2_Visual
{
public partial class Form1 : Form
{
Arreglo Articulos = new Arreglo();
ArregloBidimensional ventas = new ArregloBidimensional(20, 50);
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
listBox1.Visible = false;
RbSi.Checked = true;
}

private void BtAceptar_Click(object sender, EventArgs e)
{


int Num, NoArt, Ven;

Num = int.Parse(textBox1.Text);
NoArt = int.Parse(textBox2.Text);
Ven = int.Parse(textBox3.Text);
ventas.T1[Num - 1, NoArt - 1] = Ven;


listBox1.Items.Clear();
listBox1.Items.Add("Calculo de sueldos");
listBox1.Items.Add("No Vendedor \tTotal Venta \tSueldo");

int R, C;
double suma, sueldo;
for (R = 0; R < 20; R++)
{
suma = 0.0;
for (C = 0; C < 50; C++)
{
suma = suma + ventas.ObtenerDato(R, C) * Articulos.ObtenerDato(C);
}
sueldo = suma * 0.05;

listBox1.Items.Add((R + 1) + "\t\t" + suma + "\t\t" + sueldo);

}


if (RbNo.Checked == true)
{
listBox1.Visible = true;
BtAceptar.Visible = false;
button1.Visible = false;
groupBox1.Visible = false;
groupBox2.Visible = false;
}
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
}

private void BtSalir_Click(object sender, EventArgs e)
{
Close();
}

private void button1_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
}
}
}

 

0 Response to “Practica 9.2”

Leave a Reply