public int CreatePersonalProtectiveEquipmentCategoryTypeModel(PersonalProtectiveEquipmentCategoryTypeModel PersonalProtectiveEquipmentCategoryTypeModel)
        {
            var repository = new PersonalProtectiveEquipmentCategoryTypeModelRepository(_db);
            repository.Add(PersonalProtectiveEquipmentCategoryTypeModel);
            repository.Save();

            return PersonalProtectiveEquipmentCategoryTypeModel.Id;
        }
 public void UpdatePersonalProtectiveEquipmentCategoryTypeModel(PersonalProtectiveEquipmentCategoryTypeModel personalProtectiveEquipmentCategoryTypeModel)
 {
     var repository = new PersonalProtectiveEquipmentCategoryTypeModelRepository(_db);
     repository.Edit(personalProtectiveEquipmentCategoryTypeModel);
     repository.Save();
 }
 public ICollection<PersonalProtectiveEquipmentCategoryTypeModel> SearchPersonalProtectiveEquipmentCategoryTypeModels(string searchTerm)
 {
     var repository = new PersonalProtectiveEquipmentCategoryTypeModelRepository(_db);
     var models = repository.SearchCategoryTypeModels(searchTerm);
     return models;
 }
 public ICollection<PersonalProtectiveEquipmentCategoryTypeModel> GetPersonalProtectiveEquipmentCategoryTypeModels()
 {
     var repository = new PersonalProtectiveEquipmentCategoryTypeModelRepository(_db);
     return repository.GetAllWithChildren().ToList();
 }
 public PersonalProtectiveEquipmentCategoryTypeModel GetPersonalProtectiveEquipmentCategoryTypeModel(int Id)
 {
     //shift the include statements to the repository method
     var repository = new PersonalProtectiveEquipmentCategoryTypeModelRepository(_db);
     return repository.FindBy(c => c.Id == Id).Include(c => c.PersonalProtectiveEquipmentCategoryTypeModelInventory)
                                              .Include(c => c.PersonalProtectiveEquipmentCategoryType).SingleOrDefault();
 }
 public void DeletePersonalProtectiveEquipmentCategoryTypeModel(int Id)
 {
     var repository = new PersonalProtectiveEquipmentCategoryTypeModelRepository(_db);
     repository.Delete(Id);
     repository.Save();
 }