public async Task <IActionResult> Edit(int id, [Bind("Id,CountryId,LanguageId,Name")] MstcountryLangMap mstcountryLangMap) { if (id != mstcountryLangMap.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mstcountryLangMap); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstcountryLangMapExists(mstcountryLangMap.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CountryId"] = new SelectList(_context.Country, "Id", "Code", mstcountryLangMap.CountryId); ViewData["LanguageId"] = new SelectList(_context.Language, "Id", "Name", mstcountryLangMap.LanguageId); return(View(mstcountryLangMap)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Code")] Language language) { if (id != language.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(language); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LanguageExists(language.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(language)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Code,Isocode2,Isocode3,DialCode,Nationality")] Country country) { if (id != country.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(country); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CountryExists(country.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(country)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,LanguageId,MissionId,CountryOpsId,UnitOpsId")] LanguageMap languageMap) { if (id != languageMap.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(languageMap); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LanguageMapExists(languageMap.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CountryOpsId"] = new SelectList(_context.CountryOfOperation, "Id", "Code", languageMap.CountryOpsId); ViewData["LanguageId"] = new SelectList(_context.Language, "Id", "Name", languageMap.LanguageId); ViewData["MissionId"] = new SelectList(_context.Mission, "Id", "Code", languageMap.MissionId); ViewData["UnitOpsId"] = new SelectList(_context.UnitOps, "Id", "Code", languageMap.UnitOpsId); return(View(languageMap)); }