public async Task <IActionResult> Create(LicenseCity licenseCity) { if (ModelState.IsValid) { await _service.AddLicenseCity(licenseCity); } return(RedirectToAction("Index", "LicenseDistrict")); }
public async Task EditLicenseCity(LicenseCity editLicenseCity) { var licenseCity = await _context.LicenseCities.FindAsync(editLicenseCity.LicenseCityId); licenseCity.CityName = editLicenseCity.CityName; licenseCity.LicenseDistrictId = editLicenseCity.LicenseDistrictId; licenseCity.LicenseExist = editLicenseCity.LicenseExist; _context.LicenseCities.Update(licenseCity); await _context.SaveChangesAsync(); }
public async Task AddLicenseCity(LicenseCity addLicenseCity) { await _context.LicenseCities.AddAsync(addLicenseCity); await _context.SaveChangesAsync(); }
public async Task <IActionResult> Edit(LicenseCity licenseCity) { await _service.EditLicenseCity(licenseCity); return(RedirectToAction("Index", "LicenseDistrict")); }