예제 #1
0
        public ShowTypesViewModel()
        {
            // I just want this here to be able to use LabelFor
            Type = new ComponentTypeViewModel();

            Types = new List<ComponentTypeViewModel>();
        }
예제 #2
0
        public ShowTypesViewModel()
        {
            // I just want this here to be able to use LabelFor
            Type = new ComponentTypeViewModel();

            Types = new List <ComponentTypeViewModel>();
        }
예제 #3
0
 public ActionResult AddComponentType()
 {
     var result = new ComponentTypeViewModel
     {
         AvailableCategories = AutoMapper.Mapper.Map<List<ComponentCategoryViewModel>>(_categoryRepo.Get())
     };
     return View(result);
 }
예제 #4
0
 public ActionResult AddComponentType(ComponentTypeViewModel model)
 {
     var newEntity = AutoMapper.Mapper.Map<ComponentType>(model);
     _typeRepo.Insert(newEntity);
     return RedirectToAction("ShowTypes");
 }
예제 #5
0
 public ActionResult EditType(ComponentTypeViewModel model)
 {
     var updatedEntity = AutoMapper.Mapper.Map<ComponentType>(model);
     _typeRepo.Update(updatedEntity);
     return RedirectToAction("ShowTypes");
 }