public ActionResult Create(AttributItem attributItem) { if (ModelState.IsValid) { _attributeItemService.Add(attributItem); return(RedirectToAction("Index/" + Url.RequestContext.RouteData.Values["id"])); } ViewBag.AttributGrpId = new SelectList(_attributeGrpService.GetAllAttributeGrp(), "AttributGrpId", "Name", attributItem.AttributGrpId); return(View(attributItem)); }
public async Task <IActionResult> Create([Bind("AttributItemId,Name,value,idfilter,AttributGrpId")] AttributItem attributItem) { if (ModelState.IsValid) { await _attributeItemService.Add(attributItem); return(RedirectToAction(nameof(Index), new { id = attributItem.AttributGrpId })); } ViewData["AttributGrpId"] = new SelectList(await _attributeGrpService.GetAll(), "AttributGrpId", "Name", attributItem.AttributGrpId); return(View(attributItem)); }