private void TxtPrecio1_Leave(object sender, EventArgs e) { TxtPrecio1.Text = Ambiente.FDinero(TxtPrecio1.Text); TxtU1.Text = Ambiente.GetMargen(TxtPrecioCompra.Text, TxtPrecio1.Text); TxtPrecioS1.Text = Ambiente.GetPrecioSalida(TxtPrecio1.Text, Impuestos); }
private void TxtPrecio4_Leave(object sender, EventArgs e) { TxtPrecio4.Text = Ambiente.FDinero(TxtPrecio4.Text); TxtU4.Text = Ambiente.GetMargen(TxtPrecioCompra.Text, TxtPrecio4.Text); TxtPrecioS4.Text = Ambiente.GetPrecioSalida(TxtPrecio4.Text, impuestos); BtnAgregar.Focus(); }
private void LlenaCampos() { if (objeto == null) { ModoCreate = true; } else { ModoCreate = false; TxtProductoId.Text = objeto.ProductoId; if (objeto.IsDeleted) { TxtProductoId.BackColor = Color.Red; } else { TxtProductoId.BackColor = Color.White; } TxtDescripcion.Text = objeto.Descripcion; TxtContenido.Text = objeto.Contenido; TxtPresentacion.Text = objeto.PresentacionId; TxtUnidadMedida.Text = objeto.UnidadMedidaId; TxtUnidades.Text = objeto.Unidades; TxtLaboratorio.Text = objeto.LaboratorioId; TxtCategoria.Text = objeto.CategoriaId; TxtUnidadCFDI.Text = objeto.ClaveUnidadId; TxtClaveCFDI.Text = objeto.ClaveProdServId; TxtPrecioCompra.Text = objeto.PrecioCompra.ToString(); TxtPrecioCaja.Text = objeto.PrecioCaja.ToString(); ChkEnCatalogo.Checked = !objeto.IsDeleted; ChkLote.Checked = objeto.TieneLote; CargaListaImpuestos(objeto); CargaGridImpuestos(); LlenaGridSustancias(objeto.ProductoSustancia); CargaGridExitencia(objeto.Stock); TxtPrecio1.Text = objeto.Precio1.ToString(); TxtPrecio2.Text = objeto.Precio2.ToString(); TxtPrecio3.Text = objeto.Precio3.ToString(); TxtPrecio4.Text = objeto.Precio4.ToString(); TxtU1.Text = objeto.Utilidad1.ToString(); TxtU2.Text = objeto.Utilidad2.ToString(); TxtU3.Text = objeto.Utilidad3.ToString(); TxtU4.Text = objeto.Utilidad4.ToString(); NMin.Value = objeto.Min; NMax.Value = objeto.Max; TxtPrecioS1.Text = Ambiente.GetPrecioSalida(objeto.Precio1.ToString(), Impuestos); TxtPrecioS2.Text = Ambiente.GetPrecioSalida(objeto.Precio2.ToString(), Impuestos); TxtPrecioS3.Text = Ambiente.GetPrecioSalida(objeto.Precio3.ToString(), Impuestos); TxtPrecioS4.Text = Ambiente.GetPrecioSalida(objeto.Precio4.ToString(), Impuestos); TxtRutaImg.Text = objeto.RutaImg; //GridExistencias.DataSource = objeto.ProductoAlmacen.Select(x => new { x.AlmacenId, x.ExistenciaId }).ToList(); PbxImagen.Image = GetImg(objeto.RutaImg); } }
private void LlenaGrid(List <Producto> productos) { Mallap.Rows.Clear(); Mallap.Refresh(); foreach (var p in productos) { Mallap.Rows.Add(); Mallap.Rows[Mallap.RowCount - 1].Cells[0].Value = p.Descripcion; Mallap.Rows[Mallap.RowCount - 1].Cells[1].Value = p.Contenido; var pr = PresentacionController.SelectOne(p.PresentacionId); if (pr != null) { Mallap.Rows[Mallap.RowCount - 1].Cells[2].Value = pr.Nombre; } else { Mallap.Rows[Mallap.RowCount - 1].Cells[2].Value = "SYS"; } var lab = LaboratorioController.SelectOne(p.LaboratorioId); if (lab != null) { Mallap.Rows[Mallap.RowCount - 1].Cells[3].Value = lab.Nombre; } else { Mallap.Rows[Mallap.RowCount - 1].Cells[3].Value = "SYS"; } Mallap.Rows[Mallap.RowCount - 1].Cells[4].Value = p.Unidades; Mallap.Rows[Mallap.RowCount - 1].Cells[5].Value = Math.Round(Ambiente.GetPrecioSalida(p), 1); Mallap.Rows[Mallap.RowCount - 1].Cells[6].Value = p.Stock; Mallap.Rows[Mallap.RowCount - 1].Cells[7].Value = p.ProductoId; } LblCoincidencias.Text = productos.Count + " Coincidencias"; if (Mallap.RowCount > 0) { Mallap.Focus(); Mallap.Rows[0].Selected = true; } }
private void LlenaDatosProducto() { TxtProductoId.Text = producto.ProductoId; TxtPrecioCompra.Text = producto.PrecioCompra.ToString(); TxtPrecioCaja.Text = producto.PrecioCaja.ToString(); TxtDescripcion.Text = producto.Descripcion; TxtU1.Text = producto.Utilidad1.ToString(); TxtU2.Text = producto.Utilidad2.ToString(); TxtU3.Text = producto.Utilidad3.ToString(); TxtU4.Text = producto.Utilidad4.ToString(); TxtPrecio1.Text = producto.Precio1.ToString(); TxtPrecio2.Text = producto.Precio2.ToString(); TxtPrecio3.Text = producto.Precio3.ToString(); TxtPrecio4.Text = producto.Precio4.ToString(); CargaListaImpuestos(producto); CargaGridImpuestos(); TxtPrecioS1.Text = Ambiente.GetPrecioSalida(TxtPrecio1.Text, impuestos); TxtPrecioS2.Text = Ambiente.GetPrecioSalida(TxtPrecio2.Text, impuestos); TxtPrecioS3.Text = Ambiente.GetPrecioSalida(TxtPrecio3.Text, impuestos); TxtPrecioS4.Text = Ambiente.GetPrecioSalida(TxtPrecio4.Text, impuestos); PbxImagen.Image = GetImg(producto.RutaImg); }