예제 #1
0
        private void botonEliminar_Click(object sender, EventArgs e)
        {
            try
            {
                int Id = 0;
                int.TryParse(textBoxCuentaId.Text, out Id);
                cuentas.CuentaId = Id;

                if (cuentas.Eliminar())
                {
                    MessageBox.Show("Eliminado Correctamente");
                    textBoxCuentaId.Clear();
                    textBoxDescripcion.Clear();
                    textBoxBalance.Clear();
                }
                else
                {
                    MessageBox.Show("Id No Existe");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Error Al Eliminar");
            }
        }
 private void EliminarButton_Click(object sender, EventArgs e)
 {
     try
     {
         ObtenerValores();
         if (cuentas.Buscar(cuentas.CuentaId))
         {
             if (cuentas.Eliminar())
             {
                 MensajeOk("Eliminado correctamente");
                 Limpiar();
             }
             else
             {
                 MensajeError("Error al eliminar");
             }
         }
         else
         {
             MensajeAdvertencia("Este Id no existe");
             Limpiar();
         }
     }
     catch (Exception)
     {
         MensajeError("Error al eliminar");
     }
 }
예제 #3
0
        protected void BtnEliminar_Click(object sender, EventArgs e)
        {
            try
            {
                if (TbIdCuenta.Text == string.Empty)
                {
                    Alert("El IdCuenta No Puede Estar Vacio Para Eliminar");
                }
                else
                {
                    if (c.Eliminar(TbIdCuenta.Text))
                    {
                        Alert("No  Se Eliminada Cuenta Corectamente");

                        Limpiar();
                    }
                    else
                    {
                        Alert(" No Se  Eliminar  Cuenta Corectamente");
                    }
                }
            }
            catch (Exception)
            {
                Alert("No Se Puede Eliminar Esta IdCuenta Porque Esta Haciendeo Referencia En Otro Tabla");
            }
        }
예제 #4
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (IDCuentaTextBox.Text.Trim().Length == 0)
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Ha habido un error. Pruebe ingresando un ID.');", true);
     }
     if (Cuenta.Eliminar(Utilitarios.ToInt(IDCuentaTextBox.Text)))
     {
         ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Cuenta Eliminada.');", true);
     }
 }
예제 #5
0
        protected void EliminarButton_Click(object sender, EventArgs e)
        {
            Cuentas cuenta = new Cuentas();

            cuenta.CuentaId = ConvertirId();
            if (cuenta.Eliminar())
            {
                HttpContext.Current.Response.Write("<SCRIPT>alert('Datos eliminados')</SCRIPT>");
                Limpiar();
            }
            else
            {
                HttpContext.Current.Response.Write("<SCRIPT>alert('Error al eliminar')</SCRIPT>");
            }
        }
예제 #6
0
 private void Eliminarbutton_Click(object sender, EventArgs e)
 {
     if (CuentaIdtextBox.TextLength > 0)
     {
         cuenta.CuentaId = int.Parse(CuentaIdtextBox.Text);
         if (cuenta.Eliminar())
         {
             MessageBox.Show("Cuenta Eliminada Correctamente");
         }
         else
         {
             MessageBox.Show("Error! la Cuenta no se Elimino Correctamente");
         }
     }
     CuentaIdtextBox.Clear();
     DescripciontextBox.Clear();
     BalancetextBox.Clear();
 }
        protected void EliminarButton_Click(object sender, EventArgs e)
        {
            if (TbCuentaId.Text == "")
            {
                Utilitarios.ShowToastr(this.Page, "El ID no puede estar en Blanco.", "Advertencia", "Warning");
                return;
            }
            Cuentas cuenta = new Cuentas();

            if (!(cuenta.Buscar(Convert.ToInt16(TbCuentaId.Text))))
            {
                Utilitarios.ShowToastr(this.Page, "Registro no encontrado.", "Error", "Error");
                Limpiar();
                return;
            }

            if (cuenta.Eliminar())
            {
                Utilitarios.ShowToastr(this.Page, "Transaccion Exitosa.", "Felicidades", "Success");
                Limpiar();
            }
        }