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 AlumnoA
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void btnCalcular_Click(object sender, EventArgs e)
- {
- Alumno a;
- a = new Alumno();
- a.pLegajo = Convert.ToInt32(txtLegajo.Text);
- a.pNombre = txtNombre.Text;
- a.pApellido = txtApellido.Text;
- a.pDocumento = Convert.ToInt32(txtDocumento.Text);
- a.pTipoDocumento = Convert.ToInt32(txtTipoDocum.Text);
- if (rbMasculino.Checked)
- {
- a.pSexo = true;
- }
- else
- {
- a.pSexo = false;
- }
- a.pFechaNacimiento = dtpFN.Value;
- a.pNota1 = Convert.ToDouble(txtNota1.Text);
- a.pNota2 = Convert.ToDouble(txtNota2.Text);
- a.pNota3 = Convert.ToDouble(txtNota3.Text);
- lblResultado.Text = a.calcularPromedio().ToString();
- if (a.calcularPromedio() >= 6)
- lblEstado.Text = "Aprobado";
- else
- lblEstado.Text = "Libre";
- txttoString.Clear();//Esto debe realizarse con el mismo objeto de la clase, es decir la clase o la creo como objeto global en el form, o lo hago en el mismo boton
- txttoString.Text = a.toString();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement