예제 #1
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            if (txtID_Area.Text == "")
            {
                errorProvider1.SetError(txtID_Area, "¡Seleccione Area a Eliminar!");
            }
            else
            {
                try
                {
                    DialogResult dr = MessageBox.Show("Esta seguro que quiere ELIMINAR el registro?", "Modificar", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (dr == DialogResult.Yes)
                    {
                        DBdelete d = new DBdelete();
                        d.delete(Item, "pr_deleteInformacionArea", "@Item");
                        r.showInformacionArea(dgvInformacionArea, EdificioColumn, AreaColumn, TipoAreaColumn, CantidadPersonasColumn, SubsistemaColumn, ItemColum, DescripcionColumn, CantidadColumn,
                                              CapacidadColumn, HorasColumn, DiasColumn, ConsumoColumn, IDedificioColumn, IDareaColumn, IDsubsistemaColumn);

                        Limpiar();
                    }
                }
                catch (Exception ex)
                { MessageBox.Show(ex.ToString()); }
            }
        }
예제 #2
0
 private void btnEliminar_Click(object sender, EventArgs e)
 {
     if (txtID_Subsistema.Text == "")
     {
         errorProvider1.SetError(txtID_Subsistema, "¡Seleccione Subsistema a Eliminar!");
     }
     else
     {
         try
         {
             //Elimanos los datos
             DBdelete d = new DBdelete();
             d.delete(subsistemaID, "pr_deleteSubsistema", "@IDsubsistemaPr");
             //Mostramos el datagrid con los datos actualizados
             r.showSubsistema(dgvSubsistema, IDsubsistemaColumn, NombreSubsistemaColumn);
             //Hacemos uso de la función limpiar para dejar los cambos vacíos.
             Limpiar();
             //Habilitamos el textbox que contiene el ID y el boton de guardar
             txtID_Subsistema.Enabled = true;
             btnGuardar.Visible       = true;
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error" + ex.ToString(), "ERROR");
             MainClass.con.Close();
         }
     }
 }
예제 #3
0
 private void btnEliminar_Click(object sender, EventArgs e)
 {
     if (txtID_Edificio.Text == "")
     {
         errorProvider1.SetError(txtID_Edificio, "¡Seleccione Edificio a Modificar!");
     }
     else
     {
         try
         {
             DBdelete d = new DBdelete();
             //Eliminamos los datos
             d.delete(EdificioID, "pr_deleteEdificio", "@ID_edificioPr");
             //Mostramos el datagrid con los datos actualizados
             r.showEdificios(dgvEdificio, ID_edificioGvColumn, NombreEdificioGvColumn);
             //Hacemos uso de la función limpiar para dejar los cambos vacíos.
             Limpiar();
             //Habilitamos el textbox que contiene el ID y el boton de guardar
             txtID_Edificio.Enabled = true;
             btnGuardar.Visible     = true;
         }
         catch (Exception ex)
         { MessageBox.Show(ex.ToString()); }
     }
 }
예제 #4
0
파일: Area.cs 프로젝트: ChrisArdon/LBISGE
 private void btnEliminar_Click(object sender, EventArgs e)
 {
     if (IDareaTxt.Text == "")
     {
         errorProvider1.SetError(IDareaTxt, "¡Seleccione Area a Eliminar!");
     }
     else
     {
         try
         {
             DBdelete d = new DBdelete();
             d.delete(AreaID, "pr_deleteArea", "@IDareaPr");
             //Actualizamos los datos en el datagridView
             r.showArea(dgvArea, IDareaColumn, NombreAreaColumn);
             //Hacemos uso de la función limpiar para dejar los cambos vacíos.
             Limpiar();
             //Habilitamos el textbox que contiene el ID y el boton de guardar
             IDareaTxt.Enabled  = true;
             btnGuardar.Visible = true;
         }
         catch (Exception ex)
         { MessageBox.Show(ex.ToString()); }
     }
 }