Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,RoleName,Details,Status")] Role role)
        {
            if (id != role.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(role);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RoleExists(role.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(role));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,ControllerId,ActionTitle,ActionName")] AuthAction authAction)
        {
            if (id != authAction.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(authAction);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AuthActionExists(authAction.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(authAction));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,CountryId,StateId,CityName,City3Code,City2Code,Status")] City city)
        {
            if (id != city.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(city);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CityExists(city.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(city));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,CountryId,StateName,State3Code,State2Code,Ordering,Status")] State state)
        {
            if (id != state.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(state);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StateExists(state.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(state));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,CompanyName,Address,Email,Phone")] Company company)
        {
            if (id != company.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(company);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CompanyExists(company.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(company));
        }