public decimal ObtenerPrecioVenta(BEProductoCliente pBEProductoCliente) { DatabaseHelper oDatabaseHelper = new DatabaseHelper(); decimal decTara = decimal.Zero; IDataReader oIDataReader = null; try { oDatabaseHelper.ClearParameter(); string strFormat = "SELECT dbo.DGP_Obtener_PrecioVentaCliente({0}, {1})"; oIDataReader = oDatabaseHelper.ExecuteReader(string.Format(strFormat, pBEProductoCliente.IdCliente, pBEProductoCliente.IdProducto), CommandType.Text); if (oIDataReader.Read()) { decTara = oIDataReader.GetDecimal(0); } return(decTara); } catch (Exception ex) { throw ex; } finally { if (!oIDataReader.IsClosed) { oIDataReader.Close(); } oIDataReader.Dispose(); oDatabaseHelper.Dispose(); } }
public int cambioPrecioMasivo(BEProductoCliente pBEProductoCliente, bool bAplicaClientes) { DatabaseHelper pDatabaseHelper = new DatabaseHelper(); int vResultado = 0; try { pDatabaseHelper.ClearParameter(); pDatabaseHelper.AddParameter("@intProducto", pBEProductoCliente.IdProducto); pDatabaseHelper.AddParameter("@decPrecioCompra", pBEProductoCliente.PrecioCompra); pDatabaseHelper.AddParameter("@decMargendefault", pBEProductoCliente.Margen); pDatabaseHelper.AddParameter("@bolAplicaMasivo", bAplicaClientes.GetHashCode()); pDatabaseHelper.AddParameter("@intUsuario", pBEProductoCliente.BEUsuarioLogin.IdPersonal); vResultado = pDatabaseHelper.ExecuteNonQuery("DGP_ActualizacionMAsivoCliente", CommandType.StoredProcedure, DBHelper.ConnectionState.CloseOnExit); return(vResultado); } catch (Exception ex) { throw ex; } finally { pDatabaseHelper.Dispose(); } }
public decimal ObtenerPrecioVenta(BEProductoCliente pBEProductoCliente) { try { return(new DAProductoCliente().ObtenerPrecioVenta(pBEProductoCliente)); } catch (Exception ex) { throw ex; } }
private void cbVenta_SelectedIndexChanged(object sender, EventArgs e) { try { // Validar si eligio una Ventas if (cbVenta.SelectedIndex > 0) { int.TryParse(cbVenta.SelectedValue.ToString(), out vg_intIdVenta); // Obtener datos de la Venta BEVenta oBEVenta = new BLVenta().ObtenerVenta(vg_intIdVenta); if (oBEVenta != null) { BEProductoCliente oBEProductoCliente = new BEProductoCliente(); oBEProductoCliente.IdCliente = oBEVenta.IdCliente; oBEProductoCliente.IdProducto = oBEVenta.IdProducto; vg_decTara = new BLProductoCliente().ObtenerTara(oBEProductoCliente); // Establecer los datos vg_intIdProducto = oBEVenta.IdProducto; lblProducto.Text = oBEVenta.Producto; lblPrecio.Text = oBEVenta.Precio.ToString("#.00");; lblTotalBruto.Text = oBEVenta.TotalPesoBruto.ToString(); lblTotalTara.Text = oBEVenta.TotalPesoTara.ToString(); lblTotalNeto.Text = oBEVenta.TotalPesoNeto.ToString(); DGP_Util.LiberarGridView(dgrvDevolucion); DGP_Util.EnableControl(dgrvDevolucion, true); dgrvDevolucion.AllowUserToAddRows = true; DGP_Util.EnableControl(btnAceptarDevolucion, true); } } else { vg_decTara = decimal.Zero; vg_intIdVenta = int.MinValue; vg_intIdProducto = int.MinValue; lblProducto.ResetText(); lblPrecio.ResetText(); lblTotalBruto.ResetText(); lblTotalTara.ResetText(); lblTotalNeto.ResetText(); DGP_Util.EnableControl(dgrvDevolucion, false); dgrvDevolucion.AllowUserToAddRows = false; DGP_Util.LiberarGridView(dgrvDevolucion); DGP_Util.EnableControl(btnAceptarDevolucion, false); } } catch (Exception ex) { MostrarMensaje(ex.Message, MessageBoxIcon.Error); } }
private void btnAceptar_Click(object sender, EventArgs e) { try { BEProductoCliente pBEProductoCliente = new BEProductoCliente(); pBEProductoCliente.IdProducto = (int)this.cmbProductos.SelectedValue; pBEProductoCliente.Margen = this.nudMargen.Value; pBEProductoCliente.PrecioCompra = this.nudPrecio.Value; bool flagAplicaTodos = this.chkMasivo.Checked; int total = new BLProductoCliente().cambioPrecioMasivo(pBEProductoCliente, flagAplicaTodos); MessageBox.Show("Se modificarón: " + total.ToString(), "", MessageBoxButtons.OK); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message, "DGP", MessageBoxButtons.OK, MessageBoxIcon.Error); //throw; } }
public int cambioPrecioProveedor(BEProductoCliente pBEProductoCliente) { DatabaseHelper pDatabaseHelper = new DatabaseHelper(); int vResultado = 0; try { pDatabaseHelper.ClearParameter(); pDatabaseHelper.AddParameter("@Id_Producto", pBEProductoCliente.IdProducto); pDatabaseHelper.AddParameter("@Id_Cliente", pBEProductoCliente.IdCliente); pDatabaseHelper.AddParameter("@PrecioVenta", pBEProductoCliente.PrecioVenta); pDatabaseHelper.AddParameter("@UsuarioModificacion", pBEProductoCliente.BEUsuarioLogin.IdPersonal); vResultado = pDatabaseHelper.ExecuteNonQuery("DGP_ActualizaProductoCliente", CommandType.StoredProcedure, DBHelper.ConnectionState.CloseOnExit); return(vResultado); } catch (Exception ex) { throw ex; } finally { pDatabaseHelper.Dispose(); } }
public int cambioPrecioProveedor(BEProductoCliente pBEProductoCliente) { return(new DAProductoCliente().cambioPrecioProveedor(pBEProductoCliente)); }
public int cambioPrecioMasivo(BEProductoCliente pBEProductoCliente, bool bAplicaClientes) { return(new DAProductoCliente().cambioPrecioMasivo(pBEProductoCliente, bAplicaClientes)); }