void CargarCombos() { try { string msjError = ""; dtpFechaIni.EditValue = DateTime.Now.AddMonths(-1); dtpFechaFin.EditValue = DateTime.Now.Date; lstSucuInfo = busSucursal.Get_List_Sucursal_Todos(param.IdEmpresa); cmb_Sucursal.DataSource = lstSucuInfo; CargarInfo(); lista_tipo_activo_fijo = bus_tipo_ActFij.Get_List_ActivoFijoTipo(param.IdEmpresa); lista_tipo_activo_fijo.Add(info_Tip_Af); cmb_tipoActivo.DataSource = lista_tipo_activo_fijo.OrderBy(q => q.IdActivoFijoTipo).ToList(); barEditItemTipoActivo.EditValue = 0; lista_depre = bus_depre.Get_List_ActivoFijo(param.IdEmpresa); lista_depre.Add(info_Depre); cmb_Tipo_Depre.DataSource = lista_depre.OrderBy(q => q.IdTipoDepreciacion).ToList(); lstCatalogo = busCatalogo.Get_List_Catalogo("TIP_ESTADO_AF"); lstCatalogo.Add(info_Cata); cmb_Estado.DataSource = lstCatalogo.OrderBy(q => q.IdCatalogo).ToList(); lstPeriodo = busPeriodo.Get_List_Periodo(param.IdEmpresa, ref msjError); cmbPeriodoIni.DataSource = lstPeriodo; cmbPeriodoFin.DataSource = lstPeriodo; barPeriodoIni.EditValue = (DateTime.Today.Year.ToString()) + ((DateTime.Today.Month.ToString().Length == 1) ? "0" + DateTime.Today.Month.ToString() : DateTime.Today.Month.ToString()); barPeriodoFin.EditValue = (DateTime.Today.Year.ToString()) + ((DateTime.Today.Month.ToString().Length == 1) ? "0" + DateTime.Today.Month.ToString() : DateTime.Today.Month.ToString()); lstActivoFijo = busActivoFijo.Get_List_ActivoFijo(param.IdEmpresa, ""); lstActivoFijo.Add(info_AF); cmbActivoFijo.DataSource = lstActivoFijo.OrderBy(q => q.IdActivoFijo).ToList(); Af_Departamento_Bus BusDep = new Af_Departamento_Bus(); List <Af_Departamento_Info> listDep = new List <Af_Departamento_Info>(); listDep = BusDep.Get_List_Departamento(param.IdEmpresa); listDep.Add(new Af_Departamento_Info(param.IdEmpresa, 0, "A", "Todos")); cmb_departamento.DataSource = listDep; lista_centro_costo = bus_centro_costo.Get_list_Centro_Costo(param.IdEmpresa, ref msjError); cmb_cetroCosto.DataSource = lista_centro_costo; } catch (Exception ex) { MessageBox.Show(ex.ToString()); Log_Error_bus.Log_Error(ex.ToString()); } }
public void cargar() { try { List_Departamento = new List <Af_Departamento_Info>(); List_Departamento = Bus_Departamento.Get_List_Departamento(param.IdEmpresa); cmbDepartamento.Properties.DataSource = List_Departamento; //if (List_Departamento.Count > 0) //{ // cmbDepartamento.EditValue = List_Departamento.First().IdDepartamento; //} } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }