private void cargarParticipantesAusentesONG() { pAusente.Controls.Clear(); panelAusentes.AutoScroll = false; panelAusentes.AutoScroll = true; pAusente.Controls.Add(panelAusentes); panelAusentes.RowCount = 1; panelAusentes.Controls.Clear(); List <Actividad_Realizada> lista = Actividad_Realizada.ListaActividadesRealizadas(actividad, Actividad_Realizada.EstadoActividadR.EVALUACION_PARTICIPANTE); CartelParticipante[] cartParticipante = new CartelParticipante[lista.Count]; int c = 0; foreach (Actividad_Realizada act in lista) { cartParticipante[c] = new CartelParticipante(act.Participante); panelAusentes.Controls.Add(cartParticipante[c], 0, c); panelAusentes.RowCount = panelAusentes.RowCount + 1; cartParticipante[c].Location = new Point(cartParticipante[c].Location.X, (cartParticipante[c].Size.Height * c)); cartParticipante[c].BackColor = Color.LightGray; //BOTON SOLICITAR Panel panel = (Panel)cartParticipante[c].Controls.Find("panel1", false)[0]; Button bEvaluar = (Button)panel.Controls.Find("bEvaluar", false)[0]; bEvaluar.Visible = false; c++; } }
private void bEvaluarPDI_Click(object sender, EventArgs eventArgs, Actividad_Realizada act) { EvaluarUsuarioPDI evUser = new EvaluarUsuarioPDI(act); evUser.ShowDialog(); cargarParticipantesPDI(); }
private void cargarParticipantesPorEvaluarONG() { pPorEvaluar.Controls.Clear(); panelPorEvaluar.AutoScroll = false; panelPorEvaluar.AutoScroll = true; pPorEvaluar.Controls.Add(panelPorEvaluar); panelPorEvaluar.RowCount = 1; panelPorEvaluar.Controls.Clear(); List <Actividad_Realizada> lista = Actividad_Realizada.ListaActividadesRealizadas(actividad, Actividad_Realizada.EstadoActividadR.EVALUACION_ONG); CartelParticipante[] cartParticipante = new CartelParticipante[lista.Count]; int c = 0; foreach (Actividad_Realizada act in lista) { cartParticipante[c] = new CartelParticipante(act.Participante); panelPorEvaluar.Controls.Add(cartParticipante[c], 0, c); panelPorEvaluar.RowCount = panelPorEvaluar.RowCount + 1; cartParticipante[c].Location = new Point(cartParticipante[c].Location.X, (cartParticipante[c].Size.Height * c)); cartParticipante[c].BackColor = Color.DeepPink; //BOTON SOLICITAR Panel panel = (Panel)cartParticipante[c].Controls.Find("panel1", false)[0]; Button bEvaluar = (Button)panel.Controls.Find("bEvaluar", false)[0]; //PROGRAMACIÓN BOTONES bEvaluar.Click += (sender, EventArgs) => { bEvaluarONG_Click(sender, EventArgs, act); }; c++; } }
public EvaluarActividad(Actividad_Realizada actividad) { InitializeComponent(); this.actividad = actividad; lblTitulo.Text = "¿QUÉ TAL TE HA PARECIDO LA ACTIVIDAD\n" + actividad.Actividad.NombreAct.ToUpper() + "? ¡PUNTÚALA!"; this.labelError.Text = ""; }
public EvaluarUsuarioONG(Actividad_Realizada act) { InitializeComponent(); lUserEvaluado.Text = act.Participante.Nombre + " " + act.Participante.Apellido1 + " " + act.Participante.Apellido2; this.act = act; dateTimePickerIni.Value = act.Actividad.FechaInicio; dateTimePickerFin.Value = act.Actividad.FechaFin; labelError.Text = ""; lblTitulo.Text = "¿CÓMO HA TRABAJADO EL USUARIO\n" + act.Participante.Nombre.ToUpper() + "? ¡PUNTÚALO!"; }
private void cargarHistorialActividadesRealizadasAscendente() { tablePP.Controls.Clear(); tablePP.RowCount = 1; tablePP.AutoScroll = false; panelHistorial.AutoScroll = false; panelHistorial.AutoScroll = true; List <Actividad_Realizada> lista = Actividad_Realizada.ListaActividadesRealizadasAscendente(user); CargarCarteles(lista); }
private void bVerMas_Click(object sender, EventArgs e) { if (Actividad_Realizada.Contains(user, actividad)) { VerActividadRealizada vAct = new VerActividadRealizada(user, new Actividad_Realizada(user, actividad)); vAct.ShowDialog(); } else { VerActividadAbierta vAct = new VerActividadAbierta(this.user, this.actividad); vAct.ShowDialog(); } }
private void CargarCarteles(List <Mapeo.Historial> lista) { CartelHistorial[] carteles = new CartelHistorial[lista.Count]; int c = 0; foreach (Mapeo.Historial h in lista) { CartelHistorial cartel = new CartelHistorial(h); if (c % 3 == 0) { cartel.BackColor = System.Drawing.Color.DarkRed; } if (c % 3 == 1) { cartel.BackColor = System.Drawing.Color.Firebrick; } if (c % 3 == 2) { cartel.BackColor = System.Drawing.Color.IndianRed; } carteles[c] = cartel; tablePP.Controls.Add(carteles[c], 0, c); tablePP.RowCount = tablePP.RowCount + 1; carteles[c].Location = new Point(carteles[c].Location.X, (carteles[c].Size.Height * c)); //Programar verTodo Panel panel = (Panel)carteles[c].Controls.Find("panel1", false)[0]; Button bVerTodo = (Button)panel.Controls.Find("bVerTodo", false)[0]; if (h.Actividad != null) { if (Actividad_Realizada.Contains(h.Usuario, h.Actividad)) { Actividad_Realizada actRealizada = new Actividad_Realizada(h.Usuario, h.Actividad); //MOSTRAR VISTA DE LA ACTIVIDAD_REALIZADA bVerTodo.Click += (sender, EventArgs) => { bVerTodo_Click(sender, EventArgs, actRealizada); }; } else { //MOSTRAR VISTA DE SÓLO LA ACTIVIDAD bVerTodo.Click += (sender, EventArgs) => { bVerTodo_Click(sender, EventArgs, h.Actividad); }; } } c++; } }
private void bExpedir_Click(object sender, EventArgs e) { saveFileDialog1.Filter = "Archivos pdf (*.pdf)|*.pdf"; openFileDialog1.Filter = "Archivos pdf (*.pdf)|*.pdf"; saveFileDialog1.Title = "Save a PDF File"; String urlDestino = null; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { urlDestino = saveFileDialog1.FileName; } if (urlDestino != null) { Actividad_Realizada actRealizada = new Actividad_Realizada(user, actividad); Certificados.PlantillaCertificado.CrearCertificado(urlDestino, actRealizada); MessageBox.Show("Se ha creado el certificado correctamente"); } }
public EvaluarUsuarioPDI(Actividad_Realizada act) { InitializeComponent(); this.act = act; lblTitulo.Text = "¿CUÁL ES LA NOTA DEL USUARIO " + act.Participante.Nombre.ToUpper() + " EN ESTA ACTIVIDAD?"; lNombreOrganizador.Text = act.Actividad.Organizador.Nombre; lHoras.Text = act.NumHorasRealizadas.ToString(); ratingONG.Value = act.ValoracionONG; textBoxComentarioONG.Text = act.ComentarioONG; lUserEvaluado.Text = act.Participante.Nombre + " " + act.Participante.Apellido1 + " " + act.Participante.Apellido2; lNombreActividad.Text = act.Actividad.NombreAct; if (act.ArchivoAdjuntoONG != null) { btnDescargar.Enabled = true; txtNombreArchivo.Text = "Archivo.pdf"; } labelError.Text = ""; }
private void bVerTodo_Click(object sender, EventArgs eventArgs, Actividad_Realizada actRealizada) { VerActividadRealizada verActividad = new VerActividadRealizada(user, actRealizada); verActividad.ShowDialog(); }
public VerActividadRealizada(Usuario user, Actividad_Realizada actRealizada) { InitializeComponent(); this.user = user; this.actRealizada = actRealizada; Actividad actividad = actRealizada.Actividad; this.Text = "Actividad Realizada " + actividad.NombreAct; tOrganizador.Text = actividad.Organizador.Nombre; tNombreAct.Text = actividad.NombreAct; tDescripcion.Text = actividad.DescAct; tNumPlazas.Text = actividad.NumPlazas.ToString(); tNumHoras.Text = actividad.NumHoras.ToString(); dateTimePickerFechaIni.Value = actividad.FechaInicio; dateTimePickerFechaFin.Value = actividad.FechaFin; tLugar.Text = actividad.Lugar; listTurno.Text = actividad.Turno.ToString(); listAmbito.Text = actividad.AmbitoTrabajo.Ambito_Trabajo; listTrabajo.Text = actividad.TipoTrabajo.Tipo_Trabajo; if (actividad.Imagen != null) { pictureBox.Image = actividad.Imagen; } //Panel Usuario txtUsuario.Text = user.Nombre + " " + user.Apellido1 + " " + user.Apellido2; if (actRealizada.FechaValoracionUsuario != DateTime.MinValue) { ratingUsuario.Value = actRealizada.ValoracionUsuario; txtComentarioUsuario.Text = actRealizada.ComentarioUsuario; txtComentarioUsuario.Enabled = true; lblFechaUsuario.Text = "Evaluado: " + actRealizada.FechaValoracionUsuario.ToString(); } else { panelEvUsuario.BackColor = Color.WhiteSmoke; lblFechaUsuario.Text = "Sin Evaluar"; } //Panel ONG txtONG.Text = actividad.Organizador.Nombre; if (actRealizada.FechaValoracionONG != DateTime.MinValue) { ratingONG.Value = actRealizada.ValoracionONG; txtComentarioONG.Text = actRealizada.ComentarioONG; txtComentarioONG.Enabled = true; lHoras.Text = actRealizada.NumHorasRealizadas.ToString(); if (actRealizada.ArchivoAdjuntoONG != null) { lblArchivo.Enabled = true; lblArchivo.Visible = true; } lblFechaONG.Text = "Evaluado: " + actRealizada.FechaValoracionONG.ToString(); lShowFechaRealizacion.Text = actRealizada.FechaInicialUsuario.ToShortDateString() + "-" + actRealizada.FechaFinalUsuario.ToShortDateString(); } else { panelEvONG.BackColor = Color.WhiteSmoke; lblFechaONG.Text = "Sin Evaluar"; } //Panel PDI if (actividad.TipoAct.ToString().Equals("VOLUNTARIADO") || !actRealizada.Participante.Rol.NombreRol.Equals("Estudiante")) { panelEvPDI.Visible = false; //btnAtras.Location = new Point(714, 725); //this.Size = new Size(847, 819); } else { txtPDI.Text = actividad.Responsable.Nombre + " " + actividad.Responsable.Apellido1 + " " + actividad.Responsable.Apellido2; if (actRealizada.FechaValoracionProfesor != DateTime.MinValue) { ratingPDI.Value = actRealizada.ValoracionProfesor; txtComentarioPDI.Text = actRealizada.ComentarioProfesor; txtComentarioPDI.Enabled = true; lblFechaPDI.Text = "Evaluado: " + actRealizada.FechaValoracionProfesor; } else { panelEvPDI.BackColor = Color.WhiteSmoke; lblFechaPDI.Text = "Sin Evaluar"; } } }
public static void CrearCertificado(String urlDestino, Actividad_Realizada actRealizada) { string oldFile = ORIGEN; string newFile = urlDestino; // open the reader PdfReader reader = new PdfReader(oldFile); //Objeto que tiene el tamaño de nuestro documento Rectangle size = reader.GetPageSizeWithRotation(1); //documento de itextsharp para realizar el trabajo asignandole el tamaño del original Document doc = new Document(size); // Creamos el objeto en el cual haremos la inserción FileStream fs = new FileStream(newFile, FileMode.Create, FileAccess.Write); PdfWriter writer = PdfWriter.GetInstance(doc, fs); doc.Open(); //El contenido del pdf, aqui se hace la escritura del contenido PdfContentByte cb = writer.DirectContent; //Propiedades de nuestra fuente a insertar BaseFont bf = BaseFont.CreateFont(@"C:\WINDOWS\FONTS\KUNSTLER.TTF", BaseFont.CP1252, BaseFont.NOT_EMBEDDED); ///TÍTULO bf = BaseFont.CreateFont(@"C:\WINDOWS\FONTS\CASTELAR.TTF", BaseFont.CP1252, BaseFont.NOT_EMBEDDED); cb.SetColorFill(BaseColor.DARK_GRAY); cb.SetFontAndSize(bf, 18); cb.BeginText(); // put the alignment and coordinates here cb.ShowTextAligned(1, "Plataforma CS-APS & " + actRealizada.Actividad.Organizador.Nombre, size.Width / 2, size.Height - 93, 0); cb.ShowTextAligned(1, "LE OTORGAN", size.Width / 2, size.Height - 115, 0); cb.EndText(); ///NOMBRE Y APELLIDOS USUARIO bf = BaseFont.CreateFont(@"C:\WINDOWS\FONTS\KUNSTLER.TTF", BaseFont.CP1252, BaseFont.NOT_EMBEDDED); cb.SetColorFill(BaseColor.DARK_GRAY); cb.SetFontAndSize(bf, 35); cb.BeginText(); // put the alignment and coordinates here string nombreParticipante = actRealizada.Participante.Nombre + " " + actRealizada.Participante.Apellido1 + " " + actRealizada.Participante.Apellido2; cb.ShowTextAligned(1, nombreParticipante, size.Width / 2, size.Height / 2 + 16, 0); cb.EndText(); ///NOMBRE ACTIVIDAD bf = BaseFont.CreateFont(BaseFont.HELVETICA_BOLDOBLIQUE, BaseFont.CP1252, BaseFont.NOT_EMBEDDED); cb.SetColorFill(BaseColor.BLACK); cb.SetFontAndSize(bf, 16); cb.BeginText(); // put the alignment and coordinates here cb.ShowTextAligned(1, actRealizada.Actividad.NombreAct, size.Width / 2, size.Height / 2 - 61, 0); cb.EndText(); ///FECHA Y HORAS bf = BaseFont.CreateFont(@"C:\WINDOWS\FONTS\FRAMD.TTF", BaseFont.CP1252, BaseFont.NOT_EMBEDDED); cb.SetColorFill(BaseColor.GRAY); cb.SetFontAndSize(bf, 12); cb.BeginText(); // put the alignment and coordinates here cb.ShowTextAligned(1, "con un total de " + actRealizada.NumHorasRealizadas + " horas desde " + actRealizada.FechaInicialUsuario.ToShortDateString() + " hasta " + actRealizada.FechaFinalUsuario.ToShortDateString(), size.Width / 2, size.Height / 2 - 83, 0); cb.EndText(); //PUNTUACIÓN bf = BaseFont.CreateFont(@"C:\WINDOWS\FONTS\FRAMD.TTF", BaseFont.CP1252, BaseFont.NOT_EMBEDDED); cb.SetColorFill(BaseColor.BLACK); cb.SetFontAndSize(bf, 34); cb.BeginText(); // put the alignment and coordinates here cb.ShowTextAligned(1, (actRealizada.ValoracionONG * 2).ToString() + "/10", 142, 139, 0); cb.EndText(); PdfImportedPage page = writer.GetImportedPage(reader, 1); cb.AddTemplate(page, 0, 0); // close the streams and voilá the file should be changed :) doc.Close(); fs.Close(); writer.Close(); reader.Close(); }
public CartelActividadesRealizadas(Usuario user, Actividad_Realizada actRealizada) { InitializeComponent(); this.actRealizada = actRealizada; Actividad a = actRealizada.Actividad; this.user = user; if (user.Rol.NombreRol.Equals("ONG")) { lTuValoracion.Text = "Valoración:"; lValoracionONG.Visible = false; ratingONG.Visible = false; bVerMas.Visible = false; lValoracionPDI.Visible = false; ratingPDI.Visible = false; lblUsuario.Visible = true; lUsuario.Text = actRealizada.Participante.Nombre + " " + actRealizada.Participante.Apellido1 + " " + actRealizada.Participante.Apellido2; lUsuario.Visible = true; } this.labelName.Text = a.NombreAct; this.lTipoActividad.Text = a.TipoAct.ToString(); this.lShowIni.Text = a.FechaInicio.ToShortDateString(); this.lShowOrg.Text = a.Organizador.Nombre; if (a.Imagen != null) { pict.Image = a.Imagen; } lTipoTrabajo.Text = a.TipoTrabajo.ToString(); lAmbitoTrabajo.Text = a.AmbitoTrabajo.ToString(); lShowFin.Text = a.FechaFin.ToShortDateString(); lNumHoras.Text = a.NumHoras.ToString(); if (a.Responsable != null) { this.lShowResp.Text = a.Responsable.Nombre + " " + a.Responsable.Apellido1 + " " + a.Responsable.Apellido2; if (!user.Rol.NombreRol.Equals("ONG")) { lValoracionPDI.Visible = true; ratingPDI.Visible = true; } } else { lResp.Visible = false; lShowResp.Visible = false; } if (actRealizada.FechaValoracionUsuario != DateTime.MinValue) { lHorasHechas.Text = actRealizada.NumHorasRealizadas.ToString(); ratingUser.Value = actRealizada.ValoracionUsuario; } else { lHorasHechas.Text = ""; ratingUser.ItemBackColor = Color.Silver; } if (!user.Rol.NombreRol.Equals("ONG")) { if (actRealizada.FechaValoracionONG != DateTime.MinValue) { ratingONG.Value = actRealizada.ValoracionONG; } else { ratingONG.ItemBackColor = Color.Silver; } if (actRealizada.FechaValoracionProfesor != DateTime.MinValue) { ratingPDI.Value = actRealizada.ValoracionProfesor; } else { ratingPDI.ItemBackColor = Color.Silver; } } }