public static int EditarInforme(InformeMitadPeriodo i) { SqlConnection con = BaseDatos.ConexionBD(); SqlCommand comando = new SqlCommand("sp_EditarInformeMitad", con); comando.CommandType = System.Data.CommandType.StoredProcedure; comando.Parameters.AddWithValue("@idInformeMitad", i.IdInformeMitadPeriodo); comando.Parameters.AddWithValue("@preparacionTecnica", i.PreparacionTecnica); comando.Parameters.AddWithValue("@capacidadAprendizaje", i.CapacidadAprendizaje); comando.Parameters.AddWithValue("@trabajoEquipo", i.TrabajoEquipo); comando.Parameters.AddWithValue("@creatividad", i.Creatividad); comando.Parameters.AddWithValue("@adaptacion", i.Adaptacion); comando.Parameters.AddWithValue("@responsabilidad", i.Responsabilidad); comando.Parameters.AddWithValue("@puntualidad ", i.Puntualidad); int resultado; try { resultado = comando.ExecuteNonQuery(); } catch (Exception e) { resultado = 0; } return(resultado); }
public static List <InformeMitadPeriodo> ObtenerInformesMitadPeriodo(Tutor t) { List <InformeMitadPeriodo> informes = new List <InformeMitadPeriodo>(); SqlConnection con = BaseDatos.ConexionBD(); SqlCommand comando = new SqlCommand("sp_BuscarInformesMitadPeriodoTutor", con); comando.CommandType = System.Data.CommandType.StoredProcedure; comando.Parameters.AddWithValue("@idTutor", t.IdTutor); SqlDataReader reader = comando.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { InformeMitadPeriodo aux = new InformeMitadPeriodo(); aux.IdInformeMitadPeriodo = reader.GetInt32(0); aux.PreparacionTecnica = reader.GetString(1); aux.CapacidadAprendizaje = reader.GetString(2); aux.TrabajoEquipo = reader.GetBoolean(3); aux.Creatividad = reader.GetBoolean(4); aux.Adaptacion = reader.GetBoolean(5); aux.Responsabilidad = reader.GetBoolean(6); aux.Puntualidad = reader.GetBoolean(7); aux.Solicitud.Empresa.NombreEmpresa = reader.GetString(8); aux.Solicitud.Empresa.Direccion = reader.GetString(9); aux.Solicitud.Empresa.Telefono = reader.GetString(10); aux.Solicitud.Empresa.Fax = reader.GetString(11); aux.Solicitud.Empresa.CorreoElectronico = reader.GetString(12); aux.Solicitud.Practicante.NombreUsuario = reader.GetString(13); aux.Solicitud.Practicante.Carrera = reader.GetString(14); informes.Add(aux); } } return(informes); }
public FrmInformeMitad(Solicitud s, Tutor t, InformeMitadPeriodo i, String op) { InitializeComponent(); pasantia = s; tutor = t; informe = i; opcion = op; }
private void btnDetalles_Click(object sender, EventArgs e) { InformeMitadPeriodo i = (InformeMitadPeriodo)lstInformeMitad.SelectedItem; if (i == null) { MessageBox.Show("Escoja un Informe", "Pasantias", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { FrmInformeMitad frmInformeMitad = new FrmInformeMitad(new Solicitud(), tutor, i, "ver"); frmInformeMitad.ShowDialog(); } }
public static int BorrarInforme(InformeMitadPeriodo i) { SqlConnection con = BaseDatos.ConexionBD(); SqlCommand comando = new SqlCommand("sp_EliminarInformeMitad", con); comando.CommandType = System.Data.CommandType.StoredProcedure; comando.Parameters.AddWithValue("@idInformeMitad", i.IdInformeMitadPeriodo); int resultado; try { resultado = comando.ExecuteNonQuery(); } catch (Exception e) { resultado = 0; } return(resultado); }
private void btnEliminarInforme_Click(object sender, EventArgs e) { InformeMitadPeriodo i = (InformeMitadPeriodo)lstInformeMitad.SelectedItem; if (i == null) { MessageBox.Show("Escoja un Informe a Eliminar", "Pasantias", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (DAOTUTOR.BorrarInforme(i) > 0) { MessageBox.Show("Informe Borrado"); } else { MessageBox.Show("Fallo"); } CargarInformes(); } }