示例#1
0
 void BALTAS_Click(object sender, EventArgs e)
 {
     AsignarValores();
     if (Errores.AñadirModificarCentro(centro, check) != null)
     {
         MessageBox.Show(Errores.AñadirModificarCentro(centro, check));
     }
     else
     {
         query = "Insert into " + tabla + "(Ciudad,Calle) values ('" + centro.Ciudad + "','" + centro.Calle + "');";
         if ((resultado = centro.Cruz(conexion, query)) > 0)
         {
             BLIMPIAR.PerformClick();
             MessageBox.Show("Centro Añadido Con Exito!!", "Guardado", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     BVCENTROS.PerformClick();
 }
示例#2
0
 void BBAJAS_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(TBIDCENTROS.Text))
     {
         MessageBox.Show("Seleccione el centro que desea borrar");
     }
     else
     {
         centro.id = Convert.ToInt32(TBIDCENTROS.Text);
         query     = "Delete from " + tabla + " Where idCentros='" + centro.id + "';";
         if ((resultado = centro.Bajas(conexion, query)) > 0)
         {
             BLIMPIAR.PerformClick();
             MessageBox.Show("Centro Eliminado Con Exito!!", "Guardado", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     BVCENTROS.PerformClick();
 }
示例#3
0
 void BMODIFICAR_Click(object sender, EventArgs e)
 {
     AsignarValores();
     if (String.IsNullOrEmpty(TBIDCENTROS.Text))
     {
         MessageBox.Show("Seleccione el Centro que desea modificar");
     }
     else if (Errores.AñadirModificarCentro(centro, check) != null)
     {
         MessageBox.Show(Errores.AñadirModificarCentro(centro, check));
     }
     else
     {
         centro.id = Convert.ToInt32(TBIDCENTROS.Text);
         query     = "UPDATE " + tabla + " SET Calle = '" + centro.Calle + "', Ciudad = '" + centro.Ciudad + "' WHERE idCentros = '" + centro.id + "';";
         if ((resultado = centro.Cruz(conexion, query)) > 0)
         {
             BLIMPIAR.PerformClick();
             MessageBox.Show("Centro Modificado Con Exito!!", "Guardado", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     BVCENTROS.PerformClick();
 }
示例#4
0
 void FormCentros_Load(object sender, EventArgs e)
 {
     BVCENTROS.PerformClick();
     Design.caracteristicasGrid(DGVCENTROS, 8, 17);
 }