public async Task <IActionResult> Edit(int id, [Bind("departmentAttributeId,departmentAttributeName,departmentAttributeType,valueLength,isRequired,valueRegEx")] DepartmentAttributes departmentAttributes) { step = ActionStep.edit; if (id != departmentAttributes.departmentAttributeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(departmentAttributes); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DepartmentAttributesExists(departmentAttributes.departmentAttributeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(departmentAttributes)); }
public async Task <IActionResult> Create([Bind("departmentAttributeId,departmentAttributeName,departmentAttributeType,valueLength,isRequired,valueRegEx")] DepartmentAttributes departmentAttributes) { step = ActionStep.create; if (ModelState.IsValid) { _context.Add(departmentAttributes); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(departmentAttributes)); }