public static void RefreshPaisList(IEnumerable <Pais> listaNueva) { var listaInterna = listaNueva.ToList(); if (listaInterna.Count <= 0) { return; } paisList.Clear(); foreach (var pais in listaInterna) { paisList.Add(pais); } foreach (var departamento in DepartamentoList.Where(departamento => !string.IsNullOrWhiteSpace(departamento.CodigoPais) && departamento.Pais == null)) { departamento.Pais = PaisList.FirstOrDefault(pais => pais.Codigo == departamento.CodigoPais); } foreach (var municipio in municipioList.Where(municipio => !string.IsNullOrWhiteSpace(municipio.CodigoPais) && municipio.Pais == null)) { municipio.Pais = PaisList.FirstOrDefault(pais => pais.Codigo == municipio.CodigoPais); } }
protected new SortedBindingList <DepartamentoInfo> Localize(object value, string column_name) { SortedBindingList <DepartamentoInfo> list = null; DepartamentoList sourceList = null; switch (FilterType) { case IFilterType.None: if (List == null) { MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS); return(null); } sourceList = List; break; case IFilterType.Filter: if (FilteredList == null) { MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS); return(null); } sourceList = FilteredList; break; } FCriteria criteria = null; string related = "none"; switch (column_name) { default: { criteria = GetCriteria(column_name, value, _operation); } break; } switch (related) { case "none": { list = sourceList.GetSortedSubList(criteria); } break; } if (list.Count == 0) { MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS); return(sourceList.GetSortedList()); } DatosSearch.DataSource = list; DatosSearch.MoveFirst(); AddFilterLabel(column_name, value); Tabla.Focus(); return(list); }
protected new SortedBindingList <DepartamentoInfo> Localize(FilterItem item) { SortedBindingList <DepartamentoInfo> list = null; DepartamentoList sourceList = null; switch (FilterType) { case IFilterType.None: if (List == null) { MessageBox.Show(Face.Resources.Messages.NO_RESULTS); return(null); } sourceList = List; break; case IFilterType.Filter: if (FilteredList == null) { MessageBox.Show(Face.Resources.Messages.NO_RESULTS); return(null); } sourceList = FilteredList; break; } if (item.FilterProperty == IFilterProperty.All) { FCriteria criteria = GetCriteria(string.Empty, item.Value, null, item.Operation); list = sourceList.GetSortedSubList(criteria, _properties_list); } else { FCriteria criteria = GetCriteria(item.Column, item.Value, null, item.Operation); list = sourceList.GetSortedSubList(criteria, _properties_list); } if (list.Count == 0) { MessageBox.Show(Face.Resources.Messages.NO_RESULTS); return(sourceList.GetSortedList()); } DatosSearch.DataSource = list; DatosSearch.MoveFirst(); AddFilterLabel(item); return(list); }
public DepartamentoMngForm(bool isModal, Form parent, DepartamentoList list) : base(isModal, parent, list) { InitializeComponent(); SetView(molView.Normal); // Parche para poder abrir el formulario en modo diseño y no perder la configuracion de columnas DatosLocal_BS = Datos; Tabla.DataSource = DatosLocal_BS; SetMainDataGridView(Tabla); Datos.DataSource = DepartamentoList.NewList().GetSortedList(); base.SortProperty = Codigo.DataPropertyName; this.Text = Resources.Labels.DEPARTAMENTOS; }
public override void UpdateList() { switch (_current_action) { case molAction.Add: if (_entity == null) { return; } List.AddItem(_entity.GetInfo(false)); if (FilterType == IFilterType.Filter) { DepartamentoList listA = DepartamentoList.GetList(_filter_results); listA.AddItem(_entity.GetInfo(false)); _filter_results = listA.GetSortedList(); } break; case molAction.Edit: case molAction.Lock: case molAction.Unlock: if (_entity == null) { return; } ActiveItem.CopyFrom(_entity); break; case molAction.Delete: if (ActiveItem == null) { return; } List.RemoveItem(ActiveOID); if (FilterType == IFilterType.Filter) { DepartamentoList listD = DepartamentoList.GetList(_filter_results); listD.RemoveItem(ActiveOID); _filter_results = listD.GetSortedList(); } break; } _entity = null; RefreshSources(); }
/// <summary> /// Toma la lista de bancos de la base de datos y rellena la tabla. /// </summary> protected override void RefreshMainData() { Bar.Grow(string.Empty, "Departamento"); _selected_oid = ActiveOID; switch (DataType) { case EntityMngFormTypeData.Default: List = DepartamentoList.GetList(false); break; case EntityMngFormTypeData.ByParameter: _sorted_list = List.GetSortedList(); break; } Bar.Grow(string.Empty, "Lista de Productos"); }
public static void RefreshDepartamentoList(IEnumerable <Departamento> listaNueva) { var listaInterna = listaNueva.ToList(); if (listaInterna.Count <= 0) { return; } departamentoList.Clear(); foreach (var departamento in listaInterna) { departamentoList.Add(departamento); } foreach (var municipio in municipioList.Where(municipio => !string.IsNullOrWhiteSpace(municipio.CodigoDepartamento) && municipio.Departamento == null)) { municipio.Departamento = DepartamentoList.FirstOrDefault(dept => dept.Codigo == municipio.CodigoDepartamento); } }
public override void RefreshSecondaryData() { if (EntityInfo != null) { _planes = PlanAnualList.GetList(); Library.Quality.HComboBoxSourceList _combo_planes = new Library.Quality.HComboBoxSourceList(_planes); Datos_Planes.DataSource = _combo_planes; Bar.Grow(); Library.Instruction.InstructorList empleados = Library.Instruction.InstructorList.GetList(false); Library.Instruction.InstructorList responsables = empleados.GetResponsablesList(); Library.Instruction.HComboBoxSourceList _combo_responsables = new Library.Instruction.HComboBoxSourceList(responsables); Datos_Responsables.DataSource = _combo_responsables; Bar.Grow(); Library.Instruction.InstructorList auditores = empleados.GetAuditoresList(); Library.Instruction.HComboBoxSourceList _combo_auditores = new Library.Instruction.HComboBoxSourceList(auditores); Datos_Auditores.DataSource = _combo_auditores; Bar.Grow(); UserList usuarios = UserList.GetList(); Library.Application.HComboBoxSourceList _combo_usuarios = new Library.Application.HComboBoxSourceList(usuarios); Datos_Usuarios_Auditores.DataSource = _combo_usuarios; Datos_Usuarios_Responsables.DataSource = _combo_usuarios; Bar.Grow(); DepartamentoList departamentos = DepartamentoList.GetList(); Library.Quality.HComboBoxSourceList _combo_departamentos = new Library.Quality.HComboBoxSourceList(departamentos); Datos_Departamentos_Auditores.DataSource = _combo_departamentos; Datos_Departamentos_Responsables.DataSource = _combo_departamentos; Bar.Grow(); _tipos_auditorias = TipoAuditoriaList.GetList(); Bar.Grow(); } }