示例#1
0
        /// <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);
            }
        }