Esempio n. 1
0
        public async Task EditLicenseDistrict(LicenseDistrict editLicenseDistrict)
        {
            var license = await _context.LicenseDistricts.FindAsync(editLicenseDistrict.LicenseDistrictId);

            license.DistrictName = editLicenseDistrict.DistrictName;
            _context.LicenseDistricts.Update(license);
            await _context.SaveChangesAsync();
        }
 public async Task <IActionResult> Create(LicenseDistrict licenseDistrict)
 {
     if (ModelState.IsValid)
     {
         await _service.AddLicenseDistrict(licenseDistrict);
     }
     return(RedirectToAction("Index", "LicenseDistrict"));
 }
        public async Task <IActionResult> Edit(LicenseDistrict licenseDistrict)
        {
            await _service.EditLicenseDistrict(licenseDistrict);

            return(RedirectToAction("Index", "LicenseDistrict"));
        }
Esempio n. 4
0
        public async Task AddLicenseDistrict(LicenseDistrict addLicenseDistrict)
        {
            await _context.LicenseDistricts.AddAsync(addLicenseDistrict);

            await _context.SaveChangesAsync();
        }