private void cmb_productos_SelectionChangeCommitted(object sender, EventArgs e) { if ((int)cmb_productos.SelectedValue != 0) { int idProducto = Convert.ToInt32(cmb_productos.SelectedValue); Producto p = new Producto(); infoPlan = new DetallePlanProduccion(); infoPlan = DetallePlanProduccionDAO.GetDetallePlanXProductoParaOT((int)cmb_productos.SelectedValue, dtp_creacion_OT.Value.Date); p = ProductoDAO.GetByIdProd(idProducto, dtp_creacion_OT.Value.Date); lbl_cant.Text = p.cantidadAProd.ToString(); lbl_unidad.Text = p.Unidad.Nombre; lbl_tiempo.Text = ((Convert.ToDouble(lbl_cant.Text) * p.tiempoProduccion) / p.cantidadProductos).ToString(); List <DetalleProducto> dp = new List <DetalleProducto>(); try { dp = EstructuraProductoDAO.GetAll(idProducto); } catch (ApplicationException ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } cargarGrillaDetalleProducto(dp); } }