private void btnEnviar_Click(object sender, EventArgs e) { bool x = true; if (tbTitulo.Text == "" || tbTitulo.Text == null) { x = false; tbTitulo.BackColor = Color.Red; } if (rtbTexto.Text == "" || rtbTexto.Text == null) { x = false; rtbTexto.BackColor = Color.Red; } if (x) { string res = ""; oInforme = new clsInforme(); oInforme.Codigo_grupo = clsUtilidades.codigoGrupo; oInforme.Fecha_creacion = DateTime.Today.Date; oInforme.Titulo = tbTitulo.Text; oInforme.Texto = rtbTexto.Text; oInforme.Tipo = "de Grupo"; res = oInforme.agregarInforme(); if (res == "") { MessageBox.Show("Informe correctamente enviado"); tbTitulo.Focus(); } } else { MessageBox.Show("Por favor llene los campos correspondientes"); } }
private void btnEnviarInforme_Click(object sender, EventArgs e) { bool x = true; if (tbInforme.Text == "" || tbInforme.Text == null) { x = false; tbInforme.BackColor = Color.Red; } if (tbTituloInforme.Text == "" || tbTituloInforme.Text == null) { x = false; tbTituloInforme.BackColor = Color.Red; } if (x) { string res = ""; oInforme = new clsInforme(); oInforme.Titulo = tbTituloInforme.Text; oInforme.Codigo_grupo = codigo_grupo; oInforme.Fecha_creacion = DateTime.Today.Date; oInforme.Texto = tbInforme.Text; oInforme.Tipo = "de Admin"; res = oInforme.agregarInforme(); if (res == "") { MessageBox.Show("Informe Correctamente enviado."); if (titulo_formulario == "") { if (DialogResult.Yes == MessageBox.Show("Desea enviar otro informe para este Grupo?", "", MessageBoxButtons.YesNo)) { tbInforme.Text = ""; tbInforme.Focus(); } else { btnEnviarInforme.Enabled = false; } } else { if (DialogResult.Yes == MessageBox.Show("Desea enviar otro informe con respecto a este Formulario?", "", MessageBoxButtons.YesNo)) { tbInforme.Text = ""; tbInforme.Focus(); } } } } else { MessageBox.Show("Por favor llene los campos de texto correctamente"); tbTituloInforme.Focus(); } }
private void btnListarInformes_Click(object sender, EventArgs e) { oInforme = new clsInforme(); bsDatos = new BindingSource(); bsDatos.DataSource = oInforme.listarInformes_Grupo(clsUtilidades.codigoGrupo); dgvMensajes.DataSource = bsDatos; if (dgvMensajes.DataSource != null) { dgvMensajes.Visible = true; dgvMensajes.Columns["id_informe"].Visible = false; dgvMensajes.Columns["tipo"].Visible = false; dgvMensajes.Columns["codigo_grupo"].Visible = false; } }