Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("RawMaterialsID,RawMaterialsName,DescriptionOfRawMaterials,ReceptionConditions,StorageConditions,CostKG")] RawMaterial rawMaterial)
        {
            if (id != rawMaterial.RawMaterialsID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(rawMaterial);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RawMaterialExists(rawMaterial.RawMaterialsID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(rawMaterial));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("TypeOfStoragesID,NameOfTypeOfStorages,TypesOfRawMaterialsInStorage,FireProtection,SpecialEquipment,Humidity")] TypeOfStorage typeOfStorage)
        {
            if (id != typeOfStorage.TypeOfStoragesID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(typeOfStorage);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TypeOfStorageExists(typeOfStorage.TypeOfStoragesID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(typeOfStorage));
        }
        public async Task <IActionResult> Edit(int id, [Bind("HumanResourcesDepartmentID,Initial,LengthOfService,AcceptRawMaterials")] HumanResourceDepartment humanResourceDepartment)
        {
            if (id != humanResourceDepartment.HumanResourcesDepartmentID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(humanResourceDepartment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!HumanResourceDepartmentExists(humanResourceDepartment.HumanResourcesDepartmentID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(humanResourceDepartment));
        }
        public async Task <IActionResult> Edit(int id, [Bind("AcceptedRawMaterialsID,TypeOfRawMaterials,NumberKG,Employee,RoomOfStorage,DateAndTime,Cost,RawMaterialsID,HumanResourcesDepartmentID,StoragesID")] AcceptedRawMaterial acceptedRawMaterial)
        {
            if (id != acceptedRawMaterial.AcceptedRawMaterialsID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(acceptedRawMaterial);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AcceptedRawMaterialExists(acceptedRawMaterial.AcceptedRawMaterialsID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["HumanResourcesDepartmentID"] = new SelectList(_context.HumanResourcesDepartment, "HumanResourcesDepartmentID", "HumanResourcesDepartmentID", acceptedRawMaterial.HumanResourcesDepartmentID);
            ViewData["RawMaterialsID"]             = new SelectList(_context.RawMaterials, "RawMaterialsID", "RawMaterialsID", acceptedRawMaterial.RawMaterialsID);
            return(View(acceptedRawMaterial));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Edit(int id, [Bind("StoragesID,NameOfStorage,InventoryNumber,DesignatedEmployee,SquareOfStorage,Tonnage,FillingPercentage,TypeOfStoragesID")] Storage storage)
        {
            if (id != storage.StoragesID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(storage);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StorageExists(storage.StoragesID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TypeOfStoragesID"] = new SelectList(_context.TypeOfStorages, "TypeOfStoragesID", "TypeOfStoragesID", storage.TypeOfStoragesID);
            return(View(storage));
        }