Vous êtes sur la page 1sur 3

Universitario: Ismael Veizan Herrera

30/09/2018

ESTRUCTURA DE DATOS I

EJERCICIO Nro 1

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WindowsFormsApplication1
{
class perfil
{
private String Titulo;
private String tutor;
private String Modalidad;
private String Postulante;
private DateTime Fecha_Pres;

public perfil(){
Titulo = Postulante = tutor =Modalidad = "";
Fecha_Pres = DateTime.MaxValue;
}
public void setTitulo(String t) {Titulo = t; }
public void setPostulante(String t) {Postulante = t; }
public void setTutor(String t) {tutor = t; }
public void setModalidad(String t) {Modalidad = t; }
public void setFecha(DateTime t) {Fecha_Pres = t; }

public String getTitulo() {return Titulo; }


public String getPostulante() {return Postulante; }
public String getTutor() {return tutor; }
public String getModalidad() {return Modalidad; }
public DateTime getFecha() {return Fecha_Pres; }

public int calcularTiempo() { return DateTime.Now.Year - Fecha_Pres.Year; }

public String DArDeBaja()


{
if (calcularTiempo() >= 2)
return "DAr De Baja...";
else return "Vigente";
}
}
}
Universitario: Ismael Veizan Herrera

30/09/2018

Datos

Titulo

Postulante

Tutor

Modalidad

Insertar
Martes 11 de septiembre de 2018...
Fecha de Presentacion

Titulo Postulante Tutor Modalidad Fecha de Dar de Baja Vijente


Presentacion
*

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
{
public Form1()
{
InitializeComponent();
}

private void lbPostulante_Click(object sender, EventArgs e)


{
Universitario: Ismael Veizan Herrera

30/09/2018
}

private void lbModalidad_Click(object sender, EventArgs e)


{

private void lbTutor_Click(object sender, EventArgs e)


{

private void lbFecha_de_Presentacion_Click(object sender, EventArgs e)


{

private void lbInsertar_Click(object sender, EventArgs e)


{
perfil P = new perfil();
P.setTitulo(textTitulo.Text);
P.setPostulante(textPostulante.Text);
P.setTutor(textTutor.Text);
P.setModalidad(cbModalidad.Text);
P.setFecha(DateTime.Parse(dtpFechaPres.Text));

String[] fila ={P.getTitulo(),P.getPostulante(),P.getTutor(),


P.getModalidad(),P.getFecha().ToShortDateString(),
P.calcularTiempo().ToString(),P.DArDeBaja() };
dgvDatos.Rows.Add(fila);
}

private void textBox1_TextChanged(object sender, EventArgs e)


{

}
}
}

Vous aimerez peut-être aussi