public async Task <IActionResult> Edit(int id, [Bind("Id,Uiid,RoleId")] UIRoleMap uIRoleMap) { if (id != uIRoleMap.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(uIRoleMap); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UIRoleMapExists(uIRoleMap.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["RoleId"] = new SelectList(_context.RoleMaster, "Id", "Code", uIRoleMap.RoleId); ViewData["Uiid"] = new SelectList(_context.UIMaster, "Id", "Name", uIRoleMap.Uiid); return(View(uIRoleMap)); }
public async Task <IActionResult> Create([Bind("Id,Uiid,RoleId")] UIRoleMap uIRoleMap) { if (ModelState.IsValid) { _context.Add(uIRoleMap); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["RoleId"] = new SelectList(_context.RoleMaster, "Id", "Code", uIRoleMap.RoleId); ViewData["Uiid"] = new SelectList(_context.UIMaster, "Id", "Name", uIRoleMap.Uiid); return(View(uIRoleMap)); }