Ejemplo n.º 1
0
 private void btn_edit_Click(object sender, EventArgs e)
 {
     if (this.dataGridPublicaciones.SelectedRows.Count == 0)
     {
         MessageBox.Show("No se seleccionó ninguna publicación!", "Editar publicación.",
                         MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     try
     {
         Publicacion_Detalle detailForm  = new Publicacion_Detalle(this);
         Publicacion         publicacion = (Publicacion)this.dataGridPublicaciones.CurrentRow.DataBoundItem;
         detailForm.publicacion = publicacion;
         detailForm.setUsuario(this.usuario);
         detailForm.loadFields();
         detailForm.Show();
         this.Hide();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         MessageBox.Show("Error al editar publicación!", "Error!",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
 }
Ejemplo n.º 2
0
        private void btn_create_Click(object sender, EventArgs e)
        {
            Publicacion_Detalle createForm = new Publicacion_Detalle(this);

            createForm.setUsuario(this.usuario);
            createForm.Show();
            this.Hide();
        }