public static bool Eliminar(Entidades.FacturasProductos detalle) { using (var repositorio = new Repository <Entidades.FacturasProductos>()) { return(repositorio.Eliminar(detalle)); } }
public void LlenarDatos(Entidades.FacturasProductos detalle) { foreach (GridViewRow dr in FacturaGridView.Rows) { detalle.AgregarDetalle(Utilidades.TOINT(dr.Cells[0].Text), dr.Cells[1].Text, Convert.ToDecimal(dr.Cells[2].Text), Convert.ToDecimal(dr.Cells[3].Text) ); } factura = new Entidades.Facturas(Convert.ToDateTime(FechaTextBox.Text), Convert.ToDecimal(SubtotalTextBox.Text), Convert.ToDecimal(ItbisTextBox.Text), Convert.ToDecimal(TotalTextBox.Text), Utilidades.TOINT(ClienteIdTextBox.Text), NombreTextBox.Text); }
private void SumarExistencia() { decimal suma = 0; foreach (GridViewRow producto in FacturaGridView.Rows) { Entidades.FacturasProductos detallef = new Entidades.FacturasProductos(); int productoId = Convert.ToInt32(producto.Cells[0].Text); ///Celda 2 es el idArticulo antes esta detalleid y facturaid suma = Convert.ToDecimal(producto.Cells[3].Text); //Celda 4 es la cantiddad detallef.Producto = BLL.ProductosBLL.BuscarOtro(productoId); detallef.Producto.Cantidad += Convert.ToInt32(suma); BLL.ProductosBLL.Modificar(detallef.Producto); } }
protected void GuardarButton_Click(object sender, EventArgs e) { Entidades.FacturasProductos detallef = new Entidades.FacturasProductos(); Llenar(detallef); if (detallef.Detalle.Count == 0) { Utilidades.ShowToastr(this, "Agregue un Producto", "Consejo", "info"); } else { if (FacturaBll.Guardar(factura, detallef.Detalle)) { Utilidades.ShowToastr(this, "Guardo", "Correcto", "success"); } else { Utilidades.ShowToastr(this, "Error", "Error", "error"); } } }