Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("EngineCylinderArrangementId,Name,Description,IsActive,CreatedAt,CreatedBy,UpdatedAt,UpdatedBy")] Enginecylinderarrangement enginecylinderarrangement)
        {
            if (id != enginecylinderarrangement.EngineCylinderArrangementId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(enginecylinderarrangement);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EnginecylinderarrangementExists(enginecylinderarrangement.EngineCylinderArrangementId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(enginecylinderarrangement));
        }
Пример #2
0
        public async Task <IActionResult> Edit(int id, [Bind("PriceTypeId,Name,Description,IsActive,CreatedAt,CreatedBy,UpdatedAt,UpdatedBy")] Pricetype pricetype)
        {
            if (id != pricetype.PriceTypeId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pricetype);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PricetypeExists(pricetype.PriceTypeId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(pricetype));
        }
Пример #3
0
        public async Task <IActionResult> Edit(int id, [Bind("VehicleEngineId,Name,Description,IsActive,EngineCylinderArrangementId,EngineSizeId,CreatedAt,CreatedBy,UpdatedAt,UpdatedBy")] Vehicleengine vehicleengine)
        {
            if (id != vehicleengine.VehicleEngineId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vehicleengine);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VehicleengineExists(vehicleengine.VehicleEngineId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EngineCylinderArrangementId"] = new SelectList(_context.Enginecylinderarrangement, "EngineCylinderArrangementId", "CreatedBy", vehicleengine.EngineCylinderArrangementId);
            ViewData["EngineSizeId"] = new SelectList(_context.Enginesize, "EngineSizeId", "CreatedBy", vehicleengine.EngineSizeId);
            return(View(vehicleengine));
        }
Пример #4
0
        public async Task <IActionResult> Edit(int id, [Bind("VehicleCategoryId,Name,Description,IsActive,CreatedAt,CreatedBy,UpdatedAt,UpdatedBy")] Vehiclecategory vehiclecategory)
        {
            if (id != vehiclecategory.VehicleCategoryId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vehiclecategory);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VehiclecategoryExists(vehiclecategory.VehicleCategoryId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(vehiclecategory));
        }
Пример #5
0
        public async Task <IActionResult> Edit(int id, [Bind("VehicleModelId,Name,Description,IsActive,VehicleManufacturerId,CreatedAt,CreatedBy,UpdatedAt,UpdatedBy")] Vehiclemodel vehiclemodel)
        {
            if (id != vehiclemodel.VehicleModelId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vehiclemodel);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VehiclemodelExists(vehiclemodel.VehicleModelId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["VehicleManufacturerId"] = new SelectList(_context.Vehiclemanufacturer, "VehicleManufacturerId", "CreatedBy", vehiclemodel.VehicleManufacturerId);
            return(View(vehiclemodel));
        }
Пример #6
0
        public async Task <IActionResult> Edit(int id, [Bind("VehicleId,Version,BeginYear,EndYear,EngineOilCapacity,Description,ImagePath,Link,SearchVehicle,IsActive,VehicleManufacturerId,VehicleModelId,VehicleCategoryId,VehicleEngineId,VehicleTypeId,CreatedAt,CreatedBy,UpdatedAt,UpdatedBy")] 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)));
            }
            ViewData["VehicleCategoryId"]     = new SelectList(_context.Vehiclecategory, "VehicleCategoryId", "CreatedBy", vehicle.VehicleCategoryId);
            ViewData["VehicleEngineId"]       = new SelectList(_context.Vehicleengine, "VehicleEngineId", "CreatedBy", vehicle.VehicleEngineId);
            ViewData["VehicleManufacturerId"] = new SelectList(_context.Vehiclemanufacturer, "VehicleManufacturerId", "CreatedBy", vehicle.VehicleManufacturerId);
            ViewData["VehicleModelId"]        = new SelectList(_context.Vehiclemodel, "VehicleModelId", "CreatedBy", vehicle.VehicleModelId);
            ViewData["VehicleTypeId"]         = new SelectList(_context.Vehicletype, "VehicleTypeId", "CreatedBy", vehicle.VehicleTypeId);
            return(View(vehicle));
        }
Пример #7
0
        public async Task <IActionResult> Edit(int id, [Bind("VehicleManufacturerId,ShortName,FullName,Description,ImagePath,Link,IsActive,CreatedAt,CreatedBy,UpdatedAt,UpdatedBy")] Vehiclemanufacturer vehiclemanufacturer)
        {
            if (id != vehiclemanufacturer.VehicleManufacturerId)
            {
                return(NotFound());
            }

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