protected void ButtonGuardar_Click(object sender, EventArgs e) { int id = 0; decimal deudatotal = 0; var guardar = new Entidades.Deudasclientes(); deudatotal = Convert.ToDecimal(TextMonto.Text); guardar.Cliente = TextBoxNombre.Text; // guardar.Deuda = deudatotal; guardar.IdDeudas = (Utilidades.TOINT(TextBoxID.Text)); if (deudatotal < Convert.ToDecimal(TextBoxDevuelta.Text) || deudatotal == 0) { int idd = int.Parse(TextBoxID.Text); var bll = new BLL.DeudasclientesBLL(); var cliente = BLL.DeudasclientesBLL.Buscar(p => p.IdDeudas == idd); BLL.DeudasclientesBLL.Eliminar(cliente); Utilidades.ShowToastr(this, "Abono es mayor que deuda se elimina automaticamente", "ATENCION", "info"); } else { if (id != guardar.IdDeudas) { BLL.DeudasclientesBLL.Mofidicar(guardar); Utilidades.ShowToastr(this, "Modifico la deuda", "ATENCION", "info"); } } }
public void EliminaTest() { int id = 1; debe = BLL.DeudasclientesBLL.Buscar(c => c.IdDeudas == id); Assert.IsTrue(DeudasclientesBLL.Eliminar(debe)); }
protected void Button2_Click(object sender, EventArgs e) { Entidades.FacturaDetalles detallef = new Entidades.FacturaDetalles(); LlenarDatos(detallef); var guardar = new Entidades.Deudasclientes(); int idcliente = int.Parse(DropDownCliente.Text); var ClienteNombre = BLL.ClientesBLL.Buscar(p => p.ClienteId == idcliente); if (detallef.Detalle.Count == 0) { Utilidades.ShowToastr(this, "Primero agregue Articulos", "Consejo", "info"); } else { if (TextBoxTotal.Text == "" && DropDownTipoVenta.Text == "Contado") { Utilidades.ShowToastr(this, "Calcule total", "ATENCION", "info"); } else { if (BLL.FacturaBLL.Guardar(facturaG, detallef.Detalle)) { EliminarExitencia(); if (DropDownTipoVenta.Text == "Credito") { if (TextBoxTotal.Text == "") { Utilidades.ShowToastr(this, "Calcule total, presionando el boton ", "ATENCION", "info"); } else { guardar.Cliente = ClienteNombre.Nombres; guardar.Deuda = Convert.ToDecimal(TextBoxTotal.Text); if (BLL.DeudasclientesBLL.Guardar(guardar)) { Utilidades.ShowToastr(this, "Nueva deuda agregada", "ATENCION", "info"); } } } Utilidades.ShowToastr(this, "Guardo", "Correcto", "success"); limpiar(); } else { Utilidades.ShowToastr(this, "Error", "Error", "error"); } } } }
public void ModificarTest() { int id = 1; debe = BLL.DeudasclientesBLL.Buscar(c => c.IdDeudas == id); debe.Deuda = 100; debe.Cliente = "Juan"; Assert.IsTrue(DeudasclientesBLL.Mofidicar(debe)); }
public void BuscarTest() { int id = 1; //ID Varia dependiendo lo registrado en la base de datos bool bandera = false; debe = DeudasclientesBLL.Buscar(p => p.IdDeudas == id); if (debe != null) { bandera = true; } else { bandera = false; } Assert.IsTrue(bandera); }