Ejemplo n.º 1
0
        public ActionResult Create([Bind(Include = "Name")] EquipmentTypeVM equipmentTypeVM)
        {
            if (ModelState.IsValid)
            {
                EquipmentTypeDTO equipmentTypeDTO = Mapper.Map <EquipmentTypeDTO>(equipmentTypeVM);
                EquipmentTypeService.Add(equipmentTypeDTO);

                return(RedirectToAction("Index"));
            }

            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult Edit(Guid?id)
        {
            try
            {
                EquipmentTypeDTO equipmentTypeDTO = EquipmentTypeService.Get(id);
                EquipmentTypeVM  equipmentTypeVM  = Mapper.Map <EquipmentTypeVM>(equipmentTypeDTO);

                return(View(equipmentTypeVM));
            }
            catch (ArgumentNullException)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            catch (NotFoundException)
            {
                return(HttpNotFound());
            }
        }