void Buscar()
        {
            try
            {
                DominioPost post  = new DominioPost();
                String[]    datos = post.BuscarPost(txtId.Text);


                if (datos[0] != null)
                {
                    txtId.Text        = datos[0];
                    txtTitulo.Text    = datos[1];
                    txtHora.Text      = datos[2];
                    txtContenido.Text = datos[3];

                    int indiceCombo = int.Parse(datos[4]);

                    comboBox1.SelectedIndex = indiceCombo - 1;
                }
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("Registro no encontrado");
            }
        }
Example #2
0
        private void button7_Click(object sender, EventArgs e)
        {
            if (tabla != null)
            {
                String id = txtId.Text.ToString();

                DominioPost post = new DominioPost();
                ds = post.mostrarPost(tabla, id);

                dataGridView1.DataSource = ds.Tables[0];
            }
        }
Example #3
0
        private void ReportePost_Load(object sender, EventArgs e)
        {
            DominioPost post = new DominioPost();
            DataTable   ds   = post.ReportePost();

            reportViewer2.LocalReport.DataSources.Clear();

            reportViewer2.LocalReport.ReportPath = @"..\..\..\Reporte\InformePost.rdlc";
            ReportDataSource rp = new ReportDataSource("Post", ds);

            reportViewer2.LocalReport.DataSources.Add(rp);
        }
 //ACCION DEL BOTON INGRESAR
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         DominioPost post = new DominioPost();
         post.EliminarPost(txtId.Text);
         MessageBox.Show("Registro eliminado");
     }
     catch (MySqlException ex)
     {
         MessageBox.Show("Registro no encontrado");
     }
 }
 //ACCION DEL BOTON INGRESAR
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         DominioPost post = new DominioPost();
         post.ActualizarPost(txtId.Text, txtTitulo.Text, txtContenido.Text, idCategoria);
         MessageBox.Show("actualizado Correctamente");
     }
     catch (MySqlException ex)
     {
         MessageBox.Show("Registro no actualizado");
     }
 }
 //ACCION DEL BOTON INGRESAR
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         String      idUsuario = Comun.info_usuario.idUsuario;
         DominioPost post      = new DominioPost();
         post.InsertarPost(txtTitulo.Text, txtContenido.Text, idCategoria, idUsuario);
         MessageBox.Show("Registro insertado");
     }
     catch (MySqlException ex)
     {
         MessageBox.Show("Registro no insertado");
     }
 }
        public void buscar()
        {
            try
            {
                DominioPost post  = new DominioPost();
                String[]    datos = post.BuscarPost(txtId.Text);


                if (datos[0] != null)
                {
                    txtId.Text        = datos[0];
                    txtTitulo.Text    = datos[1];
                    txtHora.Text      = datos[2];
                    txtContenido.Text = datos[3];
                    ObtenerCategoria(datos[4]);
                }
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("Registro no encontrado");
            }
        }