public ActionResult Edit(long Id) { AttributeGroupDTO attributeGroupDTO = _ManageAttributeGroup.GetAttributeGroupById(Id); Mapper.Initialize(c => c.CreateMap <AttributeGroupDTO, AttributeGroupVM>()); AttributeGroupVM attributeGroup = Mapper.Map <AttributeGroupDTO, AttributeGroupVM>(attributeGroupDTO); return(View(attributeGroup)); }
public ActionResult Add(AttributeGroupVM group) { if (ModelState.IsValid) { Mapper.Initialize(c => c.CreateMap <AttributeGroupVM, AttributeGroupDTO>()); AttributeGroupDTO dto = Mapper.Map <AttributeGroupVM, AttributeGroupDTO>(group); OperationDetails op = _ManageAttributeGroup.AddAttributeGroup(dto); return(Json(new { Succedeed = op.Succedeed, message = op.Message })); } else { return(View(group)); } }
public ActionResult Add() { AttributeGroupVM attributeGroup = new AttributeGroupVM(); return(View(attributeGroup)); }