private void FrmAgregarPlato_Load(object sender, EventArgs e) { TipoPlatoNegocio tiposPlatos = new TipoPlatoNegocio(); try { cbxTipo.DataSource = tiposPlatos.listaTipoPlato(); cbxTipo.DisplayMember = "descripcion"; cbxTipo.ValueMember = "id"; } catch (Exception ex) { throw ex; } }
private void FrmPlatoModificar_Load(object sender, EventArgs e) { TipoPlatoNegocio tiposPlatos = new TipoPlatoNegocio(); try { cbxTipo.DataSource = tiposPlatos.listaTipoPlato(); cbxTipo.DisplayMember = "descripcion"; cbxTipo.ValueMember = "id"; if (platoLocal != null) { txtNombre.Text = platoLocal.nombre.ToString(); txtDescripcion.Text = platoLocal.descripcion.ToString(); txtPrecio.Text = platoLocal.precio.ToString(); cbxTipo.SelectedValue = platoLocal.tipoPlato.id; id = platoLocal.id; } } catch (Exception ex) { throw ex; } }