public IList <InterventionType> GetInterventionTypes()
        {
            var repos = new InterventionTypeRepository(context);
            var list  = repos.GetAll();

            intType = list;
            return(list);
        }
Exemplo n.º 2
0
        private void CreateInterventionType()
        {
            var factory          = new DbConnectionFactory("CustomDatabase");
            var context          = new DbContext(factory);
            var repos            = new InterventionTypeRepository(context);
            var interventionType = new InterventionType();
            var rows             = repos.GetAll();

            if (rows.Count == 0)
            {
                interventionType.InterventionTypeName  = "Supply and Install Portable Toilet";
                interventionType.InterventionTypeHours = 10;
                interventionType.InterventionTypeCost  = 200;
                repos.Insert(interventionType);
                interventionType.InterventionTypeName  = "Hepatitis Avoidance Training";
                interventionType.InterventionTypeHours = 15;
                interventionType.InterventionTypeCost  = 300;
                repos.Insert(interventionType);
                interventionType.InterventionTypeName  = "Supply and Install Storm-proof Home Kit";
                interventionType.InterventionTypeHours = 50;
                interventionType.InterventionTypeCost  = 500;
                repos.Insert(interventionType);
            }
        }