private void cargar_detalles_oc() { try { List <decimal> lst_oc = new List <decimal>(); foreach (var item in blst_det_oc.Where(q => q.seleccionado == true)) { lst_oc.Add(item.IdOrdenCompra_ext); } #region Detalle de oc blst_det_oc_det = new BindingList <imp_orden_compra_ext_det_Info>(bus_det_oc_det.get_list(param.IdEmpresa, lst_oc)); gridControl_oc_ex_det.DataSource = blst_det_oc_det; #endregion #region Detalle de gastos blst_det_gastos = new BindingList <imp_orden_compra_ext_ct_cbteble_det_gastos_Info>(bus_det_gastos.get_list(param.IdEmpresa, lst_oc)); gridControl_gastos.DataSource = blst_det_gastos; #endregion } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void cmb_orden_compra_externa_EditValueChanged(object sender, EventArgs e) { try { if (cmb_orden_compra_externa.EditValue == null) { blst_det = new BindingList <imp_orden_compra_ext_ct_cbteble_det_gastos_Info>(); cmb_plancta.EditValue = null; } else { blst_det = new BindingList <imp_orden_compra_ext_ct_cbteble_det_gastos_Info>(bus_det.get_list(param.IdEmpresa, Convert.ToDecimal(cmb_orden_compra_externa.EditValue))); imp_orden_compra_ext_Info info_oc_ext = lst_oc_ext.FirstOrDefault(q => q.IdOrdenCompra_ext == Convert.ToDecimal(cmb_orden_compra_externa.EditValue)); if (info_oc_ext != null) { cmb_plancta.EditValue = info_oc_ext.IdCtaCble_importacion; } else { cmb_plancta.EditValue = null; } } gridControl_det.DataSource = blst_det; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }