示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("ClaimMediationId,Description,Action,ClaimId")] ClaimMediation claimMediation)
        {
            if (id != claimMediation.ClaimMediationId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(claimMediation);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClaimMediationExists(claimMediation.ClaimMediationId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClaimId"] = new SelectList(_context.Claim, "ClaimId", "Description", claimMediation.ClaimId);
            return(View(claimMediation));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("ClaimMediationId,Description,Action,ClaimId")] ClaimMediation claimMediation)
        {
            if (ModelState.IsValid)
            {
                _context.Add(claimMediation);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClaimId"] = new SelectList(_context.Claim, "ClaimId", "Description", claimMediation.ClaimId);
            return(View(claimMediation));
        }