Ejemplo n.º 1
0
        public ViewModels.SubcategoryPropertyViewModel GetById(int id)
        {
            SubcategoryProperty subcatProperty = _subcatPropertyRepository.GetById(id);

            ViewModels.SubcategoryPropertyViewModel subcatPropViewModel = MapToViewModel(subcatProperty);
            return(subcatPropViewModel);
        }
Ejemplo n.º 2
0
 public void Add(ViewModels.SubcategoryPropertyViewModel subcatPropViewModel)
 {
     if (!(_subcatPropertyRepository.GetAll().Where(pd => pd.PropertyID == subcatPropViewModel.PropertyID && pd.SubcategoryID == subcatPropViewModel.SubcategoryID).Any()))
     {
         SubcategoryProperty subcatProperty = MapFromViewModel(subcatPropViewModel);
         _subcatPropertyRepository.Add(subcatProperty);
     }
 }
Ejemplo n.º 3
0
        private SubcategoryProperty MapFromViewModel(ViewModels.SubcategoryPropertyViewModel subcatPropViewModel)
        {
            SubcategoryProperty subcatProperty = Mapper.Map <SubcategoryProperty>(subcatPropViewModel);

            return(subcatProperty);
        }
Ejemplo n.º 4
0
 private ViewModels.SubcategoryPropertyViewModel MapToViewModel(SubcategoryProperty subcatProperty)
 {
     ViewModels.SubcategoryPropertyViewModel subcatPropViewModel = Mapper.Map <ViewModels.SubcategoryPropertyViewModel>(subcatProperty);
     return(subcatPropViewModel);
 }
Ejemplo n.º 5
0
        public void Edit(ViewModels.SubcategoryPropertyViewModel subcatPropViewModel)
        {
            SubcategoryProperty subcatProperty = MapFromViewModel(subcatPropViewModel);

            _subcatPropertyRepository.Edit(subcatProperty);
        }
Ejemplo n.º 6
0
        public void Delete(int Id)
        {
            SubcategoryProperty subcatProperty = _subcatPropertyRepository.GetById(Id);

            _subcatPropertyRepository.Delete(subcatProperty);
        }