Ejemplo n.º 1
0
        public virtual ActionResult EditAttribute(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var attribute = _attributeService.GetAttributeById(id.Value);

            if (attribute == null)
            {
                return(HttpNotFound());
            }

            return(View(new EditAttributeViewModel {
                Name = attribute.Name, CategoryId = attribute.CategoryId, Id = attribute.Id
            }));
        }
Ejemplo n.º 2
0
        public ActionResult Edit(int id)
        {
            var entity = _attributeService.GetAttributeById(id);
            var model  = entity.MapTo <AttributeModel>();

            PrepareAttributeModel(model);
            return(View(model));
        }