private void LlenaCampos() { objeto = presentacionController.SelectOne(TxtClave.Text.Trim()); if (objeto == null) { ModoCreate = true; } else { ModoCreate = false; TxtClave.Text = objeto.PresentacionId; TxtNombre.Text = objeto.Nombre; } }
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; } }