/// <summary> /// Description: Obtiene los datos de la base de datos /// </summary> private void GetData() { DataContext = this; Systems = systemLogic.ReadSystems(); ProcedureTypes = procedureLogic.ReadProceduresTypes(); SystemsCaravan = new List <SystemsCaravan>(); SystemsCaravan systemCaravan; ProceduresType proceduresType; foreach (system system in Systems) { systemCaravan = new SystemsCaravan(system); foreach (procedure_type proceduretype in ProcedureTypes) { proceduresType = new ProceduresType(proceduretype); List <procedure> listProcedures = procedureLogic.ReadProceduresBySystemProcType(system, proceduretype); foreach (var procedure in listProcedures) { proceduresType.Procedures.Add(new Procedures(procedure)); } if (proceduresType.Procedures.Count > 0) { systemCaravan.ProceduresType.Add(proceduresType); } } SystemsCaravan.Add(systemCaravan); } }
/// <summary> /// Description: Muestra cada uno de los procedimiento de la categoría seleccionada /// </summary> private void _radTreeViewSystems_rtv_SelectionChanged(object sender, SelectionChangedEventArgs e) { ProceduresType proceduresType = _radTreeViewSystems_rtv.SelectedItem as ProceduresType; if (proceduresType != null) { RadTreeView treeView = sender as RadTreeView; RadTreeViewItem item = treeView.ContainerFromItemRecursive(treeView.SelectedItem); RadTreeViewItem parentItem = item.ParentItem; SystemsCaravan systemsCaravan = parentItem.DataContext as SystemsCaravan; if (systemsCaravan != null) { if ((systemsCaravan.System.system_id == (int)EnumSystemsType.Fuel) && (proceduresType.ProcedureType.procedure_type_id == (int)EnumProceduresType.Failure)) { _listFailsProcedures_cco.Content = _listFailsProceduresType2_use; _listFailsProceduresType2_use.UpdateData(item.Index, systemsCaravan); } else { if ((systemsCaravan.System.system_id == (int)EnumSystemsType.Miscellaneus) && (proceduresType.ProcedureType.procedure_type_id == (int)EnumProceduresType.Failure)) { _listFailsProcedures_cco.Content = _listFailsProceduresType3_use; _listFailsProceduresType3_use.UpdateData(item.Index, systemsCaravan); } else { if ((systemsCaravan.System.system_id == (int)EnumSystemsType.Electrical) && (proceduresType.ProcedureType.procedure_type_id == (int)EnumProceduresType.Failure)) { _listFailsProcedures_cco.Content = _listFailsProceduresType4_use; _listFailsProceduresType4_use.UpdateData(item.Index, systemsCaravan); } else { _listFailsProcedures_cco.Content = _listFailsProceduresType1_use; _listFailsProceduresType1_use.UpdateData(item.Index, systemsCaravan); } } } } } }