public async Task <IActionResult> Edit(int id, [Bind("VehicleID,Mark,ModelType,СarryingСapacity,YearIssue,UsefulVolume,VehicleType,OverallDimensions")] Vehicle vehicle)
        {
            if (id != vehicle.VehicleID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vehicle);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VehicleExists(vehicle.VehicleID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(vehicle));
        }
Esempio n. 2
0
        public async Task <IActionResult> Edit(int id, [Bind("BasicParameterID,PGN,PGL,Acronym,SPNName,SPNNameRu,DataRange,DataSource")] BasicParameter basicParameter)
        {
            if (id != basicParameter.BasicParameterID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(basicParameter);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BasicParameterExists(basicParameter.BasicParameterID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(basicParameter));
        }
Esempio n. 3
0
        public async Task <IActionResult> Edit(int id, [Bind("VehicleGroupID,VehicleGroupName")] VehicleGroup vehicleGroup)
        {
            if (id != vehicleGroup.VehicleGroupID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vehicleGroup);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VehicleGroupExists(vehicleGroup.VehicleGroupID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(vehicleGroup));
        }
        public async Task <IActionResult> Edit(int id, [Bind("UserID,UserLogin,UserPassword,UserName,UserSurname,UserPhone,UserRole")] User user)
        {
            if (id != user.UserID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(user);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserExists(user.UserID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
Esempio n. 5
0
        public async Task <IActionResult> Edit(int id, [Bind("RoleID,RoleName")] Role role)
        {
            if (id != role.RoleID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(role);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RoleExists(role.RoleID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(role));
        }
Esempio n. 6
0
        public async Task <IActionResult> Edit(int id, [Bind("ParameterID,VehicleID,BasicParameterID,BasicParameterValue,BasicParameterTimeValue")] Parameter parameter)
        {
            if (id != parameter.ParameterID)
            {
                return(NotFound());
            }

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