private void EliminarButton_Click(object sender, RoutedEventArgs e) { int id; int.TryParse(VentaIdTextBox.Text, out id); RepositorioBase <Ventas> db = new RepositorioBase <Ventas>(); try { if (!string.IsNullOrWhiteSpace(VentaIdTextBox.Text) && (!string.IsNullOrWhiteSpace(ClienteIdCombox.Text))) { MessageBox.Show("Deben de estar llenos los campos", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } Limpiar(); if (VentasBLL.Eliminar(id)) { MessageBox.Show("Eliminado", "Exito", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show(VentaIdTextBox.Text, "No se puede eliminar una venta que no existe"); } } catch { } }
private void EliminarButton_Click(object sender, RoutedEventArgs e) { Ventas AnteriorVenta = VentasBLL.Buscar(contenedor.ventas.VentaId); if (AnteriorVenta == null) { MessageBox.Show("No se Puede Eliminar un venta que no existe"); return; } List <Pagos> pagos = PagosBLL.GetList(p => true); foreach (var item in pagos) { if (item.PagoDetalle[0].VentaId == contenedor.ventas.VentaId) { MessageBox.Show("No se puede eliminar esta ya que tiene un pago"); return; } } if (VentasBLL.Eliminar(contenedor.ventas.VentaId)) { ContratosBLL.RestablecerCantidadPendiente(contenedor.ventas.VentaDetalle[0].ContratoId); Limpiar(); MessageBox.Show("Eliminado"); } else { MessageBox.Show("No se Puede Eliminar Una Venta Que no Existe"); } }
public void EliminarTest() { bool paso; paso = VentasBLL.Eliminar(1); Assert.AreEqual(paso, true); }
public void EliminarTest() { bool paso = false; paso = VentasBLL.Eliminar(1); Assert.IsTrue(paso); }
public void EliminarTest() { bool paso; Ventas ventas = new Ventas(); ventas.VentaId = 1; paso = VentasBLL.Eliminar(ventas.VentaId); Assert.AreEqual(paso, true); }
private void Eliminarbutton_Click_1(object sender, EventArgs e) { if (validarId("Favor digitar el id de la Venta que desea eliminar") && ValidarBuscar()) { VentasBLL.Eliminar(VentasBLL.Buscar(ut.StringInt(FacturaIdtextBox.Text))); Limpiar(); MessageBox.Show("ELiminado con exito"); } }
private void EliminarButton_Click(object sender, EventArgs e) { if (ValidarId("Ingrese el id de la venta que quiere eliminar") && Search()) { VentasBLL.Eliminar(Utilidades.StringToInt(ventaIdTextBox.Text)); MessageBox.Show("Se elimino la venta"); limpiar(); LimpiarErrores(); } }
private void EliminarButton_Click(object sender, RoutedEventArgs e) { if (VentasBLL.Eliminar(Utilidades.ToInt(VentaIdTextBox.Text))) { Limpiar(); MessageBox.Show("Registro Eliminado", "Éxito", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show("No se pudo Eliminar el Registro", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
//—————————————————————————————————————————————————————[ ELIMINAR ]————————————————————————————————————————————————————— private void EliminarButton_Click(object sender, RoutedEventArgs e) { { if (VentasBLL.Eliminar(Utiidades.ToInt(VentaIdTextbox.Text))) { ventas.Total -= Convert.ToDouble(TotalTextBox.Text); Limpiar(); MessageBox.Show("Registro Eliminado", "Exito", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show("No se pudo eliminar", "Error", MessageBoxButton.OK, MessageBoxImage.Warning); } } }
protected void AnularButton_Click(object sender, EventArgs e) { if (IdTextBox.Text == "") { Utilidades.ShowToastr(this, "Debes Llenar el campo Id", "Error", "Danger"); } else { if (VentasBLL.Buscar(Utilidades.TOINT(IdTextBox.Text)) == null) { Utilidades.ShowToastr(this, "Registro no encontrado", "Error", "Danger"); } else { VentasBLL.Eliminar(Utilidades.TOINT(IdTextBox.Text)); Utilidades.ShowToastr(this, "Poceso Exitoso", "Exitoso", "success"); } } }
//Elimina un registro de la base de datos. private void EliminarButton_Click(object sender, RoutedEventArgs e) { if (!Regex.IsMatch(VentaIdTextBox.Text, "^[1-9]+$")) { MessageBox.Show("El Id de la venta solo puede ser de carácter numérico.", "Campo VentaId.", MessageBoxButton.OK, MessageBoxImage.Warning); return; } if (VentasBLL.Eliminar(int.Parse(VentaIdTextBox.Text))) { Limpiar(); MessageBox.Show("Venta eliminada.", "Éxito", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show("Algo salió mal, no se logró eliminar la venta.", "Error.", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void ButtonEliminar_Click(object sender, EventArgs e) { if (Validar(1)) { MessageBox.Show("Favor Llenar Casilla!", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { int id = Convert.ToInt32(VentaIdNumericUpDown.Value); if (VentasBLL.Eliminar(id)) { MessageBox.Show("Eliminado!!", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); LimpiarCampos(); } else { MessageBox.Show("No se pudo eliminar!!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void ElimnarButton_Click(object sender, RoutedEventArgs e) { int id; int.TryParse(VentaIdTextBox.Text, out id); try { if (VentasBLL.Eliminar(id)) { MessageBox.Show("Eliminado con exito!!!", "ELiminado", MessageBoxButton.OK, MessageBoxImage.Information); Limpiar(); } else { MessageBox.Show(" No eliminado !!!", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning); } } catch { MessageBox.Show(" No encontrado !!!", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning); } }
protected void eliminarutton_Click(object sender, EventArgs e) { VentasBLL repositorio = new VentasBLL(); int id = Utils.ToInt(IdTextBox.Text); var venta = repositorio.Buscar(id); if (venta != null) { if (repositorio.Eliminar(id)) { Utils.ShowToastr(this, "Eliminado", "Correcto", "success"); Limpiar(); } else { Utils.ShowToastr(this, "No se pudo eliminar", "Error", "error"); } } else { Utils.ShowToastr(this, "No existe", "Error", "error"); } }
public void EliminarTest() { Assert.IsTrue(VentasBLL.Eliminar(1)); }
public void EliminarTest() { bool paso = VentasBLL.Eliminar(1); Assert.IsNotNull(paso); }