0% found this document useful (0 votes)
55 views6 pages

Lista de Todos Los Using: Matricula Matricula

This document contains code for a student registration application. It defines classes for storing student registration data and includes code for buttons to save data, view a student's courses, and generate a chart showing highest and lowest grades. The registration data class stores fields for a student's ID number, period, course, credits, and grade. Methods are included for getting and setting the field values and registering a student by populating the field values.

Uploaded by

Vero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views6 pages

Lista de Todos Los Using: Matricula Matricula

This document contains code for a student registration application. It defines classes for storing student registration data and includes code for buttons to save data, view a student's courses, and generate a chart showing highest and lowest grades. The registration data class stores fields for a student's ID number, period, course, credits, and grade. Methods are included for getting and setting the field values and registering a student by populating the field values.

Uploaded by

Vero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

LISTA DE TODOS LOS USING

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;
using System.Windows.Forms.DataVisualization.Charting;

ORDEN PARA EL PROGRAMA


namespace PracCalU2
{
public partial class Form4 : Form
{

Matricula[] M = new Matricula[50];


int iC = 0;
public Form4()
{
InitializeComponent();
}

private void button3_Click(object sender, EventArgs e)


{
// guardar (escribir codigo)

private void button1_Click(object sender, EventArgs e)


{
// consultar (escribir codigo)

private void button2_Click(object sender, EventArgs e)


{
// graficar (escribir codigo)
}

private void button4_Click(object sender, EventArgs e)


{
Form1 f1 = new Form1();
f1.Show();
}

private void Form4_Load(object sender, EventArgs e)


{
// cargar datos de BD a objecto M[]
}

private void label10_Click(object sender, EventArgs e)


{

private void txtNMat_TextChanged(object sender, EventArgs e)


{

}
}
}
BOTON PARA GUARDAR LOS DATOS

private void button3_Click(object sender, EventArgs e)


{
// guardar (escribir codigo)

iC++;
M[iC] = new Matricula();

M[iC].regMatricula(txtNMat.Text,cmbPAcad.Text,cmbCurso.Text
,txtCred.Text,txtNota.Text);
M[iC]._NMatricula = txtNMat.Text;
M[iC]._Periodo = cmbPAcad.Text;
M[iC]._Curso = cmbCurso.Text;
M[iC]._Credito = Convert.ToInt32(txtCred.Text);
M[iC]._Nota =txtNota.Text;
}

BOTON PARA MOSTRAR ALUMNO EN LA LISTA

private void button1_Click(object sender, EventArgs e)


{
// consultar (escribir codigo)
int r = -1;
dataGridView1.Rows.Clear();
if (txtNMatri.Text != "")
{
for (int i = 1; i <= iC; i += 1)
{
if (txtNMatri.Text == M[i]._NMatricula)
{
r++;
dataGridView1.Rows.Add();
dataGridView1.Rows[r].Cells[0].Value = M[i]._Periodo;
dataGridView1.Rows[r].Cells[1].Value = M[i]._Curso;
dataGridView1.Rows[r].Cells[2].Value = M[i]._Credito;
dataGridView1.Rows[r].Cells[3].Value = M[i]._Nota;
}
}
if (r == -1)
MessageBox.Show("Matricula sin cursos ");
}
else
MessageBox.Show("Ingres el nro de matricula");

}
BOTON PARA GRAFICAR

private void button2_Click(object sender, EventArgs e)


{
// graficar (escribir codigo)
chart1.Series.Clear();
Series s = new Series();
int MaxNota = 0, MinNota = 100;
string MaxCurso="", MinCurso="";
for (int i = 1; i <= iC; i += 1)
{
if (Convert.ToInt32(M[i]._Nota) > MaxNota)
{
MaxNota = Convert.ToInt32(M[i]._Nota);
MaxCurso = M[i]._Curso;
}
if (Convert.ToInt32(M[i]._Nota) < MinNota)
{
MinNota = Convert.ToInt32(M[i]._Nota);
MinCurso = M[i]._Curso;
}

}
s.Points.AddXY(MaxCurso, MaxNota);
s.Points.AddXY(MinCurso, MinNota);
chart1.Series.Add(s);
}
DIAGRAMA DE CLASE PARTE DE LA MATRICULA
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PracCalU2
{
public class Matricula
{
private string NMatricula;
private string Periodo;
private string Curso;
private int Credito;
private int Nota;

public int _Credito


{
get
{
return Credito;
}
set
{
Credito = value;
}
}

public string _Curso


{
get
{
return Curso;
}
set
{
Curso = value;
}
}

public string _NMatricula


{
get
{
return NMatricula;
}
set
{
NMatricula = value;
}
}

la nota va con string porque


public string _Nota
esta se utilizara para la grafica
{
get
{
return Convert.ToString(Nota);
}
set
{
Nota = Convert.ToInt32(value);
}
}

public string _Periodo


{
get
{
return Periodo;
}
set
{
Periodo = value;
}
}

public void regMatricula(string NM,string PA,string


C,string Cr,string Nt)
{
NMatricula = NM; Periodo = PA; Curso = C;
Credito = Convert.ToInt32(Cr); Nota =
Convert.ToInt32(Nt);
}

}
}

You might also like