public async Task <IActionResult> Edit(int id, [Bind("Did,DateofDivorce,DcirtificateNumber,HusbandFullName,WifeFullName,WifeAge,RequesterofDinvorce,IssueDate,Cid")] Divorcetbl divorcetbl) { if (id != divorcetbl.Did) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(divorcetbl); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DivorcetblExists(divorcetbl.Did)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["Cid"] = new SelectList(_context.Custometbl, "Cid", "Fname", divorcetbl.Cid); return(View(divorcetbl)); }
public async Task <IActionResult> Create([Bind("Did,DateofDivorce,DcirtificateNumber,HusbandFullName,WifeFullName,WifeAge,RequesterofDinvorce,IssueDate,Cid")] Divorcetbl divorcetbl) { if (ModelState.IsValid) { _context.Add(divorcetbl); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["Cid"] = new SelectList(_context.Custometbl, "Cid", "Fname", divorcetbl.Cid); return(View(divorcetbl)); }